Numarayı koddan alın, kodu koddan okuyun
GhostSIM REST API ile 200+ servis için sanal numara satın al, SMS kodunu otomatik çek. Panelle aynı fiyatlar, aynı bakiye; ek ücret yok.
https://ghostsim.app/api/v1
Anahtar oluştur
Hesap › Geliştirici API bölümünden en fazla 3 anahtar oluştur. Anahtar yalnızca bir kez gösterilir.
Numara al
Servis ve ülke koduyla POST /numbers çağır; ücret bakiyenden düşer, numara anında gelir.
Kodu oku
Birkaç saniyede bir GET /numbers/{id} sorgula; sms_code dolunca kodun hazır. SMS gelmezse ücret iade edilir.
Kimlik doğrulama
Her isteğe API anahtarını Bearer olarak ekle. Anahtar hesabına bağlıdır; panelde kullandığın bakiye ve fiyatlar geçerlidir.
Authorization: Bearer YOUR_API_KEY
Accept: application/json
- Yalnızca HTTPS
- Anahtarı sunucunda tut, tarayıcıda/uygulamada değil
- Sızdıysa iptal et, yenisini oluştur
- Ek ücret yok: panelle aynı fiyat
Uç noktalar
Tüm yanıtlar JSON; listeler ve kayıtlar "data" alanında gelir.
/balance
/services
/services/{service}/countries
/numbers
/numbers/{id}
/numbers
/numbers/{id}/finish
/numbers/{id}/cancel
/numbers/{id}/another
/numbers/{id}/retry
serviceservis kodu (/services listesinden)countryülke kodu (/services/{service}/countries listesinden)Idempotency-Key: …isteğe bağlı; aynı anahtarla tekrar gönderirsen ikinci kez ücret alınmaz
Süre dolup SMS gelmezse sipariş expired olur ve ücret bakiyene otomatik iade edilir.
Örnek kod
# 1) Bakiyeyi gör
curl https://ghostsim.app/api/v1/balance \
-H "Authorization: Bearer $GHOSTSIM_KEY" -H "Accept: application/json"
# 2) Numara al
curl -X POST https://ghostsim.app/api/v1/numbers \
-H "Authorization: Bearer $GHOSTSIM_KEY" -H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"service":"wa","country":"6"}'
# 3) Kod gelene kadar sorgula
curl https://ghostsim.app/api/v1/numbers/12345 \
-H "Authorization: Bearer $GHOSTSIM_KEY" -H "Accept: application/json"
import os, time, requests
API = "https://ghostsim.app/api/v1"
H = {"Authorization": "Bearer " + os.environ["GHOSTSIM_KEY"], "Accept": "application/json"}
# Numara al
num = requests.post(API + "/numbers", json={"service": "wa", "country": "6"}, headers=H).json()["data"]
print(num["phone_number"])
# Kod gelene kadar sorgula
while True:
a = requests.get(f"{API}/numbers/{num['id']}", headers=H).json()["data"]
if a["sms_code"] or a["status"] in ("cancelled", "expired"):
break
time.sleep(5)
print(a["sms_code"])
# Siparişi kapat
requests.post(f"{API}/numbers/{num['id']}/finish", headers=H)
const API = 'https://ghostsim.app/api/v1';
const H = { Authorization: `Bearer ${process.env.GHOSTSIM_KEY}`, Accept: 'application/json', 'Content-Type': 'application/json' };
// Numara al
const { data: num } = await (await fetch(`${API}/numbers`, { method: 'POST', headers: H, body: JSON.stringify({ service: 'wa', country: '6' }) })).json();
console.log(num.phone_number);
// Kod gelene kadar sorgula
let a;
do {
await new Promise((r) => setTimeout(r, 5000));
({ data: a } = await (await fetch(`${API}/numbers/${num.id}`, { headers: H })).json());
} while (!a.sms_code && !['cancelled', 'expired'].includes(a.status));
console.log(a.sms_code);
Hatalar
API_KEY_REQUIREDINSUFFICIENT_CREDITSLOW_DELIVERYTOO_MANY_ACTIVEToo Many AttemptsUPSTREAM_UNAVAILABLEİstek sınırları
- Tüm istekler300/min
- Satın alma30/min
- İptal / bitir / yeni SMS60/min
Durum sorgusu için 3-5 saniyede bir yeterli. Daha yüksek limit gerekiyorsa destekten yaz.
API anahtarı al