Documentation menu
Geocoding and search
GET/geocode/retrieve
Access and price
| Auth | An API key, as Authorization: Bearer snk_… or ?api_key=snk_…, or none on the keyless demo lane: a per-IP rate limit and daily cap, never metered. Truck and ADR parameters always need a key (401 demo-premium-requires-key). A browser (maps) key may call it. |
|---|---|
| Price | 1 call per request. Class: standard. Published as unit_rules.default in /pricing.json. |
What it does
GET /geocode/retrieve?id=<document id>.
Call it
bash
curl -fsS -X GET "https://api.mapmap.ai/geocode/retrieve?id=…" \
-H "Authorization: Bearer $MAPMAP_KEY"Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| id | query | string | yes | A document id, exactly as GET /geocode/suggest or GET /geocode reported it. Matched verbatim (no folding, trimming or case change), so an edited id is a 404, never a near-miss served as though it were the real thing. Ids starting ukpc: are reserved for UK postcodes that GET /geocode/suggest lists without an index document: ukpc: then the postcode in capitals with no space (ukpc:BN147RY for a unit, ukpc:BN14 for a district). A district resolves to its centre; a unit resolves to the index document for that postcode when there is one, otherwise to the forward geocoder's position for it. Ids starting iepc: (an Eircode, or an Eircode routing area such as iepc:D02) and nlpc: (a Dutch postcode) work the same way, and an id starting photon: names an addressed OpenStreetMap element and where it stands (photon:n703432291@48.8554814,2.3604077), resolved from the forward geocoder |
Responses
200A Photon-compatible GeoJSON FeatureCollection carrying exactly one feature: the same shape, and the same property set, that
GET /geocode returns for this document| Field | Type | Required | Description |
|---|---|---|---|
| features | object[] | no | Matches, best first: a Point geometry and properties with
name, address parts, country, countrycode, the OSM osm_type,
osm_id, osm_key and osm_value, and where known
categories and details. |
| type | string | no | Always FeatureCollection. |
Example: Recorded from the hosted gateway on 2026-11-05, keyless: GET /geocode/retrieve?id=osm:r2855217
json
{
"features": [
{
"geometry": {
"coordinates": [
-55.636108943394255,
49.5488657270159
],
"type": "Point"
},
"properties": {
"categories": [
"town"
],
"context_names": [
"Triton",
"Pilley's Island"
],
"country": "Canada",
"countrycode": "CA",
"id": "osm:r2855217",
"name": "Brighton",
"type": "town"
},
"type": "Feature"
}
],
"type": "FeatureCollection"
}400Missing or over-long
idapplication/problem+json · Problem
401Missing or invalid API key. Also: A malformed, unknown, revoked or expired key (
unauthorized); or a keyless call on the demo lane that engaged truck or ADR parameters (demo-premium-requires-key)application/problem+json · Problem
402Beyond the included volume with no way to pay this call: an x402 body naming how to pay (provisional key past its allowance, prepaid balance below the price, or a rejected
X-PAYMENT). Not problem+jsonapplication/json · X402PaymentRequired
403The key may not call this: a browser key outside its scope (
scope-insufficient), a request from an origin the key does not allow (origin-not-allowed), or an account restriction (forbidden)application/problem+json · Problem
404No document carries that id: it was never issued, or the index has been rebuilt since it was. For a
ukpc:, iepc:, nlpc: or photon: id, no source knows that postcode or address any more. The body's detail says to search again and re-pickapplication/problem+json · Problem
429Quota or rate limit exceeded. Also: Per-key rate limit (
rate-limited, with Retry-After); monthly quota with no payment path (quota-exceeded); or, keyless, the demo lane's per-IP rate (rate-limited) or daily cap (demo-daily-exceeded)application/problem+json · Problem
501This deployment has no first-party geocode index, or its index predates the document-id field (
urn:sn-gateway:problem:suggest-not-enabled). Reserved ukpc: postcode ids are resolved either wayapplication/problem+json · Problem
502A reserved id needed the forward geocoder and the request to it failed
application/problem+json · Problem
504The request did not finish within the gateway's request deadline (
request-timeout)application/problem+json · Problem
Error bodies follow the shared problem model documented on API conventions.
Also under Geocoding and search
Generated from https://api.mapmap.ai/openapi.json on 2026-11-12 · operationId get_geocode_retrieve