BYTETOOLS

API Géo (France)

Free French administrative geography API with no key: look up communes by postcode, name or coordinates, plus departments, regions and EPCI. Tested example and live response.

No API key requiredCORS enabledHTTPSFree tier

Endpoint tested and returned HTTP 200 on 2026-08-21

What is the API Géo (France)?

API Géo is the French government's free, key-free API for administrative geography. It resolves communes by postcode, name, INSEE code or coordinates, and exposes the departments, regions and intercommunal groupings above them, with population figures and centroids attached.

France runs two separate open geography services and confusing them wastes a lot of time. API Adresse geocodes street addresses; API Géo answers the different question of which administrative unit a place belongs to. If you need to know that postcode 44380 is the commune of Pornichet, INSEE code 44132, in Loire-Atlantique, this is the endpoint — and it will not help you find a house number.

The `fields` parameter is the feature worth learning first. By default a commune comes back thin, but naming fields explicitly pulls in population, the centroid, the bounding box, the parent department and region, and the full list of postcodes attached to that commune. That last one matters more than it sounds: the relationship between postcodes and communes is many-to-many in France, so a single postcode can cover several communes and a single commune can hold several postcodes.

Quick facts

Base URL
https://geo.api.gouv.fr
Authentication
No API key and no account. French open government data published under the Licence Ouverte, so commercial use is permitted.
Rate limit
No published per-IP quota. The service asks that bulk consumers download the underlying dataset rather than iterate over the API.
Pricing
Free, including commercial use.
CORS
Enabled — callable directly from browser JavaScript
Official docs
Read the docs

How to use the API Géo (France)

Every request below was executed against the live API on 2026-08-21, and the response shown is the real body it returned — not an illustration.

1. Find the commune behind a French postcode

GET https://geo.api.gouv.fr/communes?codePostal=44380&fields=nom,code,codesPostaux,population,centre,departement

curl
curl 'https://geo.api.gouv.fr/communes?codePostal=44380&fields=nom,code,codesPostaux,population,centre,departement'
JavaScript (fetch)
const res = await fetch("https://geo.api.gouv.fr/communes?codePostal=44380&fields=nom,code,codesPostaux,population,centre,departement");
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const data = await res.json();
console.log(data);
Python (requests)
import requests

res = requests.get("https://geo.api.gouv.fr/communes?codePostal=44380&fields=nom,code,codesPostaux,population,centre,departement", timeout=20)
res.raise_for_status()
print(res.json())
Response — HTTP 200
[
  {
    "nom": "Pornichet",
    "code": "44132",
    "codesPostaux": [
      "44380"
    ],
    "population": 12800,
    "centre": {
      "type": "Point",
      "coordinates": [
        -2.3225,
        47.2599
      ]
    },
    "departement": {
      "code": "44",
      "nom": "Loire-Atlantique"
    }
  }
]

Parameters

ParameterTypeRequiredDescription
codePostalqueryOptionalFive-digit French postcode. Returns every commune that shares it. 44380
nomqueryOptionalCommune name, fuzzy-matched. Combine with `codeDepartement` when a name is common. Pornichet
codequeryOptionalINSEE commune code, which is the stable administrative identifier — postcodes are not. 44132
lat / lonqueryOptionalCoordinates. Returns the commune whose boundary contains the point. 47.2599
fieldsqueryOptionalComma-separated list of fields to include. Without it the response is minimal. nom,code,population,centre,departement
formatqueryOptional`json` by default; `geojson` returns a FeatureCollection instead. geojson
boostqueryOptionalBias name search towards `population`, which usually surfaces the town people meant. population

Response fields

nomstring
Official commune name, correctly accented.
codestring
INSEE commune code — five characters, sometimes containing a letter (Corsica), so never parse it as an integer.
codesPostauxarray
Every postcode attached to this commune. Frequently more than one.
populationinteger
Legal population from the most recent INSEE census round.
centreobject
GeoJSON Point for the commune centre. Coordinates are [longitude, latitude], the reverse of how the pair is usually spoken.
departementobject
Parent department as `code` and `nom`. Only present if you asked for it in `fields`.
regionobject
Parent region, likewise opt-in via `fields`.

What you can build with the API Géo (France)

  • Turn a postcode entered on a form into a canonical commune and INSEE code
  • Build a cascading region → department → commune selector
  • Attach population figures to French sales or delivery territories
  • Resolve GPS coordinates to the administrative unit responsible for an area
  • Validate that a commune name and postcode pair actually belong together

Common errors and how to fix them

Empty array, HTTP 200

The postcode or name matched nothing.

Fix: This is not an error status — check for an empty array explicitly. Misspelled commune names and postcodes belonging to CEDEX ranges both produce it.

Fields you asked for are missing

They were not listed in `fields`.

Fix: The API returns only what you name. Add `population`, `centre`, `departement` or `region` to the `fields` parameter rather than expecting defaults.

One postcode returns several communes

Not an error — French postcodes routinely span multiple communes.

Fix: Treat the response as a list and disambiguate by name or population rather than taking the first element.

400 on an unknown field name

A value in `fields` is not recognised.

Fix: Field names are lowercase and unaccented, for example `codeDepartement` rather than `codedepartement` or `département`.

API Géo (France) — frequently asked questions

Is API Géo free to use?

Yes, completely free with no key or registration. It publishes French open government data under the Licence Ouverte, which permits commercial use as long as the source is credited.

What is the difference between API Géo and API Adresse?

API Adresse geocodes street addresses down to a house number; API Géo works one level up, mapping postcodes, names and coordinates onto communes, departments and regions. Use API Adresse to find where a building is, and API Géo to find which administrative unit governs it.

Why does one postcode return several communes?

Because French postcodes were designed for postal routing, not administration, and the two do not line up. A rural postcode often covers several small communes, so always handle the response as a list.

Can I search communes by coordinates?

Yes. Passing `lat` and `lon` returns the commune whose boundary contains that point, which is a genuine point-in-polygon lookup rather than a nearest-centroid guess.

Tools that pair with this API

API Géo (France) is an independent third-party service and is not affiliated with ByteTools or ByteVancer. Details on this page were verified on 2026-08-21; always check the official documentation before relying on this API in production, as terms and limits can change.