Lakshmi narayan
Lakshmi narayan

Reputation: 11

GeoKit API response is unreliable, Gives different responses every time for same payload

GeoKit gem version: 1.11.0

Payload: "3880 S El Camino Real, San Mateo, CA 94402, USA"

Api call: Geokit::Geocoders::MultiGeocoder.geocode(payload)

Response 1: "Provider: Google, Street: 3880 S El Camino Real.., Success: true"

Response 2: "An error has occurred during geocoding: Keyless access to Google Maps Platform is deprecated. Please use an API key with all your API calls to avoid service interruption. For further details please refer to http://g.co/dev/maps-no-account"

Doubt: If the google API has been changed as per response 2 to accept only api calls with key, then every api call(mentioned above) should give response 2. What is the actual expected behavior here?

Please clarify. Thanks.

Upvotes: 1

Views: 420

Answers (1)

mbuechmann
mbuechmann

Reputation: 5760

That the responses are random is a bit strange, but not that important.

First of all, as a general advice, I would update the geokit gem, as the version you are using is older than one year.

If you follow the link, you can read, that it should not be possible to make these api key without an API key. To get an API key, you need a free billing account. When this is setup you can get an API key, which has 200 USD worth of free API requests per month (which is quite a lot).

When you have the key, you can configure it by setting Geokit::Geocoders::GoogleGeocoder.api_key.

Upvotes: 0

Related Questions