99.9% uninterrupted redirect infrastructure
API v1

Integrate with a single request

Integrate kisa.tr URL shortening dynamically into your own applications using our RESTful JSON API. The API is rate-limited to 60 requests per minute.

POST /api/v1/links
$ curl -X POST https://kisa.tr/api/v1/links \
  -H "Authorization: Bearer API_KEY" \
  -d '{"url":"https://ornek.com"}'

// 201 Created
{
  "success": true,
  "link": {
    "short_url": "https://kisa.tr/aB3dE",
    "clicks": 0
  }
}

Protokol

REST · JSON

Authentication

Bearer Token

API Capacity

60 istek/dk

Plan

Premium · Free

Authentication

You must pass your API key via the Authorization header using the Bearer token scheme.

Authorization: Bearer YOUR_API_KEY
API anahtarınızı panelin API sekmesinden alabilir, dilediğiniz zaman yenileyebilirsiniz.

Endpoint URL

Tüm uçlar https://kisa.tr/api/v1 adresi altındadır ve Authorization başlığı gerektirir.

GET /me Anahtarı doğrular; hesap ve limit bilgisi döner
POST /links Yeni kısa link oluşturur
GET /links Linkleri sayfalı listeler (page, per_page, search)
GET /links/{kod} Tek linki ve toplam tıklamasını getirir
PATCH /links/{kod} Hedef adresi veya akıllı yönlendirmeyi günceller
DELETE /links/{kod} Linki ve tıklama kayıtlarını siler
GET /links/{kod}/stats İstatistikler (range = 7, 30 veya 90 gün)
POST /links/bulk Tek istekte en fazla 20 link oluşturur
Eski POST /api.php ucu çalışmaya devam ediyor ve yanıt biçimi değişmedi. Yeni entegrasyonlarda /api/v1/links tercih edin.

Parametreler

Alan Tip Zorunlu Açıklama
url string Evet Kısaltılacak adres. Sadece http ve https kabul edilir.
alias string Hayır Özel kısa ad. 3-32 karakter; harf, rakam, tire, alt çizgi.
targets object Hayır Akıllı yönlendirme hedefleri: ios, android, desktop

Smart Routing

Create a single short link for your app. iPhone users land on the App Store, Android users on Play Store, desktop visitors on your website. Use one address in your ads, business cards and posters.

İstek gövdesi
{
  "url": "https://ornek.com",
  "alias": "uygulamam",
  "targets": {
    "ios":     "https://apps.apple.com/app/id123456789",
    "android": "https://play.google.com/store/apps/details?id=com.ornek",
    "desktop": "https://ornek.com/indir"
  }
}

Used when there is no match and for platforms left empty.

Response Format

Success (200 OK)
{
  "success": true,
  "short_url": "https://kisa.tr/aB3dE",
  "short_code": "aB3dE",
  "long_url": "https://ornek.com"
}
Error (4xx/5xx)
{
  "success": false,
  "error": "Invalid or expired API Key."
}

Hata Kodları

HTTP code Anlamı
400 invalid_url Geçersiz URL — yalnızca http/https kabul edilir
400 invalid_alias Alias 3-32 karakter olmalı (harf, rakam, tire, alt çizgi)
400 invalid_json İstek gövdesi geçerli JSON değil
400 invalid_request Eksik veya hatalı alan
400 bulk_limit_exceeded Toplu istekte en fazla 20 link gönderilebilir
401 unauthorized API anahtarı eksik ya da Bearer formatında değil
403 forbidden Anahtar geçersiz veya aboneliğin süresi dolmuş
403 account_suspended Hesap askıya alınmış
404 not_found Link ya da uç nokta bulunamadı
405 method_not_allowed Bu uç bu HTTP metodunu desteklemiyor
409 alias_taken İstenen alias zaten kullanımda
429 rate_limited Dakikalık istek limiti aşıldı
503 code_generation_failed Benzersiz kısa kod üretilemedi, tekrar deneyin

Code Examples

cURL
curl -X POST https://kisa.tr/api/v1/links \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"url":"https://ornek.com","alias":"kampanya"}'
PHP
<?php
$ch = curl_init('https://kisa.tr/api/v1/links');
curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => [
        'Content-Type: application/json',
        'Authorization: Bearer YOUR_API_KEY',
    ],
    CURLOPT_POSTFIELDS => json_encode(['url' => 'https://ornek.com']),
]);
$result = json_decode(curl_exec($ch), true);
echo $result['link']['short_url'];
JavaScript (Fetch)
const res = await fetch('https://kisa.tr/api/v1/links', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_KEY'
  },
  body: JSON.stringify({ url: 'https://ornek.com' })
});
const data = await res.json();
console.log(data.link.short_url);
Python
import requests

res = requests.post(
    'https://kisa.tr/api/v1/links',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    json={'url': 'https://ornek.com'}
)
print(res.json()['link']['short_url'])
İstatistik okuma · cURL
curl https://kisa.tr/api/v1/links/kampanya/stats?range=30 \
  -H "Authorization: Bearer YOUR_API_KEY"
Hedefi güncelleme · cURL
curl -X PATCH https://kisa.tr/api/v1/links/kampanya \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"url":"https://ornek.com/yeni-adres"}'

Limitler

Her yanıt X-RateLimit-Limit, X-RateLimit-Remaining ve X-RateLimit-Reset başlıklarını taşır; toplu işlemlerde bu değerlere bakarak hızınızı ayarlayabilirsiniz.

60

istek / dakika · anahtar başına

Premium hesapta toplam link sayısı

Get started now

Unlimited links, REST API access, ad-free redirects and priority support.

Get a Key