Free URL shortener API. No signup, no API key.
POST a URL, get a short link. JSON in, JSON out. Rate-limited per IP, CORS-enabled, RFC 7807 error format. Ideal for scripts, CLIs, and one-off integrations.
Full curl / JS / Python / Go examples, rate-limit headers, and error format are on the API reference page.
What the API does
One endpoint, one job
POST /api/v1/shorten with a JSON {url, alias?} body returns {code, short_url, original_url, created_at}. The optional alias is first-come-first-served (5–16 chars, letters, digits, hyphens).
Public stats endpoint
GET /api/v1/stats/{code} returns aggregate click count and last-click timestamp — no per-visitor data.
Transparent limits
Rate-limit headers on every response. 429 with Retry-After on overrun. RFC 7807 error bodies for machine-readable failures.
Frequently asked questions
Do I need an API key?
No. The Shrtr API is anonymous. Rate limits are enforced per IP address.
What are the rate limits?
The POST /api/v1/shorten endpoint allows 30 requests per minute per client IP, with a tighter 10-per-hour cap on custom aliases. The API returns X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers, and responds with HTTP 429 plus Retry-After when exceeded.
Does the API support CORS?
Yes. Access-Control-Allow-Origin is open on /api/* so the endpoint can be called directly from a browser.
What response format does the API use?
JSON with UTF-8 encoding. Errors follow RFC 7807 (application/problem+json), so clients get a machine-readable type, title, status, and detail.
Is there a health-check endpoint?
Yes. GET /api/v1/health returns HTTP 200 with a small JSON body and is safe to poll from uptime monitors. It is not rate-limited.