To migrate from Ideal Postcodes to AutoPostcode, replace the API request and address mapping, then test your form and rollback path before switching customers. AutoPostcode returns a list of matches for a full postcode.
What do you need before you start?
Create an AutoPostcode account and a website API key, then check the pricing and API quickstart. Keep your key on a server you control and do not commit it to source control.
1. Audit the current integration
Find Ideal Postcodes scripts, endpoints, key locations and field mappings; identify checkout and back-office workflows that rely on them.
2. Test an AutoPostcode request
Set the key in your server environment and use this Node.js example to call the postcode endpoint.
// Server-side Node.js (set AUTOPOSTCODE_API_KEY in the environment)
const postcode = "SW1A 1AA";
const url = new URL("https://autopostcode.com/api/public/lookup");
url.searchParams.set("postcode", postcode);
const response = await fetch(url, {
headers: { "x-api-key": process.env.AUTOPOSTCODE_API_KEY }
});
if (!response.ok) throw new Error(`Lookup failed: ${response.status}`);
const addresses = await response.json();
console.log(addresses.map(({ line1, line2, town, postcode }) =>
({ line1, line2, town, postcode })));
3. Adapt address selection
Map returned address fields to your forms and preserve the customer’s choice. Test flats, organisations and empty or unmatched postcodes rather than assuming the two providers use identical fields.
4. Roll out and monitor
Compare representative results, test 401, 402, 404 and timeouts, then enable the replacement gradually with a rollback plan.
What should you check before switching over?
Use the API documentation and REST API reference for response fields and errors. Explore the postcode lookup API and address autocomplete API for the right search experience.
Frequently asked questions
Does this require an AutoPostcode API key?
Yes. Create a website key in the AutoPostcode dashboard and keep it on your server.
Can I test a full postcode before building the interface?
Yes. Send an authenticated GET to /api/public/lookup with the postcode parameter; successful responses contain an array of addresses.
What happens when no address is found?
The postcode lookup endpoint returns 404 when it finds no addresses. Show a clear message and allow manual entry.
Should the key be included in browser JavaScript?
No. Keep the key on your server and protect any endpoint that makes requests on the visitor’s behalf.
Can I reuse the previous provider’s response mapping unchanged?
Do not assume so. Compare each address field and test flats, business names and empty values before switching.
How should errors be handled?
Handle invalid input, authentication failures, insufficient credit, no matches and timeouts; provide a manual-entry fallback.
We'll beat any like-for-like UK address lookup price
Send us your current quote or invoice and we'll come back the same working day with a better price — plus free migration and integration support.
- Beat any like-for-like UK quote, monthly or annual
- Free migration + hands-on integration support
- No setup fees, no lock-in, cancel any time
Ready to get started?
Add Royal Mail PAF-verified UK address lookup to your site in minutes — start free, no card required.
