API Dokümantasyonu
Erişilebilir yöntemler
Yöntem | URL | Açıklama | Ayarlar |
---|---|---|---|
GET/POST | /api/v1/phone/validate |
Numara doğrulama | phone , country , api_key |
Parametreler:
Parametre | Açıklama | Örnek | Zorunlu |
---|---|---|---|
api_key |
API anahtarı | your_key |
Evet |
phone |
Telefon numarası | +393201234567 |
Evet |
country |
Ülke kodu | IT , ["IT","US","DE"] |
Hayır |
Birden fazla ülke ile çalışma
Parametre country
birden fazla format destekler:
- Tek ülke:
IT
- Virgülle ayrılmış birden fazla ülke:
IT,US,DE
- Noktalı virgülle ayrılmış birden fazla ülke:
IT;US;DE
- Boşlukla ayrılmış birden fazla ülke:
IT US DE
- Ülke dizisi (POST):
["IT", "US", "DE"]
API, her ülke için sırayla numarayı çözmeye çalışır ve geçerli bir sonuç bulana kadar devam eder. Bu, ülke kodlu numaralar için özellikle yararlıdır.
Yanıt kodları
Kod | Açıklama | Örnek |
---|---|---|
200 | Başarılı istek |
|
400 | Geçersiz istek (parametre hatası) |
|
401 | Yetkilendirilmemiş (yanlış veya API anahtarı eksik) |
|
403 | Erişim engellendi (izin yok veya engellendi) |
|
404 | Yöntem veya kaynak bulunamadı |
|
429 | İstek limiti aşıldı |
|
500 | Sunucu iç hatası |
|
Test API anahtarı:
Eğer bu anahtarı kullanıyorsanız, API her zaman gösterim (mock) yanıtı döndürür.
Bakiye tüketilmiyor, gerçek kontroller yapılmıyor.
Örnek:
test
Eğer bu anahtarı kullanıyorsanız, API her zaman gösterim (mock) yanıtı döndürür.
Bakiye tüketilmiyor, gerçek kontroller yapılmıyor.
Örnek:
curl "https://numlook.ru/api/v1/phone/validate?phone=+393201234567&api_key=test"
Örnek kullanımlar
cURL komutları
Numara doğrulama:
cURL
curl "https://numlook.ru/api/v1/phone/validate?phone=+393201234567&api_key=your_key"
Birden fazla ülke ile:
cURL
curl "https://numlook.ru/api/v1/phone/validate?phone=3201234567&country=IT,US,DE&api_key=your_key"
Ülke dizisi ile POST isteği:
cURL
curl -X POST "https://numlook.ru/api/v1/phone/validate" \
-H "Content-Type: application/json" \
-d '{
"phone": "3201234567",
"country": ["IT", "US", "DE"],
"api_key": "your_key"
}'
JavaScript (fetch)
Numara doğrulama:
JavaScript
// Number validation
fetch('https://numlook.ru/api/v1/phone/validate?phone=+393201234567&api_key=your_key')
.then(response => response.json())
.then(data => console.log(data));
Birden fazla ülke ile:
JavaScript
// With multiple countries
fetch('https://numlook.ru/api/v1/phone/validate?phone=3201234567&country=IT,US,DE&api_key=your_key')
.then(response => response.json())
.then(data => console.log(data));
Ülke dizisi ile POST isteği:
JavaScript
// POST request with array of countries
fetch('https://numlook.ru/api/v1/phone/validate', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
phone: '3201234567',
country: ['IT', 'US', 'DE'],
api_key: 'your_key'
})
})
.then(response => response.json())
.then(data => console.log(data));
PHP
Tek numara doğrulama:
PHP
// Single number validation
$apiKey = 'your_key';
$phone = '+393201234567';
$response = file_get_contents(
"https://numlook.ru/api/v1/phone/validate?phone=" . urlencode($phone) . "&api_key=" . $apiKey
);
$data = json_decode($response, true);
var_dump($data);
Birden fazla ülke ile:
PHP
// With multiple countries
$apiKey = 'your_key';
$phone = '3201234567';
$countries = 'IT,US,DE';
$response = file_get_contents(
"https://numlook.ru/api/v1/phone/validate?phone=" . urlencode($phone) . "&country=" . urlencode($countries) . "&api_key=" . $apiKey
);
$data = json_decode($response, true);
var_dump($data);
Ülke dizisi ile POST isteği:
PHP
// POST request with array of countries
$apiKey = 'your_key';
$postData = json_encode([
'phone' => '3201234567',
'country' => ['IT', 'US', 'DE'],
'api_key' => $apiKey
]);
$context = stream_context_create([
'http' => [
'method' => 'POST',
'header' => 'Content-Type: application/json',
'content' => $postData
]
]);
$response = file_get_contents('https://numlook.ru/api/v1/phone/validate', false, $context);
$data = json_decode($response, true);
var_dump($data);