Feature
A Free URL Shortener API You Can Try Without a Key
POST a long URL, get a short one back. Try it with no key; a free key covers 1,000 links a day. It is one HTTP request from cURL, Python, JavaScript, Go, or anything else that speaks JSON.
- No key for 20 a day
- JSON in, JSON out
- No monthly cap
Quick start
Pick a language and run it. The request below works with no key for 20 links a day. For more, add an Authorization: Bearer header with your free key.
curl -X POST https://zip1.io/api/create \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/some/very/deep/path"}'
import requests
response = requests.post(
"https://zip1.io/api/create",
json={"url": "https://example.com/some/very/deep/path"},
)
print(response.json()["short_url"]) # https://zip1.io/abc123
const response = await fetch("https://zip1.io/api/create", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ url: "https://example.com/some/very/deep/path" })
});
const data = await response.json();
console.log(data.short_url); // https://zip1.io/abc123
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
body := []byte(`{"url": "https://example.com/some/very/deep/path"}`)
resp, err := http.Post("https://zip1.io/api/create", "application/json", bytes.NewBuffer(body))
if err != nil {
panic(err)
}
defer resp.Body.Close()
data, _ := io.ReadAll(resp.Body)
fmt.Println(string(data))
}
A successful request returns HTTP 200 with the short URL and creation timestamp:
{
"short_url": "https://zip1.io/abc123",
"created_at": "2026-07-06T12:00:00.482913+00:00"
}
Every option in one request — a custom slug that dies after 100 clicks, expires at year end, and asks visitors for a password:
curl -X POST https://zip1.io/api/create \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/campaign",
"alias": "spring-2026",
"max-clicks": 100,
"expiration-time": "2027-12-31T23:59:00Z",
"password": "Preview@2026",
"description": "<your internal note, e.g. order 1234>"
}'
Keep the alias to 12 characters. Anything longer is silently truncated rather than
rejected — spring-launch becomes spring-launc — so always read
short_url back from the response.
Endpoints
| Endpoint | Rate limit | What it does |
|---|---|---|
POST /api/create |
10 / minute; 1,000 / day with a key, 20 links / day without | Create a short link |
POST /api/validate-url |
60 / minute | Check whether a URL would be accepted, without creating a link |
GET /api/stats/<code> |
30 / minute | Click stats as JSON |
GET /api/check-alias?alias=<slug> |
60 / minute | Check if a custom slug is free |
GET /export/<code>/<format> |
— | Export click data as csv, json, xlsx, or xml (csv arrives as a ZIP of several CSVs) |
Parameters for POST /api/create
| Field | Required | Rules |
|---|---|---|
url |
Required | A valid http(s) URL — the redirect destination |
alias |
Optional | Custom slug: letters, numbers, -, _, truncated to the first 12 characters; or up to 15 emoji |
password |
Optional | 8+ characters with a letter, a number, and @ or . (two of those may not sit next to each other) |
max-clicks |
Optional | Whole number — the link stops redirecting after N clicks. 0 means no limit |
expiration-time |
Optional | ISO 8601 with timezone, at least 5 minutes ahead (e.g. 2027-12-31T23:59:00Z) |
description |
Optional | Optional private note for your own integration, up to 100 characters. Not shown on the link's public pages. Keep it free of personal data you wouldn't want stored. Returned in the create response. |
Stats response
GET /api/stats/<code> returns totals, uniques, and top countries. A password-protected link needs its password in the X-Link-Password header; other links need no token. Anyone with the short link can see its stats. Password-protected links also need the password. Visitor IP addresses are stored to count unique visitors. They are never shown on the stats page or included in the export.
{
"message": "Statistics retrieved successfully",
"data": {
"short_code": "spring-2026",
"total_clicks": 87,
"unique_clicks": 64,
"creation_date": "2026-07-06T12:00:00.482913+00:00",
"last_click": "2026-07-06 15:42:11",
"click_limit": "100",
"expiration_time": "2026-12-31T23:59:00+00:00",
"is_password_protected": true,
"top_countries": [{"country": "United States", "clicks": 31}],
"recent_clicks": []
}
}
Two quirks worth coding around: click_limit is a string (or
null), and last_click uses a space rather than a T
and carries no UTC offset. creation_date is a full ISO 8601 timestamp for
every link regardless of how it was made — before 2026-09-01 website-created links
reported only a clock time. top_countries is capped at three entries, and
recent_clicks is always empty. The export has the totals and the breakdown by country, browser, operating system, and referrer, not a row per click.
Full details in the API documentation.
Need spreadsheets instead? The same analytics export as CSV, XLSX, JSON, or XML via /export/<code>/<format>.
Rate limits
Without a key, link creation stops at 20 a day per IP. A free key allows 10 link creations a minute and 1,000 a day, counted per account. Other limits are per IP: 30 stats reads per minute, 60 alias checks per minute. There is no monthly quota. The limits exist to stop abuse, not to sell an upgrade.
Exceed a limit and you get HTTP 429:
{"error": "ratelimit exceeded 10 per 1 minute"}
The response carries a Retry-After header with the seconds until the window resets; wait that long and retry. With a key, link creation is also capped at 1,000 a day per account. If you legitimately need more throughput, get in touch.
Without a key, 20 links a day from one IP. Past that, requests without a key are refused. With a free key, the limits count per account instead of per IP. How to get a key.
Error responses
Errors return a JSON body with a message field and a conventional status code. Most also carry a machine-readable reason. The exceptions are the rate limiter's 429 and the too-many-wrong-passwords 429, which use an error field:
| Status | When | Example message |
|---|---|---|
400 |
Missing or malformed url |
"Start the address with https:// — try https://example.com" (plus a reason code) |
400 |
Invalid alias, password, max-clicks, expiration-time, or description |
"Invalid alias format" |
401 |
The Authorization header is not a valid key |
"This API key is not valid. …" (reason invalid-api-key) |
403 |
Destination is blocked or refused by an abuse check | "URL is blocked" (reason says which check) |
409 |
Requested alias is already taken | "Alias already exists" |
404 |
Stats requested for an unknown short code | "Short link not found" |
429 |
Rate limit exceeded | {"error": "ratelimit exceeded 10 per 1 minute"} |
429 |
No key, and this IP has made 20 links today | "Without an API key, 20 links a day …" (reason api-key-required) |
503 |
Our database could not be reached or the link could not be confirmed saved | "We could not confirm your link was saved. …" (reason not-saved or storage). Safe to retry |
Every reason code and its status is listed in the API documentation. Match on reason, not on the wording.
How it compares to the bit.ly and TinyURL APIs
Most URL shortener APIs assume an account, an access token, and a plan. If you just need short links from a script, a CI job, or an AI agent, that setup is the slowest part. Here's the honest comparison:
| Capability | zip1.io API | bit.ly API | TinyURL API |
|---|---|---|---|
| Authentication | None for 20 links a day; a free key above that | Account + OAuth token | Account + API token |
| Monthly link quota | None — rate limit only | Capped on the free plan | Capped on the free plan |
| Custom slugs via API, free | Yes | Limited on free plan | Limited on free plan |
| Password-protected links | Yes, free | Not offered | Not offered |
Click caps (max-clicks) |
Yes | No | No |
| Click analytics via API, free | Yes | Limited free tier | Paid plans |
Plan details for bit.ly and TinyURL are as published on their pricing pages and may change. The structural difference is stable: both authenticate every request and meter link creation by plan. zip1.io takes 20 links a day with no key, and a free key for more, with no paid plan.
Built for AI agents too
The same API is exposed as a Model Context Protocol server, so agents like Claude can make and track short links as native tools instead of raw HTTP calls:
claude mcp add --transport http zip1 https://zip1.io/mcp
The agent needs no key at all, so connecting one is a single command.
FAQ
-
Do I need an API key to use the zip1.io URL shortener API?
Only for more than 20 links a day. Up to 20 links a day from one IP need no key and no OAuth token: send a POST request to
/api/createand you get a short URL back. Past that, a request without a key is refused. A key is free, made on your account page, and its limits count per account instead of per IP. -
Is the API free, and what are the rate limits?
The API is free with no paid tier and no monthly link quota. Without a key, link creation stops at 20 a day per IP. A free key allows 10 a minute and 1,000 a day, counted per account. Other limits are per IP: 30 stats requests per minute, and 60 alias-availability checks per minute. Exceeding a limit returns HTTP 429 until the window resets.
-
Can I set a custom slug through the API?
Yes, and it's free. Pass an
aliasfield to/api/create— 12 characters of letters, numbers, hyphens or underscores. Longer slugs are truncated to the first 12 characters rather than rejected, so readshort_urlback from the response. If the alias is taken you get HTTP 409; you can pre-check availability withGET /api/check-alias. -
What options does /api/create support besides the URL?
alias(custom slug),password(visitors must enter it before redirecting),max-clicks(link stops working after N clicks),expiration-time(ISO 8601 timestamp when the link dies), anddescription(optional private note for your own integration, up to 100 characters; not shown on the link's public pages; keep it free of personal data you wouldn't want stored; returned in the create response). -
Is zip1.io a bit.ly API alternative?
For programmatic link creation, yes. The bit.ly API requires an account and an OAuth token, and its free plan caps how many links you can create per month. zip1.io needs no token for up to 20 links a day and a free key above that, has no monthly quota, and includes custom slugs, click caps, and password protection for free.
Related
Ship your integration in five minutes
The full reference covers every endpoint, parameter, and response schema — or skip the reading and send your first request now.