Integrate Shorty's powerful URL shortening and analytics into your applications
Sign up and generate your API key from your dashboard
Send authenticated requests to our REST API endpoints
Receive JSON responses with shortened URLs and analytics
All endpoints are relative to this base URL. Authentication required for all requests.
Include your API key in the request header:
Authorization: Bearer YOUR_API_KEY
Important: Keep your API key secure. Never expose it in client-side code or public repositories.
Create a new shortened URL
{
"url": "https://example.com/very/long/url",
"custom_alias": "my-link", // optional
"domain": "short.fy" // optional
}
{
"success": true,
"data": {
"id": "abc123",
"short_url": "https://short.fy/abc123",
"original_url": "https://example.com/very/long/url",
"created_at": "2025-01-15T10:30:00Z"
}
}
curl -X POST https://api.shorty.com/v1/shorten \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/page"}'
Get information about a shortened link
{
"success": true,
"data": {
"id": "abc123",
"short_url": "https://short.fy/abc123",
"original_url": "https://example.com/page",
"clicks": 1234,
"created_at": "2025-01-15T10:30:00Z",
"updated_at": "2025-01-15T10:30:00Z"
}
}
curl https://api.shorty.com/v1/links/abc123 \
-H "Authorization: Bearer YOUR_API_KEY"
Get detailed analytics for a link
period - Time period (7d, 30d, 90d, all)groupBy - Group by (day, week, month){
"success": true,
"data": {
"total_clicks": 1234,
"unique_clicks": 856,
"referrers": [
{"source": "twitter.com", "clicks": 450},
{"source": "facebook.com", "clicks": 320}
],
"countries": [
{"country": "US", "clicks": 600},
{"country": "UK", "clicks": 200}
],
"devices": [
{"type": "mobile", "clicks": 700},
{"type": "desktop", "clicks": 534}
]
}
}
Delete a shortened link
{
"success": true,
"message": "Link deleted successfully"
}
The API uses standard HTTP status codes and returns errors in this format:
{
"success": false,
"error": {
"code": "invalid_url",
"message": "The provided URL is invalid"
}
}
100
requests per hour
1,000
requests per hour
Custom
unlimited requests
Sign up now and get your API key to start integrating Shorty