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/reverse
import { 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.

FieldTypeDescription
latnumberLatitude from -90 to 90. Required query parameter.
lonnumberLongitude 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.

StatusCodeWhen
400invalid_requestA required field is missing or has the wrong type.
404not_foundNo country or area at this point.
503upstream_unavailableThe boundary data is not loaded.
401unauthorizedThe bearer token is missing or not recognized.

We value your privacy

We use necessary cookies to run this website. With your consent, we would also like to use analytics and marketing cookies. Read our cookie policy.