Skip to content
Documentation menu
docs / api / get-geocode-suggest
Geocoding and search

GET/geocode/suggest

Access and price

AuthAn 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.
PriceFree within the identity's daily search allowance (5,000 a UTC day on the hosted gateway), then 1 call per request. Class: standard. Published as unit_rules.geocode_suggest in /pricing.json.

What it does

Search-as-you-type suggestions. What it costs: the first 5,000 suggest requests per UTC day are free, counted across every key on the calling identity rather than per key, and every suggest beyond that bills one Standard call. GET /geocode/retrieve and GET /geocode always bill one Standard call each and are never discounted, so a client that plots straight from a suggestion's lat/lon pays nothing for search at ordinary volumes. The allowance is for this endpoint alone: unused suggest calls expire at midnight UTC and never become included volume for anything else. Keys on an unverified (provisional) identity are outside the allowance and bill per call. UK postcodes: when the whole query is a British postcode, the postcode leads the list. A full unit (BN14 7RY, BN147RY, bn14 7ry) comes first whenever the index or the forward geocoder knows that exact unit, followed by places inside it and then other units of its sector; when no source knows it, the nearest units of its sector are listed and no position is invented. A bare outward code (BN14) leads with its district, and an outward code with the start of an inward code (BN14 7, BN14 7R) leads with the units of that sector, nearest the bias or the district centre first. A postcode row that no index document holds carries a reserved id starting ukpc: (for example ukpc:BN147RY or ukpc:BN14), which GET /geocode/retrieve resolves like any other id. Irish Eircodes and Dutch postcodes: an Eircode (D02 X285, d02x285) or a Dutch postcode (1012 JS, 1012JS, with or without a place name after it) leads the list when a source knows it, and a Dutch postcode with a house number (1012 JS 1, 1012JS 1) leads with that address. The response then carries a postcode object whose match says exact, area or none. Full Eircodes are held in a licensed database this service does not use, so an Eircode is found exactly only where OpenStreetMap carries it; otherwise its routing area leads (D02, Dublin 2, from GeoNames, CC BY 4.0) and match is area, and a code whose routing key does not exist is reported as none. Ids iepc: (iepc:D02X285, iepc:D02) and nlpc: (nlpc:1012JS) are reserved for these rows. House numbers: when the whole query is a house number and a street with a place after a comma (10 rue de Rivoli, Paris), or with a bias within 10 km, and no indexed address is exactly that, the forward geocoder's exact match leads the list under a reserved photon: id (for example photon:n703432291@48.8554814,2.3604077), which GET /geocode/retrieve resolves.

Call it

bash
curl -fsS -X GET "https://api.mapmap.ai/geocode/suggest?q=…" \
  -H "Authorization: Bearer $MAPMAP_KEY"

Parameters

NameInTypeRequiredDescription
qquerystringyesPartial query, as typed. 1–256 characters. The trailing token is treated as a prefix (Downing Str reaches Downing Street); every earlier token must be a completed word. The index's minimum edge gram is two characters, so a one-character q does not prefix-match: it returns only exact single-character matches (a place whose name is that character), often none, and an empty list is an ordinary answer rather than an error
limitqueryintegernoMaximum suggestions, 1–10 (default 5) Limits: at least 0.
biasquerystringnoLocation bias as lon,lat (WGS84): the map centre for a search box. Reorders candidates towards the point; it never excludes one
zoomqueryintegernoMap zoom (0–20) scaling the bias, exactly as on GET /geocode: zoomed in favours nearby results, zoomed out favours prominence. Only meaningful with bias Limits: at least 0.
bboxquerystringnoHard bounding-box filter as minLon,minLat,maxLon,maxLat (WGS84, GeoJSON axis order). Unlike bias this excludes anything outside the box outright
langquerystringnoResult language. Accepted for symmetry with GET /geocode; the first-party index that serves this endpoint stores one name per document plus its alternatives, so the value does not currently change the answer

Responses

200Suggestions, best first. Each carries lat/lon: a suggestion is immediately plottable and cacheable, and picking one costs a retrieve only when the caller wants the full feature. (Mapbox's equivalent withholds coordinates from suggestions so that every pick must be followed by a retrieve; that is a billing shape, not a technical constraint, and it is not ours.)
FieldTypeRequiredDescription
postcodeSuggestPostcodeno
suggestionsSuggestion[]yesSuggestions, best first. Empty is an ordinary answer, not an error. A one-character query cannot prefix-match the index's two-character minimum edge gram, so it returns only exact single-character matches, often none; a nonsense query matches nothing.

Example: A response assembled from this schema's own field examples, enums, defaults and types; not a recorded call

json
{
  "suggestions": [
    {
      "context": "string",
      "id": "string",
      "kind": "string",
      "lat": 0,
      "lon": 0,
      "name": "string"
    }
  ]
}
400Missing or over-long q, or a malformed limit/bias/bbox

application/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+json

application/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

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 (urn:sn-gateway:problem:suggest-not-enabled; clients feature-detect on this status and fall back to GET /geocode)

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_suggest