API 문서

사용 가능한 메서드
메서드 URL 설명 설정
GET/POST /api/v1/phone/validate 번호 검증 phone, country, api_key
매개변수:
매개변수 설명 예시 필수
api_key API 키 your_key
phone 전화번호 +393201234567
country 국가 코드 IT, ["IT","US","DE"] 아니오
여러 국가 작업

매개변수 country는 여러 형식을 지원합니다:

  • 한 국가: IT
  • 쉼표로 구분된 여러 국가: IT,US,DE
  • 세미콜론으로 구분된 여러 국가: IT;US;DE
  • 공백으로 구분된 여러 국가: IT US DE
  • 국가 배열 (POST): ["IT", "US", "DE"]

API는 각 국가로 번호를 순차적으로 파싱하여 유효한 결과를 찾을 때까지 시도합니다. 이는 국가 형식의 번호에 특히 유용합니다.

응답 코드
코드 설명 예시
200 성공한 요청
{
  "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 잘못된 요청 (매개변수 오류)
{
  "success": false,
  "data": null,
  "error": "Invalid phone number",
  "request_id": "b1e2c3d4e5f6a7b8c9d0e1f2a3b4c5d6"
}
401 인증되지 않음 (잘못된 또는 누락된 API 키)
{
  "success": false,
  "data": null,
  "error": "Invalid API key",
  "request_id": "c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7"
}
403 접근 거부 (권한 없음 또는 차단됨)
{
  "success": false,
  "data": null,
  "error": "Access denied",
  "request_id": "d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8"
}
404 메서드 또는 리소스를 찾을 수 없음
{
  "success": false,
  "data": null,
  "error": "Method or resource not found",
  "request_id": "e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9"
}
429 요청 한도 초과
{
  "success": false,
  "data": null,
  "error": "Request limit exceeded",
  "request_id": "f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0"
}
500 서버 내부 오류
{
  "success": false,
  "data": null,
  "error": "Internal server error",
  "request_id": "a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1"
}
테스트 API 키: test
이 키를 요청에서 사용하면 API는 항상 데모(모의) 응답을 반환합니다.
잔액이 소모되지 않으며 실제 검증이 수행되지 않습니다.
예시:
curl "https://numlook.ru/api/v1/phone/validate?phone=+393201234567&api_key=test"
사용 예시
cURL 명령어
번호 검증:
cURL
curl "https://numlook.ru/api/v1/phone/validate?phone=+393201234567&api_key=your_key"
여러 국가와 함께:
cURL
curl "https://numlook.ru/api/v1/phone/validate?phone=3201234567&country=IT,US,DE&api_key=your_key"
국가 배열로 POST 요청:
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)
번호 검증:
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));
여러 국가와 함께:
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 요청:
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
단일 번호 검증:
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);
여러 국가와 함께:
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 요청:
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);