Shortit API Documentation
Authentication is via API key. You can generate up to 5 keys in your Dashboard.
Base URL
https://shortit.in
Endpoint: Create short URL
GET /api/shorten or POST /api/shorten
Parameters
url(required) — the target URL to shortenttl(optional) — one of1h,3h,6h,12h,1d,7d,30d,1y,always. Default:1dapi_key— your API key (or send viaX-API-Keyheader)
Response
{
"short_url": "https://shortit.in/abc12",
"slug": "abc12",
"expires_at": "2025-12-31 00:00:00" // or null
}
Examples
curl "https://shortit.in/api/shorten?url=https://example.com&ttl=7d&api_key=YOUR_TOKEN"
curl -X POST "https://shortit.in/api/shorten" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_TOKEN" \
-d '{"url":"https://example.com","ttl":"7d"}'
Endpoint: Upload image
POST /api/upload — upload an image that will be served inline on a short URL.
Auth
Send your API key as query api_key or header X-API-Key.
Content-Type
multipart/form-data
Parameters
file(required) — image file (png, jpg, jpeg, gif, svg, webp, ico)ttl(optional) — one of1h,3h,6h,12h,1d,7d,30d,1y,always. Default:1y
Response
{
"short_url": "https://shortit.in/pQ3aZ",
"slug": "pQ3aZ",
"expires_at": "2025-10-01 00:00:00"
}
Examples
curl -X POST "https://shortit.in/api/upload?api_key=YOUR_TOKEN" \ -F "file=@/path/to/image.png" \ -F "ttl=7d"
When the TTL expires, the short URL and the physical file are removed.