Create short link
HTTP
POST https://erd.sh/api/v1/shorten
Content-Type: application/json
{
"url": "https://google.com",
"expires_in": 3600,
"max_clicks": 25,
"hide_stats_on_expire": true
}
expires_in, max_clicks and hide_stats_on_expire are optional (API only).
If omitted or null, links never expire and have unlimited clicks/analytics.
Response
{
"status": "success",
"long_url": "https://google.com",
"short_id": "Ab3kQ9",
"short_url": "https://erd.sh/Ab3kQ9",
"expires_at": "2026-01-04T10:41:12Z",
"max_clicks": 25,
"hide_stats_on_expire": true
}
expires_at, max_clicks, and hide_stats_on_expire are null when not set.
Link stats
HTTP
GET https://erd.sh/api/v1/stats/Ab3kQ9
Response
{
"status": "success",
"short_id": "Ab3kQ9",
"short_url": "https://erd.sh/Ab3kQ9",
"long_url": "https://google.com",
"clicks": 12,
"created_at": "2026-01-04T08:41:12Z",
"last_clicked_at": "2026-01-04T09:02:55Z",
"expires_at": "2026-01-04T10:41:12Z",
"max_clicks": 25,
"hide_stats_on_expire": true
}
expires_at, max_clicks, and hide_stats_on_expire are null when not set.
HTTP errors
HTTP
400 Bad Request - Invalid JSON - Missing required fields - Invalid URL format 404 Not Found - Short ID does not exist - Link expired - Link reached max_clicks 405 Method Not Allowed - Unsupported HTTP method 410 Gone - Link expired or maxed and hide_stats_on_expire=true 429 Too Many Requests - Rate limit exceeded
The API uses standard HTTP status codes. All API errors return JSON with an
error field.
Response
HTTP/1.1 410 Gone
{
"error": "Gone"
}