Skip to content

Phone Number Validation API: HLR, MNP and Line Type

What a phone number validation API returns: format checks, line type, MNP and HLR lookups, how they differ and how to choose a provider.

Updated 20 October 2026

A phone number validation API checks a number before you message or call it. Depending on the level, it confirms the format and country, identifies the line type and current carrier (MNP lookup), and checks with the mobile network whether the number is live (HLR lookup). Senders use it to clean lists, route to the right network, block risky sign-ups and avoid paying for messages that cannot be delivered.

What does a phone number validation API return?

Lookups come in levels, and each costs more and takes longer than the one before:

LevelHow it worksReturnsSpeed and cost
Format validationRules from national numbering plansValid or not, country, E.164 form, possible typeInstant, often free (open-source libraries)
Line type and carrierNumbering range and carrier databasesMobile, landline, VoIP, toll-free; original carrierFast, low cost
MNP lookupNumber portability databasesCurrent carrier after porting, MCC/MNCFast, low cost, not available in every country
HLR lookupLive query to the mobile network's subscriber registerActive or not, current network, sometimes roaming statusSlower, highest cost; mobile numbers only

Format checks belong on every form. Carrier and line type checks are worth it at sign-up and for routing. HLR is for high-value checks and list cleaning. Details are in HLR lookup explained and VoIP number lookup.

Phone number validation vs verification: what is the difference?

Validation checks the number: is it real, what type, which network. Verification checks the person: they prove they control the number by entering a code sent by SMS or voice. A good sign-up flow does both, in that order: validate first so you do not send OTPs to invalid, landline or high-risk numbers, then verify with an OTP. See OTP SMS best practices.

What is an HLR lookup API used for?

  • List cleaning: remove inactive numbers before a campaign so you do not pay for undeliverable messages.
  • Routing: send each message to the route for the subscriber's current network, using MCC and MNC codes.
  • Fraud checks: flag numbers that are not live or not on a mobile network at sign-up.
  • Diagnosing delivery: when a message fails, check whether the number exists before blaming the route.

The registers behind these lookups are explained in HLR vs VLR.

How to choose a phone number validation API

  • Coverage per country: MNP and HLR data quality differs a lot between countries; ask for coverage by country, not a global claim.
  • Data freshness: how often carrier and portability data is updated.
  • Accuracy on your traffic: test a sample of known numbers from your own users.
  • Latency: sign-up checks need answers in well under a second; HLR can take longer.
  • Pricing model: per lookup, per level; check whether failed or cached lookups are charged.
  • Privacy: where queries are processed and how long numbers are stored.

Where to use validation in your flow

  1. On the form: format check as the user types, with the country preselected, and store numbers in E.164 format.
  2. On submit: line type and carrier lookup; block premium ranges and apply your policy for VoIP numbers.
  3. Before OTP: rate limits per number, IP and device, then send the code by SMS or by voice for landlines.
  4. Before campaigns: HLR or MNP lookups on old lists to remove inactive numbers and route to the right network.

Checking format and carrier for your own users and contacts is common practice. HLR and similar network queries return technical status, not the owner's identity, but you still process personal data, so you need a lawful reason and must follow privacy law (for example the GDPR in the EU). Do not use lookups to profile people or to build lists of numbers you have no relationship with.

Pair validation with good routes

Validation reduces waste, and the right route delivers what is left. VoIPMatcher sources A2P SMS routes from its carriers and manages them for you. Request an SMS route.

Frequently asked questions

Is there a free phone number validation API?

Format validation can be free: open-source libraries such as Google's libphonenumber check number format and possible type offline. Carrier, portability and HLR data come from paid databases and network queries, so APIs that return them usually charge per lookup, sometimes with a small free trial.

What is the difference between HLR lookup and MNP lookup?

An MNP lookup checks portability databases to find a number's current operator. An HLR lookup queries the mobile network's subscriber register and can also tell whether the number is active. MNP is faster and cheaper; HLR gives live status but only for mobile numbers.

Can a validation API tell if a number is on WhatsApp?

Standard validation APIs return telecom data such as format, line type, carrier and network status. Whether a number uses a messaging app is not part of telecom lookups, and checking it without consent can break the app's terms and privacy rules.

How accurate is phone number validation?

Format checks are very accurate. Line type and carrier data are usually reliable for mobile versus landline but weaker for VoIP categories and recently ported or allocated numbers. HLR results are live but can fail when networks restrict queries. Test any provider on your own numbers.

Need a route?

Send the destination, route type and target rate. We reply with what we can deliver.

More guides

All guides
A2P SMS SMPP Client and Server Tools for Testing Open-source SMPP client libraries, servers and simulators for testing, and a step-by-step method to test an SMPP connection. A2P SMS Concatenated SMS: How Long Messages Are Split How concatenated SMS works: long messages split into 153 or 67 character segments, UDH and SMPP options, maximum length, billing and delivery reports. A2P SMS SMS Sender ID: Alphanumeric, Numeric and Short Code What a sender ID in SMS is: alphanumeric sender ID examples, numeric long codes and short codes compared, length limits, replies and country rules. A2P SMS SMS Delivery Rate: Benchmarks, Latency and Monitoring How to calculate SMS delivery rate and latency, what a normal SMS delivery rate looks like, common causes of poor results and how to monitor routes. A2P SMS What Is an SMS API and How to Integrate One What an SMS API is, how it works from request to delivery report, integration steps, API key security and what to look for in a provider. A2P SMS VoIP Number Lookup: How Line Type Detection Works How VoIP number lookup and line type detection work, what each line type means, and how apps use them to stop fake sign-ups and SMS fraud. A2P SMS SMS OTP Best Practices: Length, Expiry and Delivery SMS OTP best practices for fast, secure delivery: route choice, sender ID, message format, code length and expiry, SMS pumping protection and fallback. A2P SMS Direct SMS Routes: What They Are and How to Verify What a direct SMS route is, why it delivers better than indirect or grey routes, when OTP traffic needs one and how to verify a supplier's direct claim.