Skip to content

Postal codes

Resolve a postal code to its places with name, administrative areas and coordinates; found is false when the code is unknown. postcodes-io covers GB full postcodes; geo-api-gouv covers FR and can return several communes for one code. A country outside the selected provider’s coverage is rejected.

Endpoint POST /v1/postal-code-lookups
Scope postal_code:lookup
MCP tool postal_code
Usage units places

Usage units appear in execution.usage.units for reconciliation and billing.

Field Type Required Description
invocation_id string yes The market’s invocation id: one execution per id and operation, so a retry with the same id is rejected instead of charged twice. 1-128 characters of A-Z a-z 0-9 . _ : -.
provider string yes Provider that serves the request; choose by the coverage described for this tool. One of: geo-api-gouv
country string yes ISO 3166-1 alpha-2 country code: GB for postcodes-io, FR for geo-api-gouv.
postal_code string yes Postal code, 2-10 characters of A-Z, 0-9, space or hyphen, for example SW1A 1AA or 75001.
Provider Region Source Limits
geo-api-gouv FR French government geo API, FR timeout_seconds: 30
终端窗口
curl -sS https://services.zgi.im/v1/postal-code-lookups \
-H "Authorization: Bearer $ZGI_SERVICES_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"invocation_id": "docs-1791778521-postal_code", "provider": "geo-api-gouv", "country": "FR", "postal_code": "75001"}'

A real response, with lists cut to two items and long text shortened.

{
"code": 0,
"message": "success",
"data": {
"execution": {
"id": "exe_01a12e52b380780ab60ad66705fd849c",
"invocation_id": "docs-1791778521-postal_code",
"capability": "postal_code",
"operation": "postal_code.lookup",
"provider": "geo-api-gouv",
"outcome": "succeeded",
"error_category": null,
"error_code": null,
"usage": {
"provider_requests": 1,
"units": [
{
"name": "places",
"value": 1,
"source": "measured"
}
]
},
"upstream_ref": null,
"request_id": "req_5de7a4832ee978d041f03e5f",
"started_at": "2026-10-12T04:15:34.272524429Z",
"finished_at": "2026-10-12T04:15:34.952464762Z",
"duration_ms": 679
},
"result": {
"found": true,
"places": [
{
"postal_code": "75001",
"place_name": "Paris",
"admin_area_1": "Île-de-France",
"admin_area_2": "Paris",
"latitude": 48.8589,
"longitude": 2.347,
"country": "FR"
}
],
"source": {
"name": "API Géo (geo.api.gouv.fr): La Poste Base officielle des codes postaux, INSEE Code officiel géographique",
"license": "Licence Ouverte / Open Licence 2.0",
"url": "https://api.gouv.fr/les-api/api-geo"
}
}
}
}