Look up the boundaries containing a coordinate
lookup_locationReverse geocode a coordinate to get its country, region, municipality, ISO 3166 codes, optional nearest street, and matches against custom boundary sets for geofence checks.
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, optionally the nearest street, and matches from boundary sets the account has uploaded: all in one call.
Use for: which country, region or municipality a point is in; which street a point is on (add "street" to base); geofence checks against your own polygons; tagging data with region codes. Do NOT use for: forward geocoding or place search (an address to a coordinate), 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.
STREETS (opt-in via base, worldwide). base.street is ALWAYS three answers, for 5 m, 20 m and unlimited in that order, each with radiusMeters, streetNumber, streetName, postcode and distanceMeters. A numbered address within the radius wins over a nearer street (for the unlimited entry the address must still be within 20 m); otherwise the nearest named street; unnamed roads never answer. Two different nulls: base.street === null means there is no street data for the point’s country, while an entry whose fields are null means nothing was within that radius — never report them the same way. streetNumber and postcode are STRINGS (44A, 12-14, 0181), house numbers are rare outside well-mapped areas, and no street geometry is returned.
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 country, region and municipal. "street" is opt-in: add it explicitly to get the nearest street. | |
| 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. |