API documentation
Use the ZIPN API to shorten URLs programmatically.
Overview
Guests can create up to 3 links for free every 24 hours.
- Base URL:
https://zipn.app/api/v1/shorten - Format: JSON
- Authentication: Optional (temporary link without a key, personal code link with an API key)
Authentication (API key)
Sign in, create an API key in your profile, and send it in the request header. Links are then created under your personal code without expiry, and you can edit them and view stats in your dashboard.
Authorization: Bearer sk_short_...- A key is shown only once when it is created. If you lose it, revoke it and create a new one.
- Up to 5 keys per account; each key allows 30 requests per minute and 1,000 per day. Beyond that, the API returns 429 with a Retry-After header.
- If the key is wrong or revoked, the API returns 401 instead of falling back to a temporary link.
Shorten a URL
POST /api/v1/shorten
Request parameters:
| Parameter | Required | Description |
|---|---|---|
original_url | โ | Original URL to shorten |
custom_code | โ | Custom short code (generated automatically if omitted) |
expire_duration | โ | Expiration: 24h, 48h, 1week, 1month |
code_id | โ | With an API key: the personal code ID to use (defaults to your primary code). Pass temp to create a temporary link that is still managed in your dashboard. |
Example request:
curl -X POST https://zipn.app/api/v1/shorten \
-H "Content-Type: application/json" \
-d '{
"original_url": "https://example.com/very-long-url",
"custom_code": "example",
"expire_duration": "1week"
}'Success response (201):
{
"status": "success",
"message": "URL shortened successfully.",
"data": {
"short_url": "https://zipn.app/example/",
"original_url": "https://example.com/very-long-url",
"code": "example",
"expiration_date": "2026-04-21T10:00:00.000Z"
}
}Request with an API key:
curl -X POST https://zipn.app/api/v1/shorten \
-H "Authorization: Bearer sk_short_..." \
-H "Content-Type: application/json" \
-d '{
"original_url": "https://example.com/very-long-url",
"custom_code": "example"
}'Success response with an API key (201):
{
"status": "success",
"message": "URL shortened successfully.",
"data": {
"short_url": "https://zipn.app/mycode/example/",
"original_url": "https://example.com/very-long-url",
"code": "example",
"expiration_date": "2126-03-28T10:00:00.000Z",
"username": "mycode",
"user_code_id": 12,
"is_temp": false
}
}Error response:
{
"status": "error",
"message": "This short code is already in use."
}Get API information
GET /api/v1/shorten
Returns endpoint information and available parameters.