Direct answer
Use Postcodes.io when you need to validate a postcode, locate it, or attach region, constituency and local-authority data. Use Ideal Postcodes when a person must select a complete UK delivery address: flat, building, organisation, post town and postcode. For most service-area products the right architecture is both: postcode geography for eligibility, then an address service only when a full premises record is actually required.
Key takeaways
- Postcodes.io resolves a postcode to a place. It never returns the flats, houses or organisations at that postcode.
- Ideal Postcodes resolves a postcode to selectable delivery points from Royal Mail PAF. Keyed, metered, 30 requests per second per IP by default.
- Both come from the same maintainer. They are not competitors; they answer different questions.
- Most service-area products need both: geography for eligibility, premises at the point of need.
- In five years of UK lookups we have shipped neither to production. The lessons still apply.
One postcode, two different records
Postcodes.io is a free UK postcode lookup API and geocoder, maintained as an open-source project by Ideal Postcodes. It serves the ONS Postcode Directory, Ordnance Survey Open Names and Scottish Postcode Directory, and exposes lookup, autocomplete, bulk lookup, reverse geocoding and terminated-postcode search. A result carries coordinates, country, region, local authority, constituency and statistical codes. That is exactly what territory checks, routing, analytics and public-data joins need. Postcodes.io API docs
Ideal Postcodes is an authenticated, metered service over Royal Mail PAF and other datasets. A postcode lookup returns the structured addresses at that postcode; its two-step address search finds candidates from partial text and resolves the selected one to a full record, with UPRNs where the dataset allows. Three address lines, post town and postcode are the minimum for a deliverable UK address. The default rate limit is 30 requests per second per IP, with a separate limit for autocomplete. Ideal Postcodes API reference
Side by side
| Decision factor | Postcodes.io | Ideal Postcodes |
|---|---|---|
| Primary record | Postcode plus geography and administrative codes | Complete, structured delivery-point address |
| Returns flats, houses, organisations | No | Yes, where present in the enabled dataset |
| Coordinates | Yes, postcode level | Property-level data depends on product and dataset |
| Typical UX | Enter postcode, validate or enrich | Enter postcode or partial address, then select a premise |
| Authentication and cost | No key; free public API; self-hosting available | API key; metered balance or plan |
| Best for | Territories, analytics, public-data joins, validation | Checkout, delivery, installations, contracts, CRM capture |
| Caveat | Not an address database; Northern Ireland commercial use needs a separate licence | Paid dependency; key, quota, outage and licence controls are part of the build |
Postcodes.io code is MIT-licensed and Great Britain data is under the OS OpenData licence. Commercial use of Northern Ireland postcode data requires a licence from Land & Property Services. A free endpoint does not remove downstream data obligations. Postcodes.io licences
A real boundary: a cover funnel for a top UK home cover provider
Since 2021 we have built and run the website that sells boiler and home-emergency cover for a top UK home cover provider: a plan configurator, a lead form with postcode lookup, a live plan summary, agreement start date, marketing preferences and CRM sync. This is the live lookup step.

The boundary is easy to miss. A valid postcode is not enough for a premises-based customer journey. The operations team needs the address the customer selected, while the service-area rule needs only the postcode. Collapse both into one “address lookup” step and you either leave the CRM without a complete address or make every eligibility check depend on a paid premises lookup.
What our production record actually shows
A comparison should say what its author runs. Across our UK client work since 2021, premises-level lookups in production run on Loqate: the Capture Find and Retrieve endpoints on WordPress and WooCommerce checkouts, and the Verify endpoint behind a Node parcel-quoting backend that needs international coverage. Google Places covers two enquiry forms. One survey quote wizard uses a free-tier UK lookup with a daily cap. We have not shipped Postcodes.io or Ideal Postcodes to production.
The one Postcodes.io evaluation, in September 2026, was rejected within a day. A quote wizard captured a postcode and a property value to price a survey, then showed the job address as “to be confirmed”, because a postcode is not a premises. Postcodes.io could not return the list of properties the surveyor needed, so the team moved to a premises-level provider. That is the dependency score in one sentence: the eligibility step scored 2, the booking step scored 9, and the tool chosen for the first could not do the second.
The provider sometimes returns the postcode as a container record; a second call with the container ID is needed to list the premises.
Detect a postcode-level response and drill down automatically.The site sent the whole stored CRM address string, including county, a plan reference and a postcode with a stray space. The provider fell back to fuzzy matching.
Extract and normalise the postcode before the call. Never send free text you did not intend to be parsed.The prepaid credit pack ran out after a card change ended auto top-up.
Alert on balance and lookup error rate; keep manual entry working when the provider returns nothing.The manual-entry toggle was on, which hid the lookup button.
Make lookup and manual modes visibly exclusive.The confirmation dropdown was suppressed when only one property matched.
Always show the selection step. The confirmation is the record, not the lookup.A 112-prefix exclusion list ran on the lookup path but not on manual entry, was initially case-sensitive, and on one journey checked the wrong address.
Enforce service-area rules server-side, on every entry path, against the address the business acts on.Two more findings changed how we quote lookups. Cost is a subscription, and it shapes the design: on one commercial provider the Find call with a postcode filter validates without consuming a paid lookup, while Retrieve is charged, so validation can be free and premises resolution paid for only at the point of need. And provider validation is not carrier validation: a parcel-quoting client saw postcodes the address provider accepted and a courier’s rates API rejected. Shipping products must validate against the carrier that will deliver.
The Premises Dependency Score
A ten-point model to stop teams buying an address service for a geography problem, or shipping a postcode API where operations need a real premises. Score the step where the address is captured, not the product.
A warehouse territory heatmap is 0–2. A retailer shipping parcels is 8–10. A home-services lead form splits: 2 for “do we cover your area?”, then 9 when the customer chooses the address operations will use. Splitting those stages is usually the cleanest architecture and the best conversion experience.
A provider boundary that survives pricing and API changes
Keep provider response shapes out of your checkout, onboarding and CRM model. Return a narrow internal contract. That makes it possible to change provider, add a fallback or move a key server-side without rewriting every form.
import { NextRequest, NextResponse } from "next/server";
const compact = (value: string) => value.trim().toUpperCase().split(" ").join("");
export async function GET(request: NextRequest) {
const postcode = compact(request.nextUrl.searchParams.get("postcode") ?? "");
const mode = request.nextUrl.searchParams.get("mode");
if (!/^[A-Z0-9]{5,7}$/.test(postcode)) {
return NextResponse.json({ error: "Enter a full UK postcode" }, { status: 400 });
}
if (mode === "geography") {
const res = await fetch(`https://api.postcodes.io/postcodes/${postcode}`, {
next: { revalidate: 86400 },
});
if (!res.ok) return NextResponse.json({ error: "Postcode not found" }, { status: 404 });
const { result } = await res.json();
return NextResponse.json({
postcode: result.postcode,
latitude: result.latitude,
longitude: result.longitude,
region: result.region,
localAuthorityCode: result.codes.admin_district,
});
}
if (mode === "address") {
const key = process.env.IDEAL_POSTCODES_API_KEY;
if (!key) throw new Error("IDEAL_POSTCODES_API_KEY is missing");
const url = new URL(`https://api.ideal-postcodes.co.uk/v1/postcodes/${postcode}`);
url.searchParams.set("api_key", key);
const res = await fetch(url, { cache: "no-store" });
if (!res.ok) return NextResponse.json({ error: "Address lookup failed" }, { status: 502 });
const { result } = await res.json();
return NextResponse.json({
addresses: result.map((a: Record<string, string>) => ({
line1: a.line_1, line2: a.line_2, line3: a.line_3,
postTown: a.post_town, postcode: a.postcode, uprn: a.uprn,
})),
});
}
return NextResponse.json({ error: "Choose geography or address" }, { status: 400 });
}- The regex is only an early guard. It cannot prove a postcode is allocated; the provider lookup decides. Add an abort timeout, structured error codes and quota alerts.
- Valid postcode, no address returned. Offer manual entry immediately and record the lookup outcome, not a fabricated match.
- New builds and converted flats go missing. Let the user enter and confirm; store provenance as “manual”.
- Follow the GOV.UK address pattern. Accept any case and spacing, do not require county, and keep a manual route for international or unlisted addresses. GOV.UK Design System
Recommendations by business type
A full-address service at checkout, manual entry retained, and the customer-confirmed address passed to fulfilment. Postcodes.io separately for regional analytics or restrictions.
If the product needs region, council or approximate map placement, Postcodes.io is the simpler fit. Ask for a complete address only when the workflow acts on that premises.
Check the postcode or territory early. Resolve and confirm the actual property before a contract, appointment or CRM hand-off.
Keep the selected record, source, identifier where licensed, confirmation time and manual edits. Never let an enrichment job silently overwrite a confirmed address.
Frequently asked questions
- Does Postcodes.io return a full UK address?
- No. It resolves a postcode to postcode-level geography and administrative data. It does not return the individual flats, houses or organisations that receive post at that postcode.
- Is Ideal Postcodes just a paid version of Postcodes.io?
- No. They solve different data problems, although Postcodes.io is an open-source project maintained by Ideal Postcodes. Ideal Postcodes returns structured delivery-point addresses and address search; Postcodes.io serves open postcode and geography datasets.
- Can a retailer use Postcodes.io at checkout?
- It can validate and enrich a postcode, but it cannot populate a complete delivery address. A retailer still needs manual entry or a delivery-address service such as Ideal Postcodes.
- Which address provider does Appycodes actually run in production?
- Across our UK client work the premises-level lookups in production run on Loqate, with Google Places on two enquiry forms and a free-tier lookup on one quote wizard. We have not shipped Postcodes.io or Ideal Postcodes to production. The one Postcodes.io evaluation was rejected because the workflow needed a list of properties.
- Should an address API key be exposed in browser code?
- Only if the provider explicitly supports a browser key restricted to approved origins. Server-side proxying gives tighter control over secrets, quotas, logging and provider changes.
Primary sources
- Postcodes.io API documentation
- Postcodes.io source and data overview
- Postcodes.io licence summary
- Ideal Postcodes API reference
- Ideal Postcodes OpenAPI overview
- Ideal Postcodes postcode-lookup configuration
- ONS guidance on postcode directories
- GOV.UK Design System address pattern
Technical and operational guidance, not legal or licensing advice. Confirm data licensing and retention for your deployment.
UK topic cluster
Company data & identity
UK registry, identity, charity and postcode implementation guidance.
Related guide
Companies House API for onboarding
Resolve the right legal entity and keep registry data in its proper role.
Case study
UK home-cover conversion funnel
The postcode-qualified lead journey and CRM hand-off in production.














































