Overview

TinyURL lets you shorten long URLs into compact links using a simple REST API. Just send your long URL and get back a short tinyurl.com link you can share anywhere. It requires an API key but the free tier is generous enough for most small projects.

Beginner Tip

Start by getting a free API key from tinyurl.com/app/dev — the basic plan lets you shorten thousands of URLs per month. Always store shortened URLs you create, since regenerating the same short link for the same long URL is not guaranteed.

Available Data

The kind of data this API exposes, based on its documentation. We could not call the endpoint to confirm the exact field names.

shortened URL
original URL
click count
creation date
Use case: Integrate shorten long urls data into web and mobile applications

Example Response

Illustrative shape only — we were not able to call this endpoint (it requires credentials or exposes no public sample URL), so the fields below show the kind of data this API returns rather than a recorded response.

JSON Response · Illustrative
{
  "id": "abc123",
  "short_url": "https://short.ly/abc123",
  "long_url": "https://example.com/very/long/url/path",
  "clicks": 1542,
  "created_at": "2025-01-10T14:30:00Z"
}

Field Reference

data.tiny_url The shortened TinyURL link ready to share.
data.url The original long URL that was shortened.
data.alias The custom alias portion of the TinyURL (after tinyurl.com/).
data.domain The domain used for the short link (e.g., tinyurl.com).
code HTTP status code of the response (0 means success).

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://api.tinyurl.com/create";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

401 Unauthorized Missing or invalid API key in the Authorization header.
Make sure you pass the header as "Authorization: Bearer YOUR_API_KEY" using the token from your TinyURL dashboard.
422 Unprocessable Entity The URL you submitted is malformed or empty.
Ensure the URL is properly formatted and URL-encoded, starting with http:// or https://.
429 Too Many Requests You have exceeded your plan's rate limit.
Add a delay between requests or upgrade your plan. The free tier allows a limited number of API calls per day.

Metadata Score Breakdown

Estimated from metadata — endpoint not independently tested

This score is estimated from observable metadata — HTTPS support, authentication model, declared CORS, and documentation reachability — because the API requires authentication or exposes no publicly testable endpoint. The five-signal breakdown is only shown for live-tested APIs.

Metadata estimate · endpoint not independently tested

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS NO
Category Url Shorteners
Difficulty Intermediate
Listing details not endpoint-verified

Related Tags

Similar APIs

View All →