Geocode an address

by Google Maps

googlemap/geocode

Turn an address into coordinates, or coordinates into an address.

Billed per
call
Price
Price: $0.006
Provider
Google Maps
Timeout
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.

FieldTypeRequiredDescription
addressstringNoThe address to locate. Required unless a coordinate pair or place id is given.
latlngstringNoA `lat,lng` pair to look up in reverse.
place_idstringNoA known place identifier to resolve.
componentsstringNoPipe-separated filters such as country or postal code.
regionstringNoTwo-letter region code to bias results toward.
languagestringNoLanguage of the returned address text.

Requests up to 1 MB.

Example

Use your own API key and a saved idempotency key for each new job. Replace image or media placeholders with your own publicly reachable HTTPS URLs. Keep the same key and request body when recovering a timeout.

# Set once per job; reuse this key and the identical body after a timeout.
: "${AGENTSKY_IDEMPOTENCY_KEY:?Set a unique, saved key for this job}"
curl --fail-with-body https://gateway.agentsky.dev/v1/run \
  -H "authorization: Bearer $AGENTSKY_API_KEY" \
  -H "content-type: application/json" \
  -H "Idempotency-Key: $AGENTSKY_IDEMPOTENCY_KEY" \
  -d '{"provider":"googlemap","endpoint":"geocode","input":{"address":"1600 Amphitheatre Parkway, Mountain View, CA","region":"us","language":"en"}}'
# If status is READY/RUNNING, poll GET /v1/runs/{runId} with the same API key.

Pricing

$0.006 per call using your plan when signed in. Read the final customer charge from price.amount.value after the run finishes. A RUNNING response is not the final bill.

Questions