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.php
$ 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

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

POST /api.php
https://kisa.tr/api.php

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ı

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ı

Code Examples

cURL
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
<?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'];
JavaScript (Fetch)
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);
Python
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'])

Limitler

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