Options
All
  • Public
  • Public/Protected
  • All
Menu

Desired search values of a single region.

Location must be specified by one of the following: address, latlng or place_id. If none is specified, an INVALID_ARGUMENT error is returned. region_code must also be provided when address is specified.

The fields address, latlng and place_id specify a location contained inside the region to match. For example if address is "1600 Amphitheatre Pkwy, Mountain View, CA 94043" the API returns the following matched_place_id results when the following place_types are specified:

place_type: matched_place_id results: postal_code Place ID for "94043" administrative_area_level_1 Place ID for The State of California administrative_area_level_2 Place ID for Santa Clara County

More Examples:

If latlng is "latitude: 37.4220656 longitude: -122.0862784" and place_type is "locality", the result contains the Place ID (of type "locality") for that location (the Place ID of Mountain View, CA, in this case).

If place_id is "ChIJj61dQgK6j4AR4GeTYWZsKWw" (Place ID for Google office in Mountain view, CA) and place_type is "locality", the result contains the Place ID (of type "locality") for that location (the Place ID of Mountain View, CA, in this case).

If no match is found, matched_place_id is not set.

Hierarchy

Index

Properties

address?: string

The unstructured street address that is contained inside a region to match. region_code is required when address is specified.

language?: string

The BCP-47 language code, such as "en-US" or "sr-Latn", corresponding to the language in which the place name and address is requested. If none is requested, then it defaults to English.

language_code?: string

The BCP-47 language code, such as "en-US" or "sr-Latn", corresponding to the language in which the place name and address is requested. If none is requested, then it defaults to English.

latlng?: { latitude: number; longitude: number }

The latitude and longitude that is contained inside a region to match.

Type declaration

  • latitude: number
  • longitude: number
place_id?: string

The Place ID that is contained inside a region to match.

place_type: "administrative_area_level_1" | "administrative_area_level_2" | "country" | "locality" | "neighborhood" | "postal_code" | "administrative_area_level_3" | "administrative_area_level_4" | "sublocality_level_1"

Place type to match.

region_code?: string

Two-letter ISO-3166 country/region code for the location you're trying to match. region_code is optional if place_type is "country".

Generated using TypeDoc