Do Google API keys work with Google Maps web services, e.g. geocoding?
Asked Answered
H

2

1

I'm using Google Maps web services to perform server-side (reverse) geocoding.

I've got a browser-side and server-side Google API key from the Google APIs Console, which permits the Google Maps JS API to use higher request quotas, and enables pay-per-use for overages (successfully tested in-browser via JS). But the server-side key doesn't seem to work on web services requests.

For example, this URL works fine:
http://maps.googleapis.com/maps/api/geocode/json?sensor=true&latlng=43.477329,-80.548601

But if you add a "key=..." parameter, as in the other APIs, I get a REQUEST_DENIED status.

Am I doing something wrong, or is this just not supported on the web services APIs (yet)? Will it be supported in the future?

See also

request_denied when i include key=my_api_key

Hexapody answered 30/3, 2012 at 19:13 Comment(2)
possible duplicate of request_denied when i include key=my_api_keyWolfson
@Dr.Molle: Thanks, yes it is. Edited to include your link.Hexapody
H
1

Nope, you're not doing anything wrong.

Unfortunately, enforcing tight limits on the Google Geocoding API, also called "Server-Side Geocoding", is Google's design. If your app needs more than 2,500 Server-Side Geocodes per day, then you'll need to upgrade to their Google Maps API for Business product.

Hold on, it gets worse.

If your app's server IP address is shared with other apps, that 2,500 request daily limit applies to ALL of them. This includes apps that share the same server IP address as you, but don't belong to you! This can be a common situation with any PaaS, like Google App Engine or Heroku. So, even if your app works flawlessly today, there is no guarantee that it's still going to work tomorrow.

In the article, "Geocoding Strategies", Google indicates the solution is to "almost always" use "Client-Side Geocoding" via the Geocoding Service, part of the Google Maps JavaScript API V3. The primary reason is that limits are enforced per user, per session. Requests like this shouldn't run up against quota limits unless you're executing geocode batches on the client (not a typical use case).

One golden nugget from the "Geocoding Strategies" article: Design a page that takes user input, calls the client-side Geocode service method, then passes that information to your server app where it can be processed, and hopefully cached. This is FAR from ideal, but if upgrading to Google Maps API for Business isn't an option, it might be the only way to go.

Good luck!

Hughmanick answered 4/6, 2013 at 0:36 Comment(3)
This indeed seems to be the case. We now have a business license.Hexapody
I found your question yesterday because I was trying to work around the same limits that you are. I'm feeling a bit of sticker shock at the OEM pricing. ;-) Hopefully things did not go too badly for you guys.Hughmanick
@VivekM.Chawla Can you please see this question it's regarding geocoder class api limitation #54144932Antirachitic
A
0

According to this post, your API key should work as one of the three option for requests over 25,000 loads per day.

https://developers.google.com/maps/faq#usagelimits

Ailssa answered 30/3, 2012 at 19:22 Comment(2)
Using the Maps-API and requesting the geocoding-service are two different things. The maps-API is listed inside the API-console and accepts a key, the geocoding-service doesn't.Wolfson
I was hoping it would indeed grant higher quota limits for the geocoding web service API, but it doesn't seem to work, as @Wolfson points out. Maybe it's coming in a future update.Hexapody

© 2022 - 2024 — McMap. All rights reserved.