API Documentation

Authentication

All API requests require an API key. Pass it as X-API-Key header or ?api=YOUR_KEY query parameter.

Get your API key from Settings.

POST /api/v1/shorten

Shorten a URL

Parameters:
urlRequired. The URL to shorten
aliasOptional. Custom alias
Example:
curl -X POST https://downlx.com/api/v1/shorten \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{"url": "https://example.com"}'
Response:
{
  "short": "https://downlx.com/abc12",
  "alias": "abc12",
  "url": "https://example.com"
}
GET /api/v1/links

Get all your links

Example:
curl https://downlx.com/api/v1/links?api=YOUR_API_KEY
GET /api/v1/stats/{id}

Get stats for a specific link

Example:
curl https://downlx.com/api/v1/stats/1?api=YOUR_API_KEY