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.php \
-H "Authorization: Bearer API_KEY" \
-d '{"url":"https://ornek.com"}'
// 200 OK
{
"success": true,
"short_url": "https://kisa.tr/aB3dE"
}
Protokol
REST · JSON
Authentication
Bearer Token
API Capacity
60 istek/dk
Plan
Premium
You must pass your API key via the Authorization header using the Bearer token scheme.
/api.php
| 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."
}
| Kod | Anlamı |
|---|---|
| 400 | Geçersiz URL veya alias formatı |
| 401 | API anahtarı eksik ya da Bearer formatında değil |
| 403 | Anahtar geçersiz, süresi dolmuş veya hesap askıda |
| 405 | Yalnızca POST metodu desteklenir |
| 409 | İstenen alias zaten kullanımda |
| 429 | Dakikalık istek limiti aşıldı |
curl -X POST https://kisa.tr/api.php \
-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.php');
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['short_url'];
const res = await fetch('https://kisa.tr/api.php', {
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.short_url);
import requests
res = requests.post(
'https://kisa.tr/api.php',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
json={'url': 'https://ornek.com'}
)
print(res.json()['short_url'])
60
istek / dakika · anahtar başına
∞
Premium hesapta toplam link sayısı