Mathiou
Mathiou

Reputation: 419

Geocoder giving different results depending on API key

I am trying to retrieve coordinates for a specific address using Google geocoding service. Here is the HTTP request:

https://maps.googleapis.com/maps/api/geocode/json?address=EPIM%20Aix-En-Provence,%20Luynes,%20France&key=MY_DEV_KEY

The thing is that using my free development key (or with no key at all, it is the same), I get the result I expect:

"EPIM Aix-En-Provence, 18 Quartier Plein Soleil - 600 Route de Marseille, 13080 Luynes, France"

But when I switch to production and change the key to my production key, then I get a different (and completely wrong) result ("37230 Luynes, France").

I even tried with a simple curl call to avoid any header added by the browser, but it doesn't change anything.

Upvotes: 1

Views: 670

Answers (2)

Nacho
Nacho

Reputation: 11

If, when switching to production, someone still has the same issue after having placed the new_forward_geocoder=true before the key, try to place it also after, that is (in my case it worked for me) src="https://maps.google.com/maps/api/js?new_forward_geocoder=true&key=MY_DEV_KEY&new_forward_geocoder=true"

Upvotes: 1

geocodezip
geocodezip

Reputation: 161324

See Address Geocoding in the Google Maps APIs:Future Changes to Geocoding API, there is a change to the Geocoder which is in the process of being implemented which may cause the geocoder to depend on the presence of an API key.

You can experiment with the new_forward_geocoder flag in the request to verify if this is the issue.

Upvotes: 2

Related Questions