API-Dokumentation

API-Schlüssel
Verfügbare Methoden
Methode URL Beschreibung Parameter
GET/POST /api/v1/phone/validate Nummernvalidierung phone, country, api_key
Parameter:
Parameter Beschreibung Beispiel Erforderlich
api_key API-Schlüssel your_key Ja
phone Telefonnummer +393201234567 Ja
country Ländercode IT, ["IT","US","DE"] Nein
Arbeiten mit mehreren Ländern

Der Parameter country unterstützt mehrere Formate:

  • Ein Land: IT
  • Mehrere Länder, durch Komma getrennt: IT,US,DE
  • Mehrere Länder, durch Semikolon getrennt: IT;US;DE
  • Mehrere Länder, durch Leerzeichen getrennt: IT US DE
  • Länder-Array (POST): ["IT", "US", "DE"]

Die API versucht, die Nummer mit jedem Land der Reihe nach zu parsen, bis ein gültiges Ergebnis gefunden wird. Dies ist besonders nützlich für Nummern im nationalen Format.

Antwortcodes
Code Beschreibung Beispiel
200 Erfolgreiche Anfrage
{
  "success": true,
  "data": {
    "is_valid": true,
    "type_id": 1,
    "type_name": "Mobile",
    "is_mobile": true,
    "is_fixed_line": false,
    "phone_code": "+39",
    "country_code": "IT",
    "location": null,
    "international": "+39 320 123 4567",
    "national": "320 123 4567",
    "e164": "+393201234567",
    "rfc3966": "tel:+39-320-123-4567"
  },
  "error": null,
  "request_id": "a430273e63f07ef5805f04e5f8a94d16f0351fd7"
}
400 Ungültige Anfrage (Parameterfehler)
{
  "success": false,
  "data": null,
  "error": "Invalid phone number",
  "request_id": "b1e2c3d4e5f6a7b8c9d0e1f2a3b4c5d6"
}
401 Nicht autorisiert (ungültiger oder fehlender API-Schlüssel)
{
  "success": false,
  "data": null,
  "error": "Invalid API key",
  "request_id": "c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7"
}
403 Zugriff verweigert (keine Rechte oder gesperrt)
{
  "success": false,
  "data": null,
  "error": "Access denied",
  "request_id": "d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8"
}
404 Methode oder Ressource nicht gefunden
{
  "success": false,
  "data": null,
  "error": "Method or resource not found",
  "request_id": "e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9"
}
429 Anfragelimit überschritten
{
  "success": false,
  "data": null,
  "error": "Request limit exceeded",
  "request_id": "f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0"
}
500 Interner Serverfehler
{
  "success": false,
  "data": null,
  "error": "Internal server error",
  "request_id": "a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1"
}
Test-API-Schlüssel: test
Wenn Sie diesen Schlüssel in Anfragen verwenden, gibt die API immer eine Demo-Antwort (Mock) zurück.
Das Guthaben wird nicht verbraucht, echte Prüfungen werden nicht durchgeführt.
Beispiel:
curl "https://numlook.ru/api/v1/phone/validate?phone=+393201234567&api_key=test"
Beispielanwendungen
cURL-Befehle
Nummernvalidierung:
cURL
curl "https://numlook.ru/api/v1/phone/validate?phone=+393201234567&api_key=your_key"
Mit mehreren Ländern:
cURL
curl "https://numlook.ru/api/v1/phone/validate?phone=3201234567&country=IT,US,DE&api_key=your_key"
POST-Anfrage mit Länderarray:
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)
Nummernvalidierung:
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));
Mit mehreren Ländern:
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));
POST-Anfrage mit Länderarray:
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
Validierung einer Nummer:
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);
Mit mehreren Ländern:
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);
POST-Anfrage mit Länderarray:
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);