As per the Google Geocoding API about Component Filtering
A query containing a component filter will only return the geocoding
results that match the filter. If no matches are found, the geocoder
will return a result that matches the filter itself.
Request :
https://maps.googleapis.com/maps/api/geocode/json?address=someincomprehesibleaddress&components=administrative_area:TX|country:US&key=YOUR_API_KEY
{
"results" : [
{
"address_components" : [
{
"long_name" : "Texas",
"short_name" : "TX",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "United States",
"short_name" : "US",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "Texas, USA",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 36.5007041,
"lng" : -93.5080389
},
"southwest" : {
"lat" : 25.8371638,
"lng" : -106.6456461
}
},
"location" : {
"lat" : 31.9685988,
"lng" : -99.9018131
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 36.5015087,
"lng" : -93.5080389
},
"southwest" : {
"lat" : 25.8371638,
"lng" : -106.6456461
}
}
},
"partial_match" : true,
"place_id" : "ChIJSTKCCzZwQIYRPN4IGI8c6xY",
"types" : [ "administrative_area_level_1", "political" ]
}
],
"status" : "OK"
}
Component filtering will return a ZERO_RESULTS response only if you provide filters that exclude each other.
Request :
https://maps.googleapis.com/maps/api/geocode/json?components=administrative_area:TX|country:FR&key=YOUR_API_KEY
{
"results" : [],
"status" : "ZERO_RESULTS"
}