API Features
Everything a developer needs to shorten URLs at scale. No configuration required.
Zero Authentication
No API keys, no OAuth tokens, no signup forms. Send your first request the moment you read this page. The URL shortener API is completely open and free to use from any HTTP client.
Full REST API
Standard REST endpoints with JSON request and response bodies. Works with cURL, fetch, axios, requests, or any HTTP library in any programming language. Predictable status codes and error messages.
MCP Integration
Native Model Context Protocol server for AI-powered workflows. Connect from Claude Desktop, Cursor, or any MCP-compatible client to shorten URLs, check analytics, and manage links with natural language.
Rich Responses
Every shorten response includes the short URL, a deletion token, a QR code endpoint, and a link to the click analytics dashboard. One request gives you everything you need to manage the link.
API Endpoints
All endpoints use the base URL https://linkshrink.dev. No authentication headers required for any request.
Shorten a single URL. Supports optional alias for custom short URLs, ttl for expiry in seconds, password for link protection, and force_preview to show a preview page before redirecting.
Retrieve click analytics for any short URL. Returns total click count, daily breakdown, top referrers, and country-level geographic data. Privacy-preserving — no IP addresses stored.
Delete a short URL using the deletion token returned at creation. The alias is freed immediately and can be reused. Useful for cleaning up expired campaigns or rotating links.
Generate a QR code for any short URL. Supports PNG and SVG formats. Customise size, foreground colour, and background colour via query parameters.
Shorten up to 100 URLs in a single API call. Ideal for bulk URL shortening workflows like CSV processing, migration scripts, and marketing campaign launchers.
Code Examples
Start shortening URLs programmatically in seconds. Copy, paste, run — no setup needed.
# Shorten a URL with a custom alias curl -X POST https://linkshrink.dev/api/v1/shorten \ -H "Content-Type: application/json" \ -d '{"url":"https://example.com/long-path","alias":"my-link"}' # Response: # { # "status": "success", # "data": { # "shortUrl": "https://linkshrink.dev/my-link", # "code": "my-link", # "originalUrl": "https://example.com/long-path", # "deleteToken": "a1b2c3d4...", # "analytics": "https://linkshrink.dev/api/v1/stats/my-link" # } # } # Get click analytics curl https://linkshrink.dev/api/v1/stats/my-link # Generate a QR code (PNG) curl -o qr.png https://linkshrink.dev/api/v1/qr/my-link.png?size=512
MCP Integration
Connect LinkShrink to your AI-powered development workflow.
What is MCP?
The Model Context Protocol (MCP) is an open standard that lets AI assistants interact with external tools and APIs. LinkShrink provides a native MCP server that works with Claude Desktop, Cursor, and any MCP-compatible client. Instead of writing HTTP requests manually, your AI assistant can shorten URLs, retrieve click statistics, and delete links through natural language.
Install the MCP Server
After installation, configure your MCP client to use linkshrink-mcp as a tool server. The package exposes three tools: shorten_url for creating short links, get_stats for retrieving click analytics, and delete_url for removing links with a deletion token.
Developer API + AI = Superpower
Combine the URL shortener API with MCP to build AI-driven link management workflows. Automate campaign link creation from Slack, generate short URLs during code review, or let your AI assistant batch-shorten URLs from a spreadsheet — all without leaving your editor.
Who Uses a URL Shortener API?
Developers across every stack rely on programmatic URL shortening for automation, analytics, and user experience.
CI/CD Pipelines & DevOps
Generate short links for deployment previews, pull request review links, and release changelogs directly in your pipeline. A single cURL command in a GitHub Actions workflow or GitLab CI job gives you a clean, shareable link for every build artifact.
Chat Bots & Slack Integrations
When your bot shares URLs in Slack, Discord, or Teams, long URLs break formatting and look unprofessional. Use the LinkShrink API to shorten links before sending them. The bulk endpoint handles multiple URLs if your bot shares lists.
Marketing Automation
Email campaign platforms, social schedulers, and CRM systems can call the API to create trackable short links for each subscriber or segment. Use custom aliases to make campaign links memorable and brand-aligned.
Internal Tools & SaaS Products
Embed URL shortening into your product so users get clean links for sharing. No API key management means your backend calls LinkShrink directly — no secrets to rotate, no billing to monitor, no vendor lock-in.
Frequently Asked Questions
Do I need an API key to use the LinkShrink API?
No. LinkShrink requires no API key, no OAuth token, no signup, and no authentication of any kind. Just send a POST request to https://linkshrink.dev/api/v1/shorten with your URL in the JSON body and you get a shortened link back instantly. There is nothing to configure before your first request.
What are the rate limits?
LinkShrink applies fair-use rate limiting to prevent abuse, but normal developer usage is not restricted. Whether you are shortening URLs in a CI/CD pipeline, a marketing automation tool, or a chat bot, you will not hit quotas under typical usage patterns. The developer URL shortener is designed for reliable, programmatic use without billing anxiety.
Can I create custom short URL aliases via the API?
Yes. Include an alias field in your POST request body to set a memorable slug like /my-campaign or /promo-2026. Custom aliases are free and unlimited. If the alias is already taken, the API returns a 409 Conflict error so you can choose another.
What response format does the API return?
All API endpoints return JSON with a consistent structure: a status field (success or error), a data object containing the result, and a message field for errors. The shorten endpoint returns the short URL, original URL, short code, deletion token, analytics URL, and QR code endpoint in every response.
Is there a bulk URL shortening endpoint?
Yes. POST an array of URLs to /api/v1/shorten/bulk and get all shortened links back in a single response. You can shorten up to 100 URLs per request. This is ideal for migration scripts, CSV processing, and bulk URL shortening workflows.
How do I integrate LinkShrink with my CI/CD pipeline?
Since the API requires no authentication, integration is straightforward. Add a cURL command to your pipeline script that POSTs to https://linkshrink.dev/api/v1/shorten with the URL you want to shorten. Parse the JSON response to extract the short URL. Works with GitHub Actions, GitLab CI, Jenkins, CircleCI, and any pipeline that can make HTTP requests.
What is MCP and how does LinkShrink support it?
MCP (Model Context Protocol) is an open standard for connecting AI assistants to external tools and data sources. LinkShrink provides a native MCP server package (linkshrink-mcp) that you can install via npm. Once configured, AI tools like Claude Desktop and Cursor can shorten URLs, retrieve click analytics, and delete links directly through natural language commands. Read the API documentation for setup instructions.