An HLR lookup asks a mobile number’s home network, in real time, whether the number exists, which operator currently serves it and whether it is reachable, without sending anything to the phone. You run it before you send so you can clean lists, route messages to the right network and stop paying for texts that cannot arrive, and an HLR lookup API lets you do it from your own code in a single request.
This guide explains how HLR differs from MNP and carrier lookups, what happens on the network during a query, when a lookup pays for itself, and how to run one with a curl example.
HLR vs MNP vs carrier lookup: what’s the difference?
All three answer “where does this number go?”, but with different depth and freshness.
| Check | What it asks | What you learn | Best for |
|---|---|---|---|
| HLR lookup | The number’s home network, live | Whether the line is active, the serving network, portability and, where available, roaming | Reachability, list cleaning, OTP pre-checks |
| MNP lookup | A number portability source | The operator that currently owns the number | Routing in markets where many numbers are ported |
| Carrier (MCC/MNC) lookup | Static numbering data | The operator a number range was originally assigned to, plus formatting guidance | Quick routing rules and number formatting when live status is not needed |
A simple rule: use HLR for health and reachability, add MNP in port-heavy markets, and keep an MCC/MNC lookup for formatting and fast routing decisions. A static carrier lookup cannot tell you that a number was disconnected last month; an HLR lookup can.
How does an HLR query work on the network?
The home location register (HLR) is the database in each mobile operator’s core network that holds its subscribers’ profiles and knows which switch is currently serving each one. SMS delivery already depends on it, and an HLR lookup reuses the same step.
- The query goes out. The lookup platform sends the GSM MAP operation SendRoutingInfoForSM over the SS7 signalling network to the number’s home network, just as an SMS centre does before delivering a text. The operation is defined in 3GPP TS 29.002.
- The HLR answers. If the subscriber exists and can receive messages, the HLR returns routing information: the subscriber’s IMSI and the address of the switch currently serving the handset.
- Or it returns an error. The standard lists the errors this operation can return, including unknown subscriber, absent subscriber, call barred, teleservice not provisioned and system failure. Each maps to a practical outcome: dead number, phone off, barred, no SMS service or try again.
- The platform interprets the result. The raw signalling answer is turned into fields you can act on, such as reachable, ported and the network codes.
No message reaches the handset and the user is not notified. The IMSI and serving switch tell the platform whether the number has moved away from its original network and whether it is roaming.
Two practical caveats. First, coverage and detail vary: some operators restrict or filter signalling queries from outside their network, so certain fields may be missing in some countries. Second, an HLR result is a snapshot. “Absent” today may be “reachable” in an hour, so treat it as a strong signal rather than a permanent verdict. Our guide to SMS error codes such as absent subscriber explains each state in detail.
When should you run an HLR lookup?
- List cleaning before a campaign. Remove numbers that are no longer active before you pay to message them, especially on old or imported lists.
- OTP pre-checks at sign-up. Check a new number when the user enters it. If it is a landline, not active or clearly wrong, ask the user to correct it before sending a code. This also removes a common cause of invalid number errors.
- Routing. Send each message to the network that currently serves the number, which matters most in markets with heavy porting.
- Fraud and risk signals. Combine reachability, portability, number type and carrier with your own risk rules. Unusual patterns in sign-up numbers are a warning sign; see how to spot and stop SMS pumping fraud.
- Reporting. Consistent MCC and MNC codes let you compare delivery by network across countries.
You do not need a lookup before every message. For a number that delivered yesterday, a fresh HLR query adds cost without much new information. Cache results with a sensible expiry, and re-check when a number has been dormant or starts failing.
Is an HLR lookup worth the cost?
It depends on how many dead numbers your list holds and what a failed message costs you. You can work it out with four values:
- L: the cost of one lookup
- M: the cost of one message to that destination
- k: the number of SMS parts per message (a long or Unicode text can be several parts)
- p: the share of numbers on the list that will fail permanently
Looking up every number costs L per number. Skipping it wastes p × M × k per number on messages that cannot arrive. A lookup pays for itself on direct cost alone when p × M × k is greater than L. The saving grows if you send to the same list repeatedly, because one lookup protects many future sends.
Direct cost is only part of the picture:
- Failed OTPs cost sign-ups and create support tickets.
- Repeated sends to dead numbers make your traffic look lower quality to operators.
- Clean data makes your delivery rates meaningful, so real routing problems stand out.
To get real numbers for your own case, estimate first. The SMS.to API has estimate endpoints for both lookups (https://hlr.sms.to/api/v2/estimate) and messages (https://api.sms.to/sms/estimate), and per-country SMS rates are on the pricing page. For lookup volume pricing, talk to our team.
How do you run an HLR lookup with the SMS.to API?
A single-number lookup is synchronous: you send the number and get the result in the response.
curl -X POST "https://hlr.sms.to/api/v2/lookup" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"number": "+447700900123"}'
The example number comes from a range Ofcom reserves for drama, so it never belongs to a real person; use your own number to test. If your stored numbers are in national format, add default_prefix with a two-letter country code, and numbers without a country dial code are treated as belonging to that country.
For a list, send a numbers array to the same endpoint. Batch lookups run asynchronously and return a report_id, which you fetch later:
curl -X POST "https://hlr.sms.to/api/v2/lookup" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"numbers": ["07700900123", "07700900456"], "default_prefix": "GB"}'
curl "https://hlr.sms.to/api/v2/reports/REPORT_ID" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"
Replace REPORT_ID with the report_id from the first response. If you only need the current operator, the MNP equivalent is https://mnp.sms.to/api/v2/lookup with the same request format. Treat a temporary error such as HTTP 429 or a 5xx as a signal to wait and retry with backoff (for example 1s, 2s, 4s), stopping after a few attempts.
How should you read the results?
The response returns fields for validation, routing and reporting. Fields may vary by country or operator.
| Field | What it tells you | Typical action |
|---|---|---|
reachable | Whether the line is active or inactive | Suppress inactive numbers; keep active ones |
ported | Whether the number moved to another network | Route to the current network |
operator_name, mcc, mnc | The current or original network and its codes | Routing rules and per-network reporting |
number_type | Mobile, landline or virtual | Ask for a mobile number if SMS is required |
country_iso | Two-letter country code | Check against the country the user selected |
roaming, last_country_of_use | Roaming status and last country of use, where available | Risk signals; expect slower delivery when roaming |
status_code, reason | Whether the lookup succeeded, or the issue found | Log it; retry only temporary failures |
Batch reports summarise the outcome across a list, with counts such as active, absent, unknown, invalid, rejected, failed and duplicates, which gives you a quick health score for any imported list.
What about privacy and GDPR?
A phone number linked to a person is personal data under the GDPR, and lookup results about it are too. A few principles apply directly:
- Have a lawful basis. Checking numbers you already hold for a messaging purpose, such as verifying a sign-up or cleaning a consented list, is easier to justify than looking up numbers you have no relationship with.
- Collect only what you need. Data minimisation is a core GDPR principle. If you only need to know whether a number is active, do not store roaming or last-country data.
- Keep it for a limited time. Set a retention period for lookup results, just as you would for other personal data.
- Be transparent. Mention number validation in your privacy notice.
- Do not use it to track people. Roaming and last-country data are for delivery and fraud control, not for monitoring someone’s movements.
- Sign a DPA. Your lookup provider processes this data for you, so put a data processing agreement in place.
This is general guidance, not legal advice. Your data protection officer should confirm the lawful basis and retention period for your use case.
How SMS.to handles HLR lookups
SMS.to is operated by Intergo Telecom, a licensed telecom and CPaaS operator. The SMS.to HLR and MNP lookup service returns reachability, portability, MCC and MNC, number type and, where available, IMSI, roaming status and last country of use. You can call it over the API, run lookups directly in the dashboard and export results at any time. Batch checks and CSV uploads are supported where enabled.
We follow strict privacy and data-minimisation practices, and results are used to help you validate and route messages. Uptime and incident history are visible on the status page. If your use case depends on a specific field, tell us and we will confirm coverage for your countries first.
FAQs
Does an HLR lookup send a message to the phone?
No. It is a signalling query to the home network. Nothing appears on the handset and the user is not notified.
How accurate is an HLR lookup?
It reflects what the home network reports at that moment. Accuracy and detail vary by country and operator, and a reachability result can change within hours.
What is the difference between HLR and MNP lookup?
HLR tells you whether a number is live and reachable. MNP tells you which operator currently owns it. In port-heavy markets you often want both.
Can I check landline numbers?
A lookup can identify the number type, so you can detect landlines and ask the user for a mobile number before sending an SMS.
Run your first lookups on a real list and see how many numbers you can stop paying for. Create a free account, no credit card needed.