Skip to main content

Overview

Number lookup provides real-time carrier information, porting status, and number type validation using HLR (Home Location Register) and MNP (Mobile Number Portability) queries. What you get:
  • Carrier name and network codes (MCC/MNC)
  • Porting status (original vs current carrier)
  • Number type (mobile, landline, VoIP)
  • Country and region information

Single Lookup

cURL
curl -X POST https://api-message.nativehub.live/api/v1/numbers/lookup \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "+8801712345678"
  }'
Node.js
const response = await fetch('https://api-message.nativehub.live/api/v1/numbers/lookup', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    phone: '+8801712345678'
  })
});

const data = await response.json();
console.log(data);
Python
import requests

response = requests.post(
    'https://api-message.nativehub.live/api/v1/numbers/lookup',
    headers={
        'Authorization': 'Bearer YOUR_API_TOKEN',
        'Content-Type': 'application/json'
    },
    json={'phone': '+8801712345678'}
)

data = response.json()
print(data)
Response:
{
  "phone": "+8801712345678",
  "country_code": "BD",
  "country_name": "Bangladesh",
  "carrier": "Grameenphone",
  "is_ported": false,
  "is_mobile": true,
  "mcc": "470",
  "mnc": "01"
}

Batch Lookup

Process multiple numbers in a single request.
cURL
curl -X POST https://api-message.nativehub.live/api/v1/numbers/lookup/batch \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "numbers": ["+8801712345678", "+8801812345679", "+8801912345680"]
  }'
Node.js
const response = await fetch('https://api-message.nativehub.live/api/v1/numbers/lookup/batch', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    numbers: ['+8801712345678', '+8801812345679', '+8801912345680']
  })
});

const results = await response.json();
Python
response = requests.post(
    'https://api-message.nativehub.live/api/v1/numbers/lookup/batch',
    headers={
        'Authorization': 'Bearer YOUR_API_TOKEN',
        'Content-Type': 'application/json'
    },
    json={'numbers': ['+8801712345678', '+8801812345679', '+8801912345680']}
)

results = response.json()

Lookup History

Retrieve past lookup results.
cURL
curl -X GET https://api-message.nativehub.live/api/v1/numbers/lookup \
  -H "Authorization: Bearer YOUR_API_TOKEN"
Lookup by phone:
cURL
curl -X GET https://api-message.nativehub.live/api/v1/numbers/lookup/+8801712345678 \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Use Cases

Use CaseBenefit
Pre-send validationAvoid sending to invalid or inactive numbers
Contact list cleaningRemove landlines and non-mobile numbers from SMS campaigns
Cost optimizationRoute messages through cheapest carrier based on current network
Fraud preventionDetect VoIP numbers or suspicious porting patterns
AnalyticsTrack carrier distribution in your contact database
Lookup results are cached for 24 hours. Numbers may port between carriers, so periodic re-validation is recommended for critical use cases.

Response Fields

FieldTypeDescription
phonestringPhone number in E.164 format
country_codestringISO 3166-1 alpha-2 country code
country_namestringFull country name
carrierstringCurrent carrier/operator name
is_portedbooleanWhether number has been ported to a different carrier
is_mobilebooleanWhether number is a mobile device (vs landline/VoIP)
mccstringMobile Country Code
mncstringMobile Network Code