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
If hide_stats_on_expire is true and the link is expired/maxed, this endpoint returns 410.
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.
← Back