Look up the boundaries containing a coordinate
lookup_locationReverse geocode coordinates to country, region, and municipality with ISO codes, and check if a point falls inside your uploaded boundary sets.
Instructions
Reverse geocode a coordinate to the administrative areas that contain it — country, region (state or province) and municipality — as names plus ISO 3166 codes, and match it against boundary sets the account has uploaded, in the same call.
Use for: which country, region or municipality a point is in; geofence checks against your own polygons; tagging data with region codes. Do NOT use for: street addresses or postcodes (this is not forward geocoding, and results stop at the municipality), routing, distances, or fetching boundary geometry.
Caveats worth repeating to the user: municipal is the finest unit AVAILABLE, not a consistent kind of thing — Los Angeles returns a city, rural Kansas returns a county, so do not assume it names a city. A layer that matched nothing comes back null. The errors array is always present: a boundary set that is unavailable or not granted to this key is skipped and reported there, while the call itself still succeeds.
One call is one billed lookup however many layers, sets or grid codes it touches, and a call that matches nothing still bills.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lat | Yes | Latitude, -90 to 90. | |
| lng | Yes | Longitude, -180 to 180. | |
| base | No | Which reference layers to resolve. Defaults to all three. | |
| sets | No | Names of the boundary sets on this account to match against. Defaults to none. | |
| h3res | No | H3 resolution 0-15. 9 is about 400 m across. | |
| encode | No | Also return the point as an H3 cell index and/or Google Plus Code. Output only — neither can be used AS a location, because both name areas rather than points. | |
| pluslen | No | Plus Code length. 9 is not a valid length. 10 is about 14 m. |