In a Geocoding response, the Geocoding API can return address results restricted to a specific area. You can specify the restriction using the
components filter. A filter consists of a list of
component:value pairs separated by a pipe (
|). Filter values support the same methods of spelling correction and partial matching as other Geocoding requests. If the geocoder finds a partial match for a component filter, the response will contain a
components that can be filtered include:
countrymatches a country name or a two letter ISO 3166-1 country code. The API follows the ISO standard for defining countries, and the filtering works best when using the corresponding ISO code of the country.
The following components may be used to influence results, but will not be enforced:
routematches the long or short name of a route.
localitymatches against locality and sublocality types.
administrative_areamatches all the administrative_area levels.
Notes about component filtering:
If the request contains multiple component filters, the API evaluates them as an AND, not an OR. For example, if the request includes multiple countries components=country:GB|country:AU, the API looks for locations where country=GB AND country=AU, and returns ZERORESULTS.
Results are consistent with Google Maps, which occasionally yields unexpected ZERORESULTS responses. Using Place Autocomplete may provide better results in some use cases. To learn more, see this FAQ.
For each address component, either specify it in the address parameter or in a components filter, but not both. Specifying the same values in both may result in ZERO_RESULTS.
In a Geocoding request, you can instruct the Geocoding service to prefer results within a given viewport (expressed as a bounding box). You do so within the request URL by setting the
bounds parameter. Note that biasing only prefers results within the bounds; if more relevant results exist outside of these bounds, they may be included.
bounds parameter defines the latitude/longitude coordinates of the southwest and northeast corners of this bounding box using a pipe (|) character to separate the coordinates.
Language Code Language
en-Au English (Australian)
en-GB English (Great Britain)
pt-BR Portuguese (Brazil)
zh-CN Chinese (Simlified)
zh-TW Chinese (Traditional)
street_addressindicates a precise street address.
routeindicates a named route (such as "US 101").
intersectionindicates a major intersection, usually of two major roads.
politicalindicates a political entity. Usually, this type indicates a polygon of some civil administration.
countryindicates the national political entity, and is typically the highest order type returned by the Geocoder.
administrative_area_level_1indicates a first-order civil entity below the country level. Within the United States, these administrative levels are states. Not all nations exhibit these administrative levels. In most cases, administrativearealevel_1 short names will closely match ISO 3166-2 subdivisions and other widely circulated lists; however this is not guaranteed as our geocoding results are based on a variety of signals and location data.
administrative_area_level_2indicates a second-order civil entity below the country level. Within the United States, these administrative levels are counties. Not all nations exhibit these administrative levels.
administrative_area_level_3indicates a third-order civil entity below the country level. This type indicates a minor civil division. Not all nations exhibit these administrative levels.
administrative_area_level_4indicates a fourth-order civil entity below the country level. This type indicates a minor civil division. Not all nations exhibit these administrative levels.
administrative_area_level_5indicates a fifth-order civil entity below the country level. This type indicates a minor civil division. Not all nations exhibit these administrative levels.
colloquial_areaindicates a commonly-used alternative name for the entity.
localityindicates an incorporated city or town political entity.
sublocalityindicates a first-order civil entity below a locality. For some locations may receive one of the additional types: sublocalitylevel1 to sublocalitylevel5. Each sublocality level is a civil entity. Larger numbers indicate a smaller geographic area.
neighborhoodindicates a named neighborhood
premiseindicates a named location, usually a building or collection of buildings with a common name
subpremiseindicates a first-order entity below a named location, usually a singular building within a collection of buildings with a common name
postal_codeindicates a postal code as used to address postal mail within the country.
natural_featureindicates a prominent natural feature.
airportindicates an airport.
parkindicates a named park.
point_of_interestindicates a named point of interest. Typically, these "POI"s are prominent local entities that don't easily fit in another category, such as "Empire State Building" or "Eiffel Tower".
"ROOFTOP"returns only the addresses for which Google has location information accurate down to street address precision.
"RANGE_INTERPOLATED"returns only the addresses that reflect an approximation (usually on a road) interpolated between two precise points (such as intersections). An interpolated range generally indicates that rooftop geocodes are unavailable for a street address.
"GEOMETRIC_CENTER"returns only geometric centers of a location such as a polyline (for example, a street) or polygon (region).
"APPROXIMATE"returns only the addresses that are characterized as approximate.