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.
$ 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
You must pass your API key via the Authorization header using the Bearer token scheme.
Tüm uçlar https://kisa.tr/api/v1 adresi altındadır ve Authorization başlığı gerektirir.
/me
Anahtarı doğrular; hesap ve limit bilgisi döner
/links
Yeni kısa link oluşturur
/links
Linkleri sayfalı listeler (page, per_page, search)
/links/{kod}
Tek linki ve toplam tıklamasını getirir
/links/{kod}
Hedef adresi veya akıllı yönlendirmeyi günceller
/links/{kod}
Linki ve tıklama kayıtlarını siler
/links/{kod}/stats
İstatistikler (range = 7, 30 veya 90 gün)
/links/bulk
Tek istekte en fazla 20 link oluşturur
POST /api.php ucu çalışmaya devam ediyor ve yanıt biçimi değişmedi. Yeni entegrasyonlarda /api/v1/links tercih edin.
| 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 |
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.
{
"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.
{
"success": true,
"short_url": "https://kisa.tr/aB3dE",
"short_code": "aB3dE",
"long_url": "https://ornek.com"
}
{
"success": false,
"error": "Invalid or expired API Key."
}
| 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 |
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
$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'];
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);
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'])
curl https://kisa.tr/api/v1/links/kampanya/stats?range=30 \
-H "Authorization: Bearer YOUR_API_KEY"
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"}'
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ı