I’ve got a list of addresses without city or zip, but in the vicinity of another address. The Google Distance Matrix API is generally able to infer the locale of the destination address from that of the origin address. For example:
https://maps.googleapis.com/maps/api/distancematrix/json?origins=818 Oklahoma Blvd, Alva, OK 73717&destinations=889 W Lakes Dr&key=<key>
returns JSON that starts with:
{
"destination_addresses" :
[
"889 W Lakes Dr, Alva, OK 73717, USA"
and gives me distance data, along with elements status “OK”.
But for many addresses, the JSON comes out with destination_addresses
empty. For example, for the address, 1007 Mill St, which I’ve linked to Google Maps to show the address exists in the same zip code, when I ask the API:
https://maps.googleapis.com/maps/api/distancematrix/json?origins=818 Oklahoma Blvd, Alva, OK 73717&destinations=1007 Mill St&key=<key>
it returns JSON that starts with:
{
"destination_addresses" :
[
""
and no distance data, along with elements status “NOT_FOUND”.
This is happening for about a third of my addresses. Is there a reason Google is failing on them, even though they are valid addresses near the origin address? Is there a way to get Google to return the correct data for them?