enruuk
← Back

API Documentation

Use our API to programmatically create and manage shortened URLs.

Endpoints

POST /api/create

Request Format

Content-Type: multipart/form-data

Parameters

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

Example Request

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

Response Format

Content-Type: application/json

Response Fields

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

Example Response

{
  "success": true,
  "data": {
    "shortUrl": "https://clck.ee/example123",
    "statsUrl": "https://clck.ee/en/stats/example123"
  }
}
GET /api/stats?id={shortId}

Parameters

Name Description Required
id The ID or custom alias of the shortened URL Yes

Example Request

curl -X GET https://clck.ee/api/stats?id=example123

Response Format

Content-Type: application/json

Response Fields

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

Example Response

{
  "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": [...]
    }
  }
}

Notes

  • No authentication is required for basic usage.