Use our API to programmatically create and manage shortened URLs.
Content-Type: multipart/form-data
Name | Description | Required |
---|---|---|
url | The URL to shorten. Must be a valid URL that starts with http:// or https://. | Yes |
custom_url | Custom alias for the shortened URL. Only alphanumeric characters, hyphens, and underscores are allowed. Length must be between 3 and 30 characters. | No |
curl -X POST -F "url=https://example.com/very/long/url/that/needs/to/be/shortened" -F "custom_url=example123" https://clck.ee/api/create
Content-Type: application/json
Field | Description | Type |
---|---|---|
success | Indicates if the request was successful | Boolean |
data | Contains the response data if the request was successful | Object |
data.shortUrl | The shortened URL | String |
data.statsUrl | URL to access the statistics for this shortened link | String |
error | Error message if the request failed | String |
{
"success": true,
"data": {
"shortUrl": "https://clck.ee/example123",
"statsUrl": "https://clck.ee/en/stats/example123"
}
}
Name | Description | Required |
---|---|---|
id | The ID or custom alias of the shortened URL | Yes |
curl -X GET https://clck.ee/api/stats?id=example123
Content-Type: application/json
Field | Description | Type |
---|---|---|
success | Indicates if the request was successful | Boolean |
data | Contains the response data if the request was successful | Object |
data.link | Contains information about the link | Object |
data.stats | Contains statistics about the link | Object |
error | Error message if the request failed | String |
{
"success": true,
"data": {
"link": {
"id": "example123",
"originalUrl": "https://example.com/very/long/url/that/needs/to/be/shortened",
"createdAt": "2025-03-31T12:34:56.789Z"
},
"stats": {
"totalClicks": 42,
"humanClicks": 38,
"botPercentage": 9.5,
"recentVisits": [...],
"browserStats": [...],
"osStats": [...],
"deviceStats": [...],
"countryStats": [...],
"referrerStats": [...],
"visitsByDate": [...],
"utmStats": [...]
}
}
}