واجهة برمجة التطبيقات (API)
Sipariş verin, durumu kontrol edin, servisleri listeleyin ve bakiyenizi anlık sorgulayın.
POST
https://medyabay.com/api/v2
Content-Type:
application/x-www-form-urlencoded
Response:
JSON
POST Parametreleri (Yeni Sipariş)
| Parametre | Tür | Açıklama |
|---|---|---|
| key | String | Kişisel API Anahtarınız (Settings sayfasından alınır) |
| action | String | Her zaman add olmalıdır |
| service | Integer | Sipariş verilecek Servis ID numarası |
| link | String | Gönderi, video veya profil bağlantısı |
| quantity | Integer | Gönderilmesini istediğiniz adet |
| runs / interval | Integer | (Opsiyonel) Drip-feed siparişler için çalışma döngüsü ve dakika aralığı |
Örnek Başarılı Yanıt (Success Response):
{
"order": 1394285
}
Örnek Entegrasyon Kodları (PHP, cURL, Python)
PHP cURL Sipariş Verme
<?php
$api_url = 'https://medyabay.com/api/v2';
$api_key = 'YOUR_API_KEY';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
'key' => $api_key,
'action' => 'add',
'service' => 101,
'link' => 'https://instagram.com/kullanici',
'quantity' => 1000
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
?>
Python Requests Örneği
import requests
url = "https://medyabay.com/api/v2"
payload = {
"key": "YOUR_API_KEY",
"action": "add",
"service": 101,
"link": "https://instagram.com/kullanici",
"quantity": 1000
}
response = requests.post(url, data=payload)
data = response.json()
print("Sipariş No:", data.get("order"))