How to correctly use the Google Maps Geocoding endpoint? It's not returning correctly place

43 Views Asked by At

I'm using the Google Maps API Geocoding to convert address to latitude/longitude, but it's not returning the correct values.

For example, with this address: 15994 US Hwy 431, Headland, AL 36345

Using this endpoint:

https://maps.googleapis.com/maps/api/geocode/json?address=15994+US+Hwy+431,+Headland,+AL+36345&key=(apikey)

The Google Maps Geocoding API is returning (Which is not correct):

"location": { "lat": 32.8365989, "lng": -84.8436105 },

enter image description here

However, if I search for that address in the google maps application it's pointing the correct address (it's changing automatically in the search bar to 15994 US-431 after pressing enter):

enter image description here

After testing a while, I discovered that if I change "Hwy" for "Highway" it does return the correct address. Is there any way to fix this?

https://maps.googleapis.com/maps/api/geocode/json?address=15994+US+Highway+431,+Headland,+AL+36345&key=(apikey)

Is there any way to make it understand abbreviations? Like Hwy for example

0

There are 0 best solutions below