Skip to main content
GET
Resolve a coordinate to a country

Authorizations

X-API-Key
string
header
required

Query Parameters

lat
number
required

Latitude in decimal degrees, WGS 84 / EPSG:4326.

Required range: -90 <= x <= 90
lon
number
required

Longitude in decimal degrees, WGS 84 / EPSG:4326.

Required range: -180 <= x <= 180

Response

OK

method
string
required

How the answer was reached: polygon (the point is inside a country), nearest_polygon (the point is at sea and was attributed to land within distance_km) or none.

flagged
boolean
required

True when a human should look at this answer first: a micro-state, or a contested border region where the dataset's editorial choice is one of several defensible ones. When you also hold a source label for the row, prefer the label for a flagged answer rather than asserting country_derived.

country
string<iso3166-alpha2> | null

ISO 3166-1 alpha-2 country code (US, CA, GB). Case-insensitive on input and normalized to upper case; unassigned codes are rejected with a 422.

Required string length: 2
Pattern: ^[A-Za-z]{2}$
country_name
string
default:""

Natural Earth's name for the matched feature; empty when country is null.

reason
string
default:""

Why the answer is flagged or unresolved; empty otherwise.

distance_km
number | null

Distance to the attributed land in kilometres. Set only for nearest_polygon.