enruuk
← Назад

Документація API

Використовуйте наш API для програмного створення та керування скороченими URL.

Кінцеві точки

POST /api/create

Формат запиту

Content-Type: multipart/form-data

Параметри

Назва Опис Обов'язковий
url The URL to shorten. Must be a valid URL that starts with http:// or https://. Так
custom_url Custom alias for the shortened URL. Only alphanumeric characters, hyphens, and underscores are allowed. Length must be between 3 and 30 characters. Ні

Приклад запиту

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

Поля відповіді

Поле Опис Тип
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"
  }
}
GET /api/stats?id={shortId}

Параметри

Назва Опис Обов'язковий
id The ID or custom alias of the shortened URL Так

Приклад запиту

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

Формат відповіді

Content-Type: application/json

Поля відповіді

Поле Опис Тип
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": [...]
    }
  }
}

Примітки

  • Для базового використання автентифікація не потрібна.