API Overview
Everything you need to shorten URLs at scale. One base URL, simple JSON payloads, instant responses.
Shorten URLs
POST a URL, get a short link back. Supports custom aliases, TTL expiry, password protection, and force-preview mode. One endpoint, infinite possibilities.
Click Analytics
Track click counts, daily breakdowns, top referrers, and country-level geo data. Privacy-preserving — no IPs stored, just aggregate stats. Export as CSV or JSON.
QR Code Generation
Every short link gets automatic QR code endpoints in PNG and SVG. Customise size, foreground, and background colours. Perfect for print materials and marketing.
Bulk Shortening
Shorten up to 100 URLs in a single API call with the bulk endpoint. Ideal for migration scripts, CSV processing, and campaign launchers.
Code Examples
Start shortening URLs in any language. Copy, paste, run — it just works.
# 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/very/long/path/to/page", "customAlias": "my-link" }' # Response: # { # "status": "success", # "data": { # "shortUrl": "https://linkshrink.dev/my-link", # "code": "my-link", # "originalUrl": "https://example.com/very/long/path/to/page", # "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
API Endpoints
All endpoints use the base URL https://linkshrink.dev. No authentication headers required.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/shorten |
Shorten a single URL. Supports customAlias, ttl, password, force_preview. |
| POST | /api/v1/shorten/bulk |
Shorten up to 100 URLs in one request. |
| POST | /api/v1/shorten/utm |
Build UTM-tagged URL and shorten it in one step. |
| GET | /api/v1/stats/:code |
Click analytics with daily breakdown, referrers, and country data. |
| GET | /api/v1/stats/:code/export |
Export analytics as CSV or JSON with date range filtering. |
| POST | /api/v1/stats/batch |
Get statistics for multiple short codes in one request. |
| GET | /api/v1/qr/:code.png |
Generate PNG QR code. Query: size, fg, bg. |
| GET | /api/v1/qr/:code.svg |
Generate SVG QR code. Same query options. |
| PATCH | /api/v1/:code |
Update destination URL (requires delete_token). |
| DELETE | /api/v1/:code |
Delete a short link (requires delete_token). |
| GET | /api/v1/unshorten?url=... |
Resolve any shortened URL to its final destination. |
Popular Use Cases
Developers and teams use the LinkShrink API for everything from marketing to DevOps.
Marketing Campaigns
Generate unique short links for each ad, email, or social post. Track clicks per link with the stats endpoint. Use the UTM builder API to tag and shorten in one call. Export analytics as CSV for your reporting dashboard.
SaaS & Product Integrations
Embed URL shortening directly in your app. Let users share clean, branded links from your UI. Use custom aliases to match your product's branding. No API key management overhead for your engineering team.
DevOps & Automation
Shorten deployment URLs, CI/CD links, and internal wiki pages in your scripts. Use the bulk endpoint to process hundreds of URLs from a CSV. Automate QR code generation for physical labels and asset tracking.
Why No API Key? Why Free?
We built the API we wished existed when we needed one.
Zero Friction
API keys create friction. Registration creates abandonment. We removed both. Your first API call takes 10 seconds, not 10 minutes. Copy a cURL command, run it, done.
Privacy First
No API key means we don't track who's shortening what. We store only the link data and anonymous click counters. No user profiles, no usage logs tied to identity.
Free Forever
LinkShrink has no paid tier. No "free trial" that expires. No feature gating. Every endpoint, every feature, every use case — free for everyone, forever. Built and maintained by SoftVoyagers.