Options
All
  • Public
  • Public/Protected
  • All
Menu

Identifies a region to look up.

One of place or unit_code must be specified. If none is specified, an INVALID_ARGUMENT error is returned. region_code must also be specified except when place_type is "country".

place and unit_code specify a location to match a Place ID to. For example if place is "California" and region_code "US" the API returns the following matched_place_id results when the following place_type are specified:

place_type: matched_place_id results: administrative_area_level_1 Place ID for The State of California (All other supported types) No Match

If unit_code is "6" (FIPs code for California) and region_code is "US the API returns the following matched_place_id results when the following place_types are specified:

place_type: matched_place_id results: administrative_area_level_1 Place ID for The State of California (All other supported types) No Match

or if unit_code is "US" the API returns the following results when the following place_types are specified:

place_type: matched_place_id results: country Place ID for the United States (All other supported types) No Match

If no match is found, matched_place_id is not set.

In all of the examples above if candidate Place IDs are requested, no candidate is retuned when a lookup is successful (matched_place_id is set). Candidate Place IDs are returned when a lookup finds a region with a different place_type then the one requested. For example if place is "California" and place_type is "country" the Place ID for "The State of California" is returned as a candidate.

Hierarchy

Index

Properties

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.

place?: string

The name of the region to match to a Place ID.

The place field is used in combination with place_type to look up the region Place ID.

For example:

  • If place_type is "locality", a valid place can be "Palo Alto, CA".
  • If place_type is "postal_code", a valid place can be "94109".
  • If place_type is "country", a valid place can be "United States".

region_code is required when place is specified except when place_type is "country".

place_type: "administrative_area_level_1" | "administrative_area_level_2" | "country" | "locality" | "neighborhood" | "postal_code"

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".

unit_code?: string

The FIPs state or county codes (US only) or ISO-3166-1 country code to be matched.

The unit_code field is used in combination with place_type to look up the region Place ID.

For example:

  • If place_type is "country", a valid unit_code can be "US" (ISO-3166-1 Alpha-2 code for United States) or "BR" (ISO-3166-1 Alpha-2 code for Brazil).
  • If place_type is "administrative_area_level_1" (state) and region_code is "US", a valid unit_code can be "6" (FIPs code for California) or "12"(FIPs code for Florida).
  • If place_type is "administrative_area_level_2" (county) and region_code is "US", a valid unit_code can be "6001" (FIPs code for Alameda County in California) or "12086" (FIPs code for Miami-Dade County in Florida).

region_code is required when specifying a FIPs code. region_code is ignored for ISO-3166-1 country codes.

Generated using TypeDoc