Zip code missing in the Place Autocomplete Address Form response

Viewed 1537

(Excuse me if this is the wrong channel, but the official Google page refers to this place for support)

The Place Autocomplete Address Form fails to return a zip code for certain addresses, for example:

4 Frederick Boulevard, Thorntonhall, Glasgow, G74 5DE, United Kingdom

enter image description here

I does return a zip code on Google Maps itself, but not from the API. What's wrong - is that data incomplete in the API or something else?

enter image description here

1 Answers

Got response from Google - kudos for the detail in their answer and response time (few hours):

TL;DR - this is not recognized as a real address by our system so it does not return a postal code through Places API.

A search for this address using the Geocoding API returns a response with the expected postal code "G74 5DE": https://maps.googleapis.com/maps/api/geocode/json?&address=4%20frederick%20boulevard%20thorntonhall%20glasgow%20uk&key=YOUR_KEY However, you will notice that the value in "location_type" is RANGE INTERPOLATED. From https://developers.google.com/maps/documentation/geocoding/intro#Results: "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.

When you search for this location using the Places API, however, a slightly different logic is used. Using the Autocomplete form on that page, you can see in the Network tab of your browser that when you select the first prediction the following request is made to our server: https://maps.googleapis.com/maps/api/place/js/PlaceService.GetPlaceDetails?2sen-US&10e3&14m1&1sEis0IEZyZWRlcmljayBCbHZkLCBUaG9ybnRvbmhhbGwsIEdsYXNnb3csIFVLIi4qLAoUChIJDXE3ZJ04iEgRKVCvpA6Zu00SFAoSCcUTLHCPOIhIES5R4rnn2wuV&15s176F4C4D-3F76-45B3-9F55-22F8D9BF3C4Btzvil5tvr27c&16m1&1saddress_component&17m1&2e1&callback=_xdc_._9fzwpx&key=KEY&token=TOKEN This is a request for Place Details of a Place ID Eis0IEZyZWRlcmljayBCbHZkLCBUaG9ybnRvbmhhbGwsIEdsYXNnb3csIFVLIi4qLAoUChIJDXE3ZJ04iEgRKVCvpA6Zu00SFAoSCcUTLHCPOIhIES5R4rnn2wuV Note that normally Place IDs begin with "C" and are much shorter than this. A longer Place ID is almost always an indication that it is artificial.

If you look at a Place Details request for that Place ID: https://maps.googleapis.com/maps/api/place/details/json?place_id=Eis0IEZyZWRlcmljayBCbHZkLCBUaG9ybnRvbmhhbGwsIEdsYXNnb3csIFVLIi4qLAoUChIJDXE3ZJ04iEgRKVCvpA6Zu00SFAoSCcUTLHCPOIhIES5R4rnn2wuV&key=YOUR_KEY You can see this is of "types: [route]" (https://developers.google.com/maps/documentation/geocoding/intro#Types) which indicates that it is not a street address. That is why this result does not have a street number or postal code, so when you use the Autocomplete on the URL you mentioned you don't see either of those things. One other thing, if you plot the lat, long you get from that Details response it puts you smack in the center of the street Frederick Blvd at William Grange.

So to reiterate from the top of this email, your result is expected because that is not a valid street address in our database. A Place API request will not give you the street number and postal code but a Geocoding request (or a request through maps.google.com) will, even though the place does not exist. If you know that this is a valid address, you can self-report this for us to update our records using the 'Send Feedback' feature on Google Maps. In Google Maps, you can report issue such as:

  • Incorrect road names,
  • Wrong info about one-way and two-way roads,
  • Incorrectly drawn road,
  • Closed roads,
  • Roads that don't exist,
  • Wrong addresses or marker locations, Issues such as missing or incorrect postal codes, however, will still need to be reported to our support team for further investigation.

Please see our article below on correcting data issues: https://support.google.com/maps/answer/3094045

Once a correction is submitted through the self help channel, it will be reviewed by moderators before it is approved and flows into our data. Please understand that it can take a few weeks for your edits to be reviewed. We recommend signing up for our Local Guides program (https://maps.google.com/localguides/home) to track your submitted edits. Please do not hesitate to reach out if you have further questions.

Related