GeocodeResult

A geocode result contains geographic information about a place.

JSON representation
{
  "place": string,
  "placeId": string,
  "location": {
    object (LatLng)
  },
  "granularity": enum (Granularity),
  "viewport": {
    object (Viewport)
  },
  "bounds": {
    object (Viewport)
  },
  "formattedAddress": string,
  "postalAddress": {
    object (PostalAddress)
  },
  "addressComponents": [
    {
      object (AddressComponent)
    }
  ],
  "postalCodeLocalities": [
    {
      object (LocalizedText)
    }
  ],
  "types": [
    string
  ],
  "plusCode": {
    object (PlusCode)
  }
}
Fields
place

string

The fully qualified place identifier for this result. In the format of "//places.googleapis.com/places/{placeID}". See https://developers.google.com/maps/documentation/places/web-service/place-id. for more details.

placeId

string

The place ID for this result.

location

object (LatLng)

The latlng of this address.

granularity

enum (Granularity)

The granularity of the location.

viewport

object (Viewport)

A viewport suitable for displaying the geocode result.

bounds

object (Viewport)

A bounding box for the address.

formattedAddress

string

The one line formatted address.

postalAddress

object (PostalAddress)

The address in postal address format.

addressComponents[]

object (AddressComponent)

Repeated components for each locality level.

postalCodeLocalities[]

object (LocalizedText)

Complete list of localities contained in the postal code.

This is only populated when the result is of type "postal_code".

types[]

string

A set of type tags for this result. For example, "political" and "administrative_area".

For the complete list of possible values, see Table A and Table B at https://developers.google.com/maps/documentation/places/web-service/place-types.

plusCode

object (PlusCode)

Plus code of the location in this geocode.

AddressComponent

The structured components that form the formatted address, if this information is available.

JSON representation
{
  "longText": string,
  "shortText": string,
  "types": [
    string
  ],
  "languageCode": string
}
Fields
longText

string

The full text description or name of the address component. For example, an address component for the country Australia may have a long name of "Australia".

shortText

string

An abbreviated textual name for the address component, if available. For example, an address component for the country of Australia may have a short name of "AU".

types[]

string

An array indicating the type(s) of the address component.

See https://developers.google.com/maps/documentation/geocoding/requests-geocoding#Types for more details.

languageCode

string

The language used to format this components, in CLDR notation.

LocalizedText

Localized variant of a text in a particular language.

JSON representation
{
  "text": string,
  "languageCode": string
}
Fields
text

string

Localized string in the language corresponding to languageCode below.

languageCode

string

The text's BCP-47 language code, such as "en-US" or "sr-Latn".

For more information, see http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.