postio_

Which API should I use to validate UK phone numbers?

How to choose an API to validate UK mobile and landline numbers: formatting, line-type checks and live HLR lookup, E.164 and carrier results, where to run the check, integration, a buyer checklist, and where Postio fits.

Short answer

For UK numbers, choose an API that tells mobile from landline and checks the live network, not one that only tidies the format. Postio validates UK mobile and landline numbers, normalises them to E.164 and returns the carrier from a live HLR lookup, on pay-as-you-go billing with no subscription.

Two limits matter. A live check reports what the network says about the number now; it does not promise a message will arrive. And Postio's phone validation is for UK numbers, so a multi-country need is a different brief.

Who this guide is for

You are choosing an API to check phone numbers on a UK website or app: at sign-up, at checkout, or in records you already hold. The criteria below decide it, whichever provider you pick.

Why a correctly formatted number is not an active number

A format check is pattern matching. 07700 900123 has the right shape for a UK mobile, so a regex or a library accepts it. That says nothing about whether the number is in service, who holds it now, or whether it is a mobile at all.

Three levels of check get sold as phone validation:

  • Format and parse. The number is read and split into country code, prefix and subscriber number, then reformatted.
  • Line type. The prefix shows the range as mobile, landline, VoIP or non-geographic. Useful, but a prefix records what a number was allocated as.
  • Live network lookup (HLR). A query to the network that holds the number now. Current carrier, porting and reachability come from here.

Only the third checks the live network. The first two still earn their place: they catch typos cheaply and tell you what kind of number you have.

What UK mobile and landline validation involves

E.164 normalisation. E.164 is the international form: a plus, the country code, then the national number with no spaces or punctuation, as in +447700900123 rather than 07700 900123. Store that form, so two records of one number match and downstream systems get one unambiguous string.

Line type. Mobile, fixed line, VoIP, non-geographic. UK numbers come in all four, and they behave differently, so record which one you have.

Live HLR lookup and the carrier result. HLR is the Home Location Register, the register a mobile network keeps of the numbers on it. A live lookup asks the network instead of reading the original range allocation. Postio returns the carrier that holds the number now, whether it has been ported from its original carrier, and whether the network reports it reachable. Where the lookup cannot complete, the response says why instead of guessing.

Where to run the check

At sign-up. Validate the number, store E.164 and keep the line type. One call per submission.

At checkout. The same call at the point of capture, so what you save is clean. Don't call on every keystroke: a live lookup is slower than a formatting check and is billable, so run it when the field is submitted.

On records you already hold. Numbers arrive from imports and old systems in mixed formats. Normalising to E.164 and reading the line type is a plain way to deduplicate and to find records that will never work. Batch it, retry failures, and log the field that explains a lookup that did not complete.

None of this stops fraud, and none of it confirms delivery. A valid, reachable mobile can still belong to someone who did not sign up. Treat it as one input.

How to add it with Postio

  1. Get a key and send it in an x-api-key header. Every endpoint is a GET returning JSON.
  2. Pass the number in the path, URL-encoded, so a leading + becomes %2B. E.164 resolves most reliably.
  3. Read isValid, type, e164Format, currentCarrier, isPorted and isReachable. Store e164Format.
GET https://api.postio.co.uk/v1/phone/%2B447700900123
x-api-key: pk_...

The phone reference lists every field. The SDKs page lists the Python, Go, PHP, Ruby and .NET libraries, each with phone helpers. Errors and rate limits covers retries.

Buyer checklist

CheckWhat to ask
UK number typesMobile, landline, VoIP and non-geographic all handled, with the type returned?
Live checkIs there a live network lookup, or only prefix and format checks?
CarrierDoes it return the carrier that holds the number now, and whether it was ported?
Response clarityNamed fields for validity, line type, E.164 and reachability, and a stated reason when the lookup fails?
IntegrationJSON API, and an SDK for your language?
BillingPay as you go, or a monthly minimum?

Where Postio fits

Postio is a UK validation API for addresses, emails and phone numbers: one account, one JSON API, pay as you go. The phone side is UK mobile and landline checks with a live HLR lookup. It suits UK sites and apps that need to know which numbers are mobiles, which are landlines, and which carrier holds them now. It is not a multi-country service, and it is not a fraud or messaging stack.

Next step

Start with the 100 free lookups, run a few of your own numbers through it — a landline, a ported mobile, a number typed with spaces — then read the phone documentation. Billing is on pricing.

QUESTIONS

Straight answers.

Is a correctly formatted UK phone number an active number?

No. Format and line-type checks read the number itself: they confirm the shape and, from the prefix, the range it was allocated as. Only a live network lookup reports what the network holds now, which is where the current carrier, porting and reachability come from. Postio does the parse and the live HLR lookup in one call.

How do I tell a UK mobile from a landline?

Read the line type in the result. Postio returns the number's type alongside the parsed number, so you can record whether it is a mobile, a fixed line, a VoIP number or non-geographic, and decide per screen whether that is the kind of number you want.

What does the carrier lookup return?

The carrier holding the number now, whether it has been ported from the carrier it was originally allocated to, and whether the network reports it reachable, plus the MCC and MNC of the current network. Where the lookup cannot complete, a lookup error field gives the reason rather than an answer that looks like a result.

Should I store the number in E.164?

Yes. The e164Format field is the canonical form: a plus, the country code, then the national number with no spaces or punctuation. Storing it makes two records of the same number match and gives diallers and other systems one unambiguous string.

Does Postio validate phone numbers outside the UK?

Postio's phone validation is aimed at UK mobile and landline numbers. If you take numbers from other countries, you need a provider that covers them, either alongside Postio or instead of it.

How does billing work?

Pay as you go, with no subscription and no monthly fee, on one account for addresses, emails and phone numbers. Current prices are on the pricing page.

Ready in under a minute.

Sign up, grab a key, paste it in. Your first hundred lookups are on us.