Docs / Location
Reverse geocode
Returns the country and first-level division for a coordinate. Turkey also returns the district. There is no street, city, or postal code.
GET
/v1/reverseimport { Client } from "@liveapiio/liveapi";
const client = new Client({ token: process.env.LIVEAPI_TOKEN });
const area = await client.reverseGeocode(41.0082, 28.9784);Request
Send Authorization: Bearer YOUR_TOKEN. The token stays on your server. Each library reads it from the environment and calls this endpoint for you.
| Field | Type | Description |
|---|---|---|
| lat | number | Latitude from -90 to 90. Required query parameter. |
| lon | number | Longitude from -180 to 180. Required query parameter. |
Response
A 200 response uses one call. A point at sea returns 404. Borders are generalized, so a point within about a kilometre of a border can resolve to the neighbour.
Errors
A failed request returns { "error": { "code", "message" } } and does not use a call.
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | A required field is missing or has the wrong type. |
| 404 | not_found | No country or area at this point. |
| 503 | upstream_unavailable | The boundary data is not loaded. |
| 401 | unauthorized | The bearer token is missing or not recognized. |