Overview
The LinkSnip API allows you to programmatically create, manage, and track shortened URLs. Our RESTful API supports JSON and provides endpoints for all the functionality available in the web interface.
Base URL
https://api.linksnip.com/v1Format
All requests and responses are in JSON format
Rate Limits
API Status
Check the current operational status of the LinkSnip API and its components.
All Systems Operational
Current API response time: 87ms
Core Services
Additional Services
API Load
Degraded Performance: Bulk Operations
We're experiencing slightly elevated response times for bulk operations. Our team is investigating the issue. Expected resolution: 30 minutes.
Authentication
All API requests require authentication using an API key. You can obtain an API key from your account dashboard.
API Key Authentication
Include your API key in the request headers
curl -X POST https://api.linksnip.com/v1/shorten \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{"url": "https://example.com/very/long/url"}'Never share your API key or expose it in client-side code. Always make API requests from your server.
API Reference
/shorten
Create a new shortened URL
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | Yes | The URL to shorten |
| alias | string | No | Custom alias for the shortened URL |
| expiresAt | string | No | Expiration date in ISO 8601 format |
| password | string | No | Password to protect the URL (Pro plan only) |
Example Request
curl -X POST https://api.linksnip.com/v1/shorten \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{
"url": "https://example.com/very/long/url",
"alias": "my-custom-link",
"expiresAt": "2023-12-31T23:59:59Z"
}'Example Response
{
"success": true,
"data": {
"id": "a1b2c3d4",
"originalUrl": "https://example.com/very/long/url",
"shortUrl": "https://linksnip.com/s/my-custom-link",
"alias": "my-custom-link",
"expiresAt": "2023-12-31T23:59:59Z",
"createdAt": "2023-05-15T14:30:45Z",
"qrCode": "https://linksnip.com/qr/my-custom-link.png"
}
}Error Handling
The API uses standard HTTP status codes to indicate the success or failure of a request. In case of an error, the response body will contain additional information.
Error Response Format
{
"success": false,
"error": {
"code": "invalid_url",
"message": "The provided URL is invalid",
"status": 400
}
}Common Error Codes
| Status Code | Error Code | Description |
|---|---|---|
| 400 | invalid_request | The request is malformed or missing required parameters |
| 400 | invalid_url | The provided URL is invalid |
| 401 | unauthorized | Missing or invalid API key |
| 403 | forbidden | The API key doesn't have permission to perform the request |
| 404 | not_found | The requested resource was not found |
| 409 | alias_taken | The requested alias is already in use |
| 429 | rate_limit_exceeded | You've exceeded the rate limit for your plan |
| 500 | server_error | An unexpected error occurred on the server |
SDKs and Libraries
We provide official client libraries for popular programming languages to make integration easier.
API Playground
Test our API endpoints directly from your browser. No API key required for the playground.
Interactive API Tester
Select an endpoint and fill in the parameters to see the response
Response
{
"success": true,
"data": {
"id": "a1b2c3d4",
"originalUrl": "https://example.com/your-long-url",
"shortUrl": "https://linksnip.com/s/my-custom-link",
"alias": "my-custom-link",
"expiresAt": null,
"createdAt": "2023-05-15T14:30:45Z",
"qrCode": "https://linksnip.com/qr/my-custom-link.png"
}
}API Changelog
Track the evolution of our API with the version history and changelog.
Version History
v2.0
Released on May 1, 2025
New Features
- Added support for custom domains
- Added password protection for links
- Added bulk URL shortening endpoint
- Added expiration date support
- Enhanced analytics with device and browser data
Breaking Changes
- Changed authentication from query parameters to header-based
- Renamed
shortened_urlfield toshortUrlfor consistency - Removed deprecated
/v1/statsendpoint (use/v1/analyticsinstead)
Bug Fixes
- Fixed pagination issues in the list URLs endpoint
- Improved error handling for invalid URLs
- Fixed timezone inconsistencies in analytics data
v1.5
Released on October 15, 2024
New Features
- Added QR code generation endpoint
- Added support for UTM parameters
- Enhanced rate limiting with better headers
- Added webhook support for click events
Improvements
- Improved response time for all endpoints
- Added more detailed error messages
- Enhanced documentation with more examples
v1.0
Released on March 1, 2024
Initial Release
- Basic URL shortening functionality
- Custom alias support
- Simple analytics (click counting)
- List, create, and delete shortened URLs
- API key authentication