API reference
Reverse geocode
GET /address_whisper/geocode
Returns the addresses closest to a given lon/lat, ordered by ascending
distance. Useful for "use my location" flows and map pins.
Parameters are sent in the request body
Unlike the other endpoints, geocode reads country, lon and lat from a
JSON request body, while apiKey stays in the query string. Make sure your
HTTP client sends a body on a GET request (most do).
Parameters
Query
| Parameter | Type | Required | Description |
|---|---|---|---|
apiKey | string | yes | Your API key. |
Body (JSON)
| Field | Type | Required | Description |
|---|---|---|---|
country | string | yes | ISO 3166-1 alpha-2 country code. |
lon | number | yes | WGS-84 longitude of the point. |
lat | number | yes | WGS-84 latitude of the point. |
Request
cURL
Code(bash)
JavaScript
Code(js)
Response
200 OK — a JSON-encoded string containing an array of up to 10 nearest
addresses, sorted by distance (metres) ascending.
Code(json)
| Field | Type | Description |
|---|---|---|
street | string | Aggregated street incl. number. |
city | string | Aggregated city. |
postcode | string | Postal code. |
country | string | ISO 3166-1 alpha-2 country code. |
lon | number | WGS-84 longitude. |
lat | number | WGS-84 latitude. |
value | string | Display-ready address string. |
distance | number | Distance from the query point, in metres. |
Last modified on
