Geocode an address
googlemap/geocodeTurn an address into coordinates, or coordinates into an address.
- call
- $0.01
- Google Maps
- 5 min
Overview
Resolves between written addresses and geographic coordinates in both directions. Given an address it returns matching places with latitude and longitude, a normalised address, the parsed address components, and a stable place identifier. Given a coordinate pair or a place identifier it returns the addresses at or near that point. A bounding box and a region code bias results toward an area without excluding others, and a language code sets the language of the returned address text.
A status and a list of matches, each with a formatted address, its components, coordinates, a viewport, and a place id.
Input
These go in the input object of the run request.
| Field | Type | Required | Description |
|---|---|---|---|
| address | string | No | The address to locate. Required unless a coordinate pair or place id is given. |
| latlng | string | No | A `lat,lng` pair to look up in reverse. |
| place_id | string | No | A known place identifier to resolve. |
| components | string | No | Pipe-separated filters such as country or postal code. |
| region | string | No | Two-letter region code to bias results toward. |
| language | string | No | Language of the returned address text. |
Requests up to 1 MB.
Example
A call that works, with your own key.
curl https://gateway.agentsky.dev/v1/run \
-H "authorization: Bearer $AGENTSKY_API_KEY" \
-H "content-type: application/json" \
-d '{"provider":"googlemap","endpoint":"geocode","input":{"address":"1600 Amphitheatre Parkway, Mountain View, CA","region":"us","language":"en"}}'Pricing
$0.01 per call on the default plan. Every run carries its price in the response.
