- Takes: Name
- Passive: the target is not contacted
Needs address and/or components. Coordinates are not supported in address; use reverse geocoding for those. formatted_address should not be parsed. The response status field reports the outcome.
Query parameters
addressStreet address or plus code
componentsPipe-separated component:value filters; fully restricts results; required when address is omitted
boundsViewport that biases results without restricting them
languageLanguage of results
regionTwo-character ccTLD value that biases results
extra_computationsAdds extra data to the response
Response fields · 10ShowHide
status
OK, ZERO_RESULTS, OVER_QUERY_LIMIT, REQUEST_DENIED, INVALID_REQUEST or UNKNOWN_ERROR
error_message
Present on some non-OK responses
formatted_address
Human-readable address
address_components[]
Parts with long_name, short_name and types
lat
Latitude
lng
Longitude
location_type
Precision of the result
place_id
Place ID usable with other Google APIs
types[]
Feature types
partial_match
Present for partial matches
curl 'https://maps.googleapis.com/maps/api/geocode/json?key=YOUR_API_KEY'{
"status": "OK",
"results": [
{
"formatted_address": "1 Example Street, Springfield, USA",
"geometry": {
"location": {
"lat": 37,
"lng": -95
},
"location_type": "ROOFTOP"
},
"place_id": "EXAMPLE_PLACE_ID",
"types": [
"street_address"
]
}
]
}