Geocode a text query into geographic coordinates. This endpoint resolves a location name, address, or place description into precise latitude and longitude values, which can then be used with other endpoints like Search Nearby.
HTTP Request
| |
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
query | string | Yes | — | The location query to geocode (e.g., “New York City”, “1600 Amphitheatre Parkway”) |
language | string | No | "en" | Language code for the response |
country | string | No | "us" | Country code for regional bias |
lat | number | No | — | Latitude hint to bias results toward a specific area |
lng | number | No | — | Longitude hint to bias results toward a specific area |
zoom | integer | No | 7 | Map zoom level (3-21). Higher values give more precise local results |
Response
| |
Response Fields
| Field | Type | Description |
|---|---|---|
status | boolean | true when the request succeeded |
request_id | string | Unique identifier for this request |
location | object | The resolved location. There is no data array on this endpoint |
location.id | string/null | Internal location identifier, often null |
location.name | string/null | Resolved location name, often null |
location.altitude | number | Viewport altitude in metres, derived from zoom |
location.latitude | number | Latitude of the resolved location |
location.longitude | number | Longitude of the resolved location |
location.zoom | integer | Zoom level the coordinates correspond to |
Notes
- This endpoint only geocodes. It returns no businesses. To geocode and search in one call, use Locate and Search .
- A query that resolves to nothing still returns
status: true, with thelocationfields set tonull. Checklocation.latitudebefore using the result.
Code Examples
| |
| |
| |
Related Endpoints
- Search Nearby — Search for businesses using the coordinates returned by this endpoint
- Locate and Search — Combine geocoding and business search in a single call