URL Shortener API Documentation
Complete reference for the URL Shortener API
Authentication
Pass your API key via header or query parameter:
Authorization: Bearer sk_live_your_key_here
POST /v1/url/shorten
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
url | string | yes | URL to shorten (max 2048 chars) |
title | string | no | Descriptive title for the link |
expires_in | integer | no | Expiration in minutes (1-525600) |
GET /v1/url/list
Returns your shortened URLs, paginated. Optional params: page, per_page (max 100).
GET /v1/url/{code}/stats
Get stats for a specific short URL including click count, creation date, and expiration status.
DELETE /v1/url/{code}
Permanently delete a short URL. This cannot be undone.
Examples
Shorten a URL
curl -X POST "https://snapapis.com/api/v1/url/shorten" \ -H "Authorization: Bearer YOUR_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"https://example.com/page","title":"My Link","expires_in":1440}'
List your URLs
curl "https://snapapis.com/api/v1/url/list?api_key=YOUR_KEY"