My place in the WordPress community
- I have had a wordpress.org account since 2006.
- I contributed to WordPress core for versions 7.0 and 7.1.
- I maintain 30 plugins on wordpress.org.
- I organise and speak at WordCamps.
- I have attended every WordCamp Europe from 2017 to 2026.
A French checkout asks for the same few fields every time: street, number, postcode, town. Typing them wrongly costs a failed delivery later. I am Mariusz Szatkowski, a Gdynia developer, and I run this kind of work by email and shared documents. This page is about one narrow job for a Bordeaux shop: address autocomplete and validation in a Next.js checkout with the public Base Adresse Nationale (BAN) geocoder.

Place de la Bourse on the Garonne quay in Bordeaux, a June 2009 picture by Coyau released under CC BY-SA 3.0 on Wikimedia Commons.
What is the Base Adresse Nationale?
The BAN site calls itself “le site national de l’adresse”, a free public service that lists all addresses of the territory and makes them usable by anyone. Its partner logos show the environment ministry, the IGN and the ANCT. The site states that its content is offered under licence etalab-2.0, which links to the Licence Ouverte.
For developers the geocoder matters more than the site. According to the cartes.gouv.fr geocoding guide, the Géoplateforme geocoder has three indexes:
address: postal addresses from the BAN, refreshed weeklypoi: named places from BD TOPO, refreshed quarterlyparcel: cadastral parcels, refreshed quarterly
A checkout needs only the first one.
Which base URL replaces api-adresse.data.gouv.fr?
The adresse.data.gouv.fr documentation page says the api-adresse.data.gouv.fr URL would be decommissioned at the end of January 2026. The geocoder is documented at https://data.geopf.fr/geocodage/, with /search for direct geocoding and /reverse for coordinates to address. The parameters are in the OpenAPI file, which also names Licence ouverte 2.0 as the licence of the API description.
If an old plugin or snippet still calls the former host, that is the first thing to check in a Bordeaux shop built a few years ago.
Which parameters give checkout autocomplete?
The OpenAPI file lists these parameters for /search:
| Parameter | Meaning in the file |
|---|---|
q | text describing the location, for example a street and town |
autocomplete | search in autocomplete mode, which is the default |
index | address, parcel or poi, several allowed with commas |
limit | default 10, never more than 50 |
postcode, citycode, depcode | filters for the address index, with several values allowed |
type | housenumber, street, locality or municipality |
For a delivery form, index=address and type=housenumber mean the customer picks a full street address, not a street or a town. A postcode filter helps when the shop delivers only inside the Gironde, but filter only if the shop really restricts delivery.
A test request on 4 December 2026 for a street address in Bordeaux returned a GeoJSON FeatureCollection. Each feature carried label (the full address line), banId, postcode, city, citycode, street, housenumber, context and a score. In that response x and y held projected metre values, while geometry.coordinates held longitude and latitude. Read the geometry for a map pin.
What does the score tell me?
Little, on its own. The OpenAPI file declares score as a number and gives 0.65 as the example for a street address in Paris. It sets no threshold for a good match. I would not hardcode one from a guess: collect a few hundred addresses from real orders, run them through the geocoder, and look at where wrong matches start. Then show the top suggestions and let the customer choose, instead of auto-accepting the first hit.
Should the browser or the server call the API?
The guide limits use to 50 requests per second from the same IP address, and the adresse.data.gouv.fr page adds that an over-limit call gets HTTP 429 with a retry-after header, and the block lasts 5 seconds. The consequence for architecture is plain:
- calls from the customer’s browser count against the customer’s IP, so a busy shop never reaches the limit together
- calls from your Next.js server count against one IP for all customers at once
A server route handler still has good reasons: it validates input, it caps the number of suggestions, it keeps the upstream URL in one place, and it can answer 503 with a short wait when the geocoder says 429. The limit makes it a choice to make deliberately for a shop with campaign spikes.
// app/api/address/route.ts
import type { NextRequest } from 'next/server'
export async function GET(request: NextRequest) {
const q = request.nextUrl.searchParams.get('q')?.trim() ?? ''
if (q.length < 3) return Response.json({ suggestions: [] })
const url = new URL('https://data.geopf.fr/geocodage/search')
url.searchParams.set('q', q)
url.searchParams.set('index', 'address')
url.searchParams.set('type', 'housenumber')
url.searchParams.set('limit', '5')
const res = await fetch(url)
if (res.status === 429) {
return new Response(null, { status: 503, headers: { 'Retry-After': '5' } })
}
if (!res.ok) return new Response(null, { status: 502 })
const data = await res.json()
return Response.json({
suggestions: data.features.map((f: any) => ({
banId: f.properties.banId,
label: f.properties.label,
street: `${f.properties.housenumber} ${f.properties.street}`,
postcode: f.properties.postcode,
city: f.properties.city,
citycode: f.properties.citycode,
})),
})
}The Next.js route handler reference documents request.nextUrl.searchParams for reading the query. In the input component, wait a moment after the last keystroke before calling the route, so a typing customer does not produce one request per letter.
How is the posted French address checked?
Autocomplete helps the customer, but the order still arrives as a form post, and any field can be edited by hand. The Next.js forms guide recommends server-side validation with a schema library such as Zod, with useActionState for returning errors and its pending flag for the button.
For an address, a sound pattern is:
- store
banIdandcitycodenext to the text fields when the customer picks a suggestion - in the Server Action, check that the postcode is five digits and that the fields are not empty
- if a
banIdis present, accept the address as picked; if the customer typed everything by hand, keep it, but flag it for a human to look at before shipping
Do not block a customer whose address the BAN does not know. New streets, hamlets and building names appear in the real world before they appear in any register. A hard block loses the order. A flag costs a minute.
What happens when the geocoder is unreachable?
The form must still work. If the route handler gets a 429, a 5xx or a timeout, the component should fall back to plain input fields and say nothing alarming. Autocomplete is a convenience layer on a form that already works without it. In Next.js that means the form’s action does not depend on the suggestions route in any way.
What do I keep out of the checkout?
- an address typed into a search box is personal data in transit to a public service, so the shop’s privacy notice should name the geocoder
- the route handler should not log full queries
- store the address only as the order needs it; the licence allows reuse of BAN content, but your own database of customer addresses is a separate matter under data protection law
I am not a lawyer, so the privacy text stays with the shop’s own adviser.
How does a project run?
Work runs by email. You send the checkout stack (Shopify, WooCommerce or custom), the delivery countries and the carrier’s address rules. I send back a written estimate, then a pull request with the route handler, the form component and tests for the failure paths. See the Next.js developer offer for the general scope.
Send me your checkout
Send the checkout stack, the delivery area and the current address form through the contact form. The first written estimate for the address autocomplete is free, and I reply with the route handler design and the failure cases I would test.
Selected projects
Examples of my work.
E-commerce Development: car-mechanic-huntington.co.uk
The website project car-mechanic-huntington.co.uk was created with the aim of professionally presenting the services of a car workshop. The primary goal of t...
E-commerce Development: centrumpoludnie.pl
centrumpoludnie.pl is an information portal for a shopping centre in southern Gdansk, covering shops, promotions, news, and simple administration.
E-commerce Development: dkf.za.pl
DKF.za.pl is a website created in 2010 for the Film Discussion Club “ZA”, operating as part of the Polish Federation of Film Discussion Clubs. The project wa...
WordPress support & development in Bordeaux
Need this service: Next.js developer in Bordeaux?
Describe your project by e-mail. I reply within 24 hours.
Describe your projectExplore other WordPress services and knowledge base
Migration to Astro, Next.js, and headless WordPress.
WooCommerce sync with ERP and wholesale systems.
Business process automation around WordPress and company systems.
Library of concrete automation use cases.
Headless WordPress, Sanity, Strapi, and Contentful with Astro or Next.js.
Astro, MDX, edge delivery, and Core Web Vitals measured on real traffic.
Custom WordPress engineering and architecture.
Scalable headless, ERP, and AI architecture for enterprise.
Related categories
Supporting articles

Six to sixteen weeks for typical engagements, with a four-phase shape: discovery, scoping, build and cutover, tuning. The variables are catalogue size, integration count, URL preservation, and editorial team readiness, not framework choice.

A definitive 4-year Total Cost of Ownership (TCO) analysis, real-world Core Web Vitals benchmarks, Astro 7 GraphQL APQ architecture, and a 10-point executive decision matrix for choosing between decoupled and traditional WordPress.

The Shopify Plus vs WooCommerce headless decision in 2026 is no longer a binary "platform vs custom" trade-off. Both can run headless, both integrate AI, both ship at the edge. The real axes are control, total cost over five years, and exit strategy. This article walks the matrix with confirmed platform facts.