API

Reference

POST
/api/shorten
Create a short URL.
Request
curl -X POST https://kootah.xyz/api/shorten -H "Content-Type: application/json" -d '{"url": "https://example.com/url"}'
Response
{"shortUrl": "https://...", "slug": "abc123"}
200 Success 400 Invalid 429 Rate limit 500 Error
GET
/api/stats/:slug
Get stats for a slug.
Request
curl https://kootah.xyz/api/stats/abc123
Response
{"url": "https://...", "created": 1714348000, "hits": 42}
200 Success 404 Not found
GET
/:slug
Redirect to target URL via slug. 301 permanent redirect. Increments hits.
301 Redirect 404 Not found