A number lookup API takes a mobile number and returns details about the connection, usually the operator and telecom circle. Telecom services use that answer to choose which plans to show and where to send a recharge. This guide covers the lookup types for Indian numbers and how to call the datayuge Operator Lookup API.
Three types of number lookup
Question | Number series check | MNP lookup | HLR lookup |
|---|---|---|---|
What it tells you | The operator and circle the number series was first given to | The operator serving the number now, and whether it has been ported | Whether the number is assigned, which network serves it and, where supported, whether it is reachable |
Correct for ported numbers | No | Yes | Depends on the country and operator |
At datayuge | Operator Lookup API | Operator Lookup API | HLR Lookup API, on request |
A series check reads the leading digits. It stops being reliable once a subscriber moves to another operator and keeps the number, which mobile number portability allows, even across circles.
Which lookup your service needs
- Recharge and bill payment apps need the current operator, so use an MNP lookup. Otherwise a recharge can go to a ported number's old operator.
- Carrier billing also depends on the current network.
- A form that pre-fills the operator, and lets the user correct it, can start with a series check on the first 5 digits.
- SMS routing, contact list cleaning and delivery number checks may need to know whether a number is assigned or reachable. That is an HLR lookup.
What the Operator Lookup API returns
The API covers Indian mobile numbers and returns operator and circle. You can send a 10 digit number, or its first 5 digits to get the default operator and circle.
The API reference lists Airtel, BSNL, MTNL, Vi and Jio as providers. The V4 version, which most older accounts use, still returns Vodafone and Idea separately. Check which version is active on your account before you write code that matches operator names.
Circle names need the same care. The reference lists Chennai separately from Tamil Nadu, while the current list of 22 telecom circles counts Chennai as part of Tamil Nadu. If your plan data uses one convention, map the other to it.
A lookup does not give you the owner's name, address or location.
How to call it
Sign up to get your endpoint and API key. The reference lists two parameters, number and apikey. A V1 response looks like this:
{
"success": true,
"data": {
"operator": "Airtel",
"circle": "Karnataka"
}
}V4 returns operator and circle at the top level. This Node.js function accepts both shapes and passes on the error text the API sends:
// Your endpoint and API key come with your datayuge account. Keep both on the server.
const { DATAYUGE_LOOKUP_URL, DATAYUGE_API_KEY } = process.env;
export async function lookup(number) {
if (!/^[6-9]\d{9}$/.test(number)) {
throw new Error('Enter a 10 digit Indian mobile number');
}
const url = new URL(DATAYUGE_LOOKUP_URL);
url.search = new URLSearchParams({ number, apikey: DATAYUGE_API_KEY });
const response = await fetch(url, {
signal: AbortSignal.timeout(5000),
});
const body = await response.json();
const result = body.data ?? body; // V1 wraps the result in "data"
if (!result.operator) {
throw new Error(body.error ?? body.message ?? 'Lookup failed');
}
return { operator: result.operator, circle: result.circle };
}For PHP, follow the operator finder tutorial. The published samples show only the operator and circle. If your code needs a separate ported flag, ask us to confirm the field before you build on it.
Plan for failed and outdated lookups
Let the customer choose or correct the operator before paying, so a failed lookup does not block a recharge. Look the number up close to the time of the transaction, because a stored result goes stale when the number is ported. Stay within the rate limit of your plan.
Phone numbers are personal data. Send them from your server, collect only what you need and keep full numbers out of your logs.
Questions to ask before choosing a lookup API
- Which countries does it cover?
- Does the answer come from the number series, portability data or the network?
- Which fields come back, and what does an error look like?
- What are the rate limits and the price at your volume?
Frequently asked questions
Does datayuge offer lookup for numbers outside India?
The Operator Lookup API is for Indian numbers. For other countries, ask about the HLR Lookup API and send the countries you need. We will confirm what is available for each.
How long does number porting take in India?
TRAI's portability FAQ gives 3 working days within a circle and 5 working days between circles or for corporate numbers. In Jammu and Kashmir, Assam and North East it can take up to 15 working days.
Can a lookup show who owns a number?
No. It identifies the operator and circle of a number.