TinyURL API
Shorten long URLs programmatically via a simple API.
What it does
TinyURL’s API shortens long URLs, with support for custom aliases, branded domains, link editing, and expiry. A legacy no-auth endpoint still works for basic one-off shortening; the modern JSON API needs a free token.
Base URL
Authentication
The modern API needs a free API token: Authorization: Bearer YOUR_TOKEN on JSON requests to /create, /change, etc. The legacy endpoint https://tinyurl.com/api-create.php?url={long_url} is a keyless GET that returns the short URL as plain text.
Code examples
curl -s "https://tinyurl.com/api-create.php?url=https://larzos.com/apis/" # https://tinyurl.com/xxxxxxx
curl -s -X POST https://api.tinyurl.com/create \
-H "Authorization: Bearer $TINYURL_TOKEN" \
-H "Content-Type: application/json" \
-d '{"url":"https://larzos.com/apis/","domain":"tinyurl.com"}'Rate limits & quotas
Free plan on the modern API: roughly 600 requests/minute and a monthly creation cap in the low thousands, plus a limit on how many active links you can manage. Over the limit returns HTTP 429. The legacy endpoint is best-effort with its own abuse throttling and no analytics.
Key response fields
| data.tiny_url | The shortened URL (modern API) |
| data.alias / data.domain | The slug and domain used |
| data.url | The original long URL |
| code / errors[] | Non-zero code and an errors array on failure |
| (legacy) | Plain-text short URL, or an Error string |
Common errors
| 401 | Missing or invalid Bearer token on the modern API. |
| 422 | Invalid URL, or a requested alias that is taken/reserved. |
| 429 | Rate or monthly limit exceeded. |
| (legacy 'Error') | The legacy endpoint returns the literal text Error for a bad or blocked URL. |
When to use it (and alternatives)
Use the legacy endpoint for a quick, throwaway short link with zero setup. Use the modern token API when you need custom aliases, link management or analytics. For a fully keyless modern option, is.gd.
FAQ
Does the old api-create.php still work?
Yes, for now — it is a keyless GET that returns a plain-text short URL. It has no analytics, no custom aliases and its own abuse throttling. TinyURL steers new integrations to the token API.
Can I use my own domain?
Branded domains are a paid feature. On free, domain is tinyurl.com (or a couple of TinyURL-owned alternates).
How do I edit where a short link points?
The modern API’s /change endpoint updates the destination of a link you own — handy for campaign links. The legacy endpoint can’t do this.
New to APIs?
Short guides for working with this API — and any other.