Professional Documents
Culture Documents
Overview bookmark_border
What is geocoding?
You can also use the Geocoding API to find the address for a
given place ID (#place-id).
Geocode
chevron_left
1000 km
Map data ©2021 Google, INEGI
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 1/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
This document describes the Geocoding API web service. It is intended for website
and
mobile developers who want to use geocoding data within maps provided by one of the
Google Maps Platform APIs.
Before you start developing with the Geocoding API, review the
authentication requirements
(/maps/documentation/geocoding/get-api-key) (you need
an API key) and the API usage and
billing (/maps/documentation/geocoding/usage-and-billing) information (you need to enable
billing on your project).
https://maps.googleapis.com/maps/api/geocode/outputFormat?parameters
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 2/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
Some parameters are required while some are optional. As is standard in URLs,
parameters
are separated using the ampersand (&) character.
address=24%20Sussex%20Drive%20Ottawa%20ON
Format plus codes as shown here (plus signs are url-escaped to %2B and spaces are
url-escaped to %20):
--OR--
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 3/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
provided.
Each element in the components filter consists of a
component:value pair,
and fully restricts the results
from the geocoder. See more information about
component filtering (#component-filtering) below.
The preferred language has a small influence on the set of results that
the API
chooses to return, and the order in which they are returned.
The geocoder
interprets abbreviations differently depending on
language, such as the
abbreviations for street types, or synonyms that may
be valid in one language
but not in another. For example, utca
and tér are synonyms for street and square
respectively
in Hungarian.
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 4/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
Geocoding responses
https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Pa
+Mountain+View,+CA&key= YOUR_API_KEY
https://maps.googleapis.com/maps/api/geocode/xml?address=1600+Amphitheatre+Pa
+Mountain+View,+CA&key= YOUR_API_KEY
Click the tabs below to see the sample JSON and XML responses.
JSONXML (#xml)
(#json)
{
"results" : [
{
"address_components" : [
{
"long_name" : "1600",
"short_name" : "1600",
"types" : [ "street_number" ]
}, chevron_left
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 5/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
{
"long_name" : "Amphitheatre Pkwy",
"short_name" : "Amphitheatre Pkwy",
"types" : [ "route" ]
},
{
"long_name" : "Mountain View",
"short_name" : "Mountain View",
"types" : [ "locality", "political" ]
},
{
"long_name" : "Santa Clara County",
"short_name" : "Santa Clara County",
"types" : [ "administrative_area_level_2", "political" ]
},
{
"long_name" : "California",
"short_name" : "CA",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "United States",
"short_name" : "US",
"types" : [ "country", "political" ]
},
{
"long_name" : "94043",
"short_name" : "94043",
"types" : [ "postal_code" ]
}
],
"formatted_address" : "1600 Amphitheatre Parkway, Mountain View
"geometry" : {
"location" : {
"lat" : 37.4224764,
"lng" : -122.0842499
},
"location_type" : "ROOFTOP",
"viewport" : {
"northeast" : {
"lat" : 37.4238253802915,
"lng" : -122.0829009197085
},
"southwest" : {
"lat" : 37.4211274197085,
"lng" : -122.0855988802915
}
} chevron_left
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 6/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
},
"place_id" : "ChIJ2eUgeAK6j4ARbn5u_wAGqWA",
"plus_code": {
"compound_code": "CWC8+W5 Mountain View, California, United
"global_code": "849VCWC8+W5"
},
"types" : [ "street_address" ]
}
],
"status" : "OK"
}
Status codes
The "status" field within the Geocoding response object contains the status
of the
request, and may contain debugging information to help you track down why geocoding
is
not working. The "status" field may contain the following values:
"OK" indicates that no errors occurred; the address was successfully parsed and at
least one geocode was returned.
"ZERO_RESULTS" indicates that the geocode was successful but returned no results.
This may occur if the geocoder was passed a non-existent address.
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 7/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
Error messages
When the geocoder returns a status code other than OK, there may be an additional
error_message field within the Geocoding response object. This field contains more
detailed information about the reasons behind the given status code.
Results
When the geocoder returns results, it places them within a (JSON) results
array. Even if
the geocoder returns no results (such as if the address doesn't exist) it still
returns an
empty results array. (XML responses consist of zero or more
<result> elements.)
Often this address is equivalent to the postal address. Note that some
countries, such
as the United Kingdom, do not allow distribution of true
postal addresses due to
licensing restrictions.
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 8/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
The array of address components may contain more components than the
formatted_address.
The array does not necessarily include all the political entities that
contain an
address, apart from those included in the
formatted_address. To retrieve all
the political entities
that contain a specific address, you should use reverse
geocoding, passing
the latitude/longitude of the address as a parameter to the
request.
The format of the response is not guaranteed to remain the same between
requests. In particular, the number of address_components
varies based on the
address requested and can change over time for the
same address. A
component can change position in the array.
The type of the component can
change. A particular component may be
missing in a later response.
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 9/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
"RANGE_INTERPOLATED" indicates
that the returned result reflects an
approximation (usually on a road) interpolated between two precise points
(such as intersections).
Interpolated results are generally returned when
rooftop geocodes are unavailable for a street
address.
plus_code (see
Open Location Code (https://en.wikipedia.org/wiki/Open_Location_Code)
and plus codes (https://plus.codes)) is an encoded
location reference, derived from
latitude and longitude coordinates, that
represents an area: 1/8000th of a degree by
1/8000th of a degree (about 14m x
14m at the equator) or smaller. Plus codes can be
used as a replacement for
street addresses in places where they do not exist (where
buildings are not
numbered or streets are not named).
Typically, both the global code and compound code are returned. However, if
the
chevron_left
result is in a remote location (for example, an ocean or desert) only the
global code
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 10/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
may be returned.
Partial matches most often occur for street addresses that do not exist
within the
locality you pass in the request. Partial matches may also be
returned when a request
matches two or more locations in the same locality.
For example, "21 Henr St, Bristol,
UK" will return a partial match for both
Henry Street and Henrietta Street. Note that if a
request includes a
misspelled address component, the geocoding service may
suggest an alternative
address. Suggestions triggered in this way will also be marked
as a partial
match.
place_id is a unique
identifier that can be used with other Google APIs. For example,
you can
use the place_id in a
Places API
(/maps/documentation/places/web-service/details) request to get
details of a local
business, such as phone number, opening hours, user
reviews, and more. See the
place ID
overview (/maps/documentation/places/web-service/place-id).
The following types are supported and returned by the geocoder in both the
address type
and address component type arrays:
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 11/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
chevron_left
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 12/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
An empty list of types indicates there are no known types for the particular
address
component, for example, Lieu-dit in France.
In addition to the above, address components may include the types listed here. This list is
not exhaustive, and is subject to change.
chevron_left
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 13/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
Viewport biasing
Request:
https://maps.googleapis.com/maps/api/geocode/json?address=Winnetka&key= YOUR_A
Response:
{
"results" : [
{
"address_components" : [
{
"long_name" : "Winnetka",
"short_name" : "Winnetka",
"types" : [ "locality", "political" ]
},
{
"long_name" : "New Trier",
"short_name" : "New Trier",
"types" : [ "administrative_area_level_3", "political" ]
},
{
"long_name" : "Cook County",
"short_name" : "Cook County",
"types" : [ "administrative_area_level_2", "political" ]
},
{
"long_name" : "Illinois",
"short_name" : "IL",
"types" : [ "administrative_area_level_1",
chevron_left "political" ]
},
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 14/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
{
"long_name" : "United States",
"short_name" : "US",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "Winnetka, IL, USA",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 42.1282269,
"lng" : -87.7108162
},
"southwest" : {
"lat" : 42.0886089,
"lng" : -87.7708629
}
},
"location" : {
"lat" : 42.10808340000001,
"lng" : -87.735895
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 42.1282269,
"lng" : -87.7108162
},
"southwest" : {
"lat" : 42.0886089,
"lng" : -87.7708629
}
}
},
"place_id" : "ChIJW8Va5TnED4gRY91Ng47qy3Q",
"types" : [ "locality", "political" ]
}
],
"status" : "OK"
}
Request: chevron_left
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 15/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
https://maps.googleapis.com/maps/api/geocode/json?address=Winnetka&bounds=34.1
-118.604794|34.236144,-118.500938&key= YOUR_API_KEY
Response:
{
"results" : [
{
"address_components" : [
{
"long_name" : "Winnetka",
"short_name" : "Winnetka",
"types" : [ "neighborhood", "political" ]
},
{
"long_name" : "Los Angeles",
"short_name" : "LA",
"types" : [ "locality", "political" ]
},
{
"long_name" : "Los Angeles County",
"short_name" : "Los Angeles County",
"types" : [ "administrative_area_level_2", "political" ]
},
{
"long_name" : "California",
"short_name" : "CA",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "United States",
"short_name" : "US",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "Winnetka, Los Angeles, CA, USA",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 34.2355209,
"lng" : -118.5534191
},
"southwest" : {
chevron_left
"lat" : 34.1854649,
"lng" : -118.588536
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 16/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
}
},
"location" : {
"lat" : 34.2048586,
"lng" : -118.5739621
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 34.2355209,
"lng" : -118.5534191
},
"southwest" : {
"lat" : 34.1854649,
"lng" : -118.588536
}
}
},
"place_id" : "ChIJ0fd4S_KbwoAR2hRDrsr3HmQ",
"types" : [ "neighborhood", "political" ]
}
],
"status" : "OK"
}
Region biasing
Geocoding results can be biased for every domain in which the main
Google Maps
application is officially launched. Note that biasing only
prefers results for a specific
domain; if more relevant results exist
outside of this domain, they may be included.
For example, a geocode for "Toledo" returns this result, as the default
domain for the
Geocoding API is set to the United States. Request:
chevron_left
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 17/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
https://maps.googleapis.com/maps/api/geocode/json?address=Toledo&key= YOUR_API
Response:
{
"results" : [
{
"address_components" : [
{
"long_name" : "Toledo",
"short_name" : "Toledo",
"types" : [ "locality", "political" ]
},
{
"long_name" : "Lucas County",
"short_name" : "Lucas County",
"types" : [ "administrative_area_level_2", "political" ]
},
{
"long_name" : "Ohio",
"short_name" : "OH",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "United States",
"short_name" : "US",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "Toledo, OH, USA",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 41.732844,
"lng" : -83.454229
},
"southwest" : {
"lat" : 41.580266,
"lng" : -83.69423700000002
}
},
"location" : {
"lat" : 41.6639383,
chevron_left
"lng" : -83.55521200000001
},
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 18/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 41.732844,
"lng" : -83.454229
},
"southwest" : {
"lat" : 41.580266,
"lng" : -83.69423700000002
}
}
},
"place_id" : "ChIJeU4e_C2HO4gRRcM6RZ_IPHw",
"types" : [ "locality", "political" ]
}
],
"status" : "OK"
}
https://maps.googleapis.com/maps/api/geocode/json?address=Toledo®ion=es&key
Response:
{
"results" : [
{
"address_components" : [
{
"long_name" : "Toledo",
"short_name" : "Toledo",
"types" : [ "locality", "political" ]
},
{
"long_name" : "Toledo",
"short_name" : "TO",
"types" : [ "administrative_area_level_2", "political" ]
},
{
"long_name" : "Castile-La Mancha",
"short_name" chevron_left
: "CM",
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 19/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
Component filtering
chevron_left
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 20/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
star Note: If you receive unexpected results with a country code, verify
that you are using a code which
includes the countries, dependent territories, and special
areas of geographical interest you
intend. You can find code information at
Wikipedia: List of ISO
3166 country codes
(https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) or the ISO Online Browsing
Platform (https://www.iso.org/obp/ui/#search).
The following components may be used to influence results, but will not be enforced:
Do not repeat these component filters in requests, or the API will return
Invalid_request: country, postal_code,
route
If the request contains repeated component filters, the API evaluates those
filters as
an AND, not an OR.
chevron_left
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 21/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
https://maps.googleapis.com/maps/api/geocode/json?address=high+st+hasting&comp
&key= YOUR_API_KEY
Response:
{
"results" : [
{
"address_components" : [
{
"long_name" : "High Street",
"short_name" : "High St",
"types" : [ "route" ]
},
{
"long_name" : "Hastings",
"short_name" : "Hastings",
"types" : [ "postal_town" ]
},
{
"long_name" : "East Sussex",
"short_name" : "East Sussex",
"types" : [ "administrative_area_level_2", "political" ]
},
{
"long_name" : "England",
"short_name" : "England",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "United Kingdom",
"short_name" : "GB",
"types" : [ "country", "political" ]
},
{
"long_name" : "TN34 3EY",
chevron_left
"short_name" : "TN34 3EY",
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 22/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
"types" : [ "postal_code" ]
}
],
"formatted_address" : "High St, Hastings TN34 3EY, UK",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 50.8601041,
"lng" : 0.5957329
},
"southwest" : {
"lat" : 50.8559061,
"lng" : 0.5906163
}
},
"location" : {
"lat" : 50.85830319999999,
"lng" : 0.5924594
},
"location_type" : "GEOMETRIC_CENTER",
"viewport" : {
"northeast" : {
"lat" : 50.8601041,
"lng" : 0.5957329
},
"southwest" : {
"lat" : 50.8559061,
"lng" : 0.5906163
}
}
},
"partial_match" : true,
"place_id" : "ChIJ-Ws929sa30cRKgsMNVkPyws",
"types" : [ "route" ]
}
],
"status" : "OK"
}
https://maps.googleapis.com/maps/api/geocode/json?components=locality:santa+c
&key= YOUR_API_KEY
chevron_left
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 23/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
Response:
{
"results" : [
{
"address_components" : [
{
"long_name" : "Santa Cruz de Tenerife",
"short_name" : "Santa Cruz de Tenerife",
"types" : [ "locality", "political" ]
},
{
"long_name" : "Santa Cruz de Tenerife",
"short_name" : "TF",
"types" : [ "administrative_area_level_2", "political" ]
},
{
"long_name" : "Canary Islands",
"short_name" : "CN",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "Spain",
"short_name" : "ES",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "Santa Cruz de Tenerife, Spain",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 28.487616,
"lng" : -16.2356646
},
"southwest" : {
"lat" : 28.4280248,
"lng" : -16.3370045
}
},
"location" : {
"lat" : 28.4636296,
"lng" : -16.2518467
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
chevron_left
"lat" : 28.487616,
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 24/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
"lng" : -16.2356646
},
"southwest" : {
"lat" : 28.4280248,
"lng" : -16.3370045
}
}
},
"place_id" : "ChIJcUElzOzMQQwRLuV30nMUEUM",
"types" : [ "locality", "political" ]
}
],
"status" : "OK"
}
https://maps.googleapis.com/maps/api/geocode/json?components=administrative_a
&key= YOUR_API_KEY
Response:
{
"results" : [],
"status" : "ZERO_RESULTS"
}
You can make valid queries without the address parameter, using the
components filter.
(When geocoding a full address,
the address parameter is required if the request contains
the
names and numbers of buildings.) Request:
https://maps.googleapis.com/maps/api/geocode/json?components=route:Annankatu|a
:Helsinki|country:Finland&key= YOUR_API_KEY
Response:
chevron_left
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 25/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
{
"results" : [
{
"address_components" : [
{
"long_name" : "Annankatu",
"short_name" : "Annankatu",
"types" : [ "route" ]
},
{
"long_name" : "Helsinki",
"short_name" : "HKI",
"types" : [ "locality", "political" ]
},
{
"long_name" : "Finland",
"short_name" : "FI",
"types" : [ "country", "political" ]
},
{
"long_name" : "00101",
"short_name" : "00101",
"types" : [ "postal_code" ]
}
],
"formatted_address" : "Annankatu, 00101 Helsinki, Finland",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 60.168997,
"lng" : 24.9433353
},
"southwest" : {
"lat" : 60.16226160000001,
"lng" : 24.9332897
}
},
"location" : {
"lat" : 60.1657808,
"lng" : 24.938451
},
"location_type" : "GEOMETRIC_CENTER",
"viewport" : {
"northeast" : {
"lat" : 60.168997,
"lng" : 24.9433353
}, chevron_left
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 26/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
"southwest" : {
"lat" : 60.16226160000001,
"lng" : 24.9332897
}
}
},
"place_id" : "ChIJARW7C8sLkkYRgl4je4-RPUM",
"types" : [ "route" ]
}
],
"status" : "OK"
}
These are the optional parameters that you can include in a reverse
Geocoding request:
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 27/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
chevron_left
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 28/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 29/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&
{
"results" : [
{
"address_components" : [
{
"long_name" : "277",
"short_name" : "277",
"types" : [ "street_number" ]
},
{
"long_name" : "Bedford Avenue",
"short_name" : "Bedford Ave",
chevron_left
"types" : [ "route" ]
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 30/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
},
{
"long_name" : "Williamsburg",
"short_name" : "Williamsburg",
"types" : [ "neighborhood", "political" ]
},
{
"long_name" : "Brooklyn",
"short_name" : "Brooklyn",
"types" : [ "sublocality", "political" ]
},
{
"long_name" : "Kings",
"short_name" : "Kings",
"types" : [ "administrative_area_level_2", "political" ]
},
{
"long_name" : "New York",
"short_name" : "NY",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "United States",
"short_name" : "US",
"types" : [ "country", "political" ]
},
{
"long_name" : "11211",
"short_name" : "11211",
"types" : [ "postal_code" ]
}
],
"formatted_address" : "277 Bedford Avenue, Brooklyn, NY 11211, USA",
"geometry" : {
"location" : {
"lat" : 40.714232,
"lng" : -73.9612889
},
"location_type" : "ROOFTOP",
"viewport" : {
"northeast" : {
"lat" : 40.7155809802915,
"lng" : -73.9599399197085
},
"southwest" : {
"lat" : 40.7128830197085,
"lng" : -73.96263788029151
} chevron_left
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 31/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
}
},
"place_id" : "ChIJd8BlQ2BZwokRAFUEcm_qrcA",
"types" : [ "street_address" ]
},
Note that the reverse geocoder returned more than one result. The
"formatted_address"
results are not just postal addresses, but
any way to geographically name a location. For
example, when geocoding a point
in the city of Chicago, the geocoded point may be
denoted as a street address,
as the city (Chicago), as its state (Illinois) or as a country (The
United
States). All are "addresses" to the geocoder. The reverse geocoder returns
any of
these types as valid results.
chevron_left
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 32/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
The following example filters the addresses returned to include only those
with a location
type of ROOFTOP and an address type of
street_address.
https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452
&location_type=ROOFTOP&result_type=street_address&key= YOUR_API_KEY
The format of the reverse geocoding response is the same as the Geocoding
response. See
Geocoding responses (#GeocodingResponses).
Below are the status codes possible in a
reverse geocoding response.
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 33/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
Required parameters:
https://maps.googleapis.com/maps/api/geocode/json?place_id=ChIJd8BlQ2BZwokRAFU
&key= YOUR_API_KEY
{
"results" : [
{
"address_components" : [
{
"long_name" : "277",
"short_name" : "277",
"types" : [ "street_number" ]
}, chevron_left
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 34/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
{
"long_name" : "Bedford Avenue",
"short_name" : "Bedford Ave",
"types" : [ "route" ]
},
{
"long_name" : "Williamsburg",
"short_name" : "Williamsburg",
"types" : [ "neighborhood", "political" ]
},
{
"long_name" : "Brooklyn",
"short_name" : "Brooklyn",
"types" : [ "political", "sublocality", "sublocality_level_1"
},
{
"long_name" : "Kings County",
"short_name" : "Kings County",
"types" : [ "administrative_area_level_2", "political" ]
},
{
"long_name" : "New York",
"short_name" : "NY",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "United States",
"short_name" : "US",
"types" : [ "country", "political" ]
},
{
"long_name" : "11211",
"short_name" : "11211",
"types" : [ "postal_code" ]
}
],
"formatted_address" : "277 Bedford Ave, Brooklyn, NY 11211, USA",
"geometry" : {
"location" : {
"lat" : 40.7142205,
"lng" : -73.9612903
},
"location_type" : "ROOFTOP",
"viewport" : {
"northeast" : {
"lat" : 40.71556948029149,
"lng" : -73.95994131970849
}, chevron_left
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 35/36
15/09/2021, 06:53 Overview | Geocoding API | Google Developers
"southwest" : {
"lat" : 40.7128715197085,
"lng" : -73.9626392802915
}
}
},
"place_id" : "ChIJd8BlQ2BZwokRAFUEcm_qrcA",
"types" : [ "street_address" ]
}
],
"status" : "OK"
}
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0
License (https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the Apache
2.0 License (https://www.apache.org/licenses/LICENSE-2.0). For details, see the Google Developers Site
Policies (https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its
affiliates.
chevron_left
https://developers.google.com/maps/documentation/geocoding/overview?hl=en_US 36/36