Google Maps API Depreciation Time - google-maps

We are planning to use data like this to find county from coordinates. Will Google shutdown looks up like this anytime soon?
http://maps.googleapis.com/maps/api/geocode/json?latlng=39.76144296429947,-104.8011589050293&sensor=false
I'm not sure if this is coming from V2 or v3 of their APIs.
According to https://developers.google.com/maps/documentation/geocoding/#ReverseGeocoding
you do need and API key
https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&key=API_KEY
however without one it still works
https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452

You already use V3, the URL for V2 was http://maps.googleapis.com/maps/geo
related to the parameters:
key is supported, but not required. But you better use a key, otherwise you will share your quota with all domains that share the same IP and may often get a OVER_QUERY_LIMIT
sensor is no longer required(you may omit it)

Related

Access Denied when attempting to use Google Maps Geocoding Service with a Console API Key

UPDATE: In an effort to give a more clear question. How do I use the Google Console API key with the Google Maps Geocoding Web Service API? At the moment the request comes back as denied, when I specify the key but even though it failed it is logged in the Google Console API site's reports section.
Original Question
I have an existing app that has been modified to start geocoding address at the time they are entered (for use within the app on a Google Map). The volume expected for this is expcted to be within the free offering's limites and does not require a key at this time. However now I have to geocode all of the existing addresses. I have a small windows app (C#) that will loop through them one at a time, request they be geocoded (via https://maps.googleapis.com/maps/api/geocode/json) and store the results in the database. However I keep running into the query limit. To help alleviate this I've setup an account on Google API Console (https://code.google.com/apis/console/) so that I get go over the limit and just be billed for the overages.
The problem is in order to do utilize this billing alternative I have to provide a Console API Key to the request, but every time I do so I get a response back with a status of REQUEST_DENIED.
My URL looks like this
https://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA+94043&sensor=false&key=123abc
If I take off the key it works fine, but with it on it fails. Now, I have seen other questions similar to this when looking around but can find no answer to the issue.
I've tried various alternate domains including maps.google.com, maps.googleapis.com and maps-api-ssl.google.com all seem to have the same problem from what I can tell.
Here's what I've been able to find out so far:
The service is listed in the Google Console API's site as Google Maps API v3, (there is a separate entry for v2) so I don't think it's a problem with keys no longer being mandatory in v3.
I know the requests are getting through and being correctly logged against this API key because with each failed attempt the request count goes up by one on the Reports tab of the Google APIs Console.
*I know it's not a problem with it not being accessed via a web page because the Console API explicitly lets you generates keys intended for Server/Service use and you can restrict access to them via IP address, not URL Referrer.
*I've also verified the parameter syntax as it's outlined on this page, as are other usage
*These seem to be generic to the Console API system but there is no mention of exceptions to these practices when used for the Google Maps API.
I even tried to contact Google but apparently they don't offer support over the phone (I was hoping to be done with this today but that's not looking likely).
It seems the key is not necessary anymore, since it doesn't increase your limit of free geocodings.
It was a legacy of v2, but geocoding API v2 was fully deprecated last March, 8.
If you need to use more than the free limit, I think you must adquire the Enterprise license.
Regards,
Eduardo.
I ran into this same issue and solved it by enabling the Geocoding API on the Google apis dashboard. Even though I'm using the Google Maps JavaScript API v3, it still required me to enable the Geocoding API as well. Make sure you understand the google's quota limits and billing system before enabling any API access. Hope this helps!
Late to this answer, but just in case anyone else has issue. Billing needs to be setup first and like Dylan said you also have to enable Geocoding API(this got me). At least I did for my locations app that shows multiple store location addresses.

Google Maps API Key - Get one for everyone of my users programmatically?

I saw that one has not to obtain a Google Maps API key if you want to use their maps api in general, only if you want to use their web services and statistics etc.
Now I have two questions regarding this:
If I have a public website which uses the Google Maps API to display a map with default options. How does Google count the API calls if I don't use an API key? (Maybe with the help of the domain which requests the map?)
If they do so and my site exceeds the 25k calls/day, is there a possiblity that my users can login with their Google account on my site and some backend logic will get them an API key from Google that I store e.g. in a database. So I could use the API keys of my users to bypass the API usage limits only for my site.
Assuming you are using the Javascript API v3:
This SO question partially answers your queries.
Have a look at the usage limits, it looks like that you cannot use more than one API key:
Can I use more than one API key to increase my available usage over
the documented limits?
Google reserves the right to withhold access to the Maps API from any site that attempts to use more than the permitted number of map
loads of the Maps API without permission, and fails to respond when
contacted by Google.
Though this may be debatable, to me it seems a bad idea using your user's API key. For sure you need to ask the permission, then you have to monitor their quotas and so on, a minefield...
TL;DR if you exceed constantly the daily quota you should purchase a larger quota.

use multiple Google Maps API Keys for same server?

I have a server which acts as a mesh.
I have 3 mobile apps, each having it's own google maps api Key
all three apps call my server which calls the google apis with the specific app key.
so App1 has key1
App2 has Key 2
App3 has key 3
when I need the directions for App1, my server calls google api with key 1
when I need the directions for App2, my server calls google api with key 2
when I need the directions for App3, my server calls google api with key 3
So my server works like an API mesh. Is this against google terms? I am afraid they will look at the ip address of the server, see there are 3 keys used and assume I am using different Keys for same applications which is prohibited.
The short answer (drawn from the FAQ) is quite simply : no, you can't use two keys in this case.
See https://developers.google.com/maps/faq#usage_avoidance
- they even reserve "the right to withhold access to the maps API from any site" doing so, just as you feared.
Using more than one key, even though it could only be a matter of convenience for you, means for them trying to cheat and bypass the limitation of 25,000 requests per day and per service. And they don't like that, because they want big users of their maps API to pay, of course. Prices are listed on the same page.
You should read the FAQ paragraphs "Understanding the Terms of Service" and "Usage limits" completely - it is quite short but sometimes a little tricky. You'll see that there are a few situations in which you do not actually have to pay even when exceeding limitations :
you are using the google earth API
you are using a native maps API from a mobile platform
you are showing a google map through an embed only
your apps are "in the public interest (as determined by Google at its discretion)"
Also, you do not always need to provide an API key, though these products may still be available for limited use only : take for instance the geocoding API.
I guess you're not in one of those cases (at least bullets 2 and 3) since your calls transit through your server. Using the native APIs in mobile apps would solve the problem, but it does mean quite some development I guess.
It is also worth noting that you should apply for a special maps API for business license for some use cases, e.g. when only paying users get to see your map.
In conclusion, you need to have one single google maps API key when it comes to using their products that require one. Or rather, at most one per domain name.

Google Places API Limits

I am looking into the Google Places Autocompleter. It works perfectly, I tried using the code provided.
However I see they mention something about limits per API key. First of all, I don't have an API key, and it works. I dont see a limit regarding no API keys?
Secondly, do they limit per client IP (the browser that is viewing my site), per domain, or something else?
If they limit per domain, will sub1.domain.com and sub2.domain.com share the same limit?
I can't seem to find anything regarding this in the Google documentation, which is why I am asking here. Thanks!
Edit: So I signed up for an API key, but they dont tell me where to include it to use the Places Autocomplete?
The Google Maps JavaScript API V3 Places Library does not require an API key to implement and does not have a documented limit. However, if a user performs more queries than deemed acceptable by Google in one minute, they will receive the OVER_QUERY_LIMIT status in response to a request.
As far as the key is concerned, it's only required for the Places web service: https://developers.google.com/maps/documentation/places/
Your doc link is to the Places library - that's a service of the JavaScript API v3. A key isn't required there, though you can include one by adding &key={yourkey} when you load the Maps JS (https://developers.google.com/maps/documentation/javascript/tutorial#HelloWorld).
So:
Places web service: key required
Places JavaScript service: no key required
I don't know about specific autocomplete limits, but the JS API has limits mentioned here: https://developers.google.com/maps/documentation/javascript/usage. Basically, 25,000 map loads per day, with the option to purchase more if required.
Hope that helps.

Google Maps JavaScript API V3 - API Key and clientId

After reading many online forums/blogs, it's pretty clear to me that Google Maps API V3 do not require API key anymore.
And for more advanced google map features, I should have clientId (which my organisation already have).
But what is confusing to me is that I found two places -
First, where I get the information that API key is still good to use
'All Maps API applications should load the Maps API using an API key'
Google Maps JavaScript API V3 Documentation
Second, where I get information that we should definitely avoid using API key and replace them with clientId
https://groups.google.com/forum/#!topic/google-maps-js-api-V3/oJf7I5FdAdY
http://egis3.lacounty.gov/eGIS/2011/12/06/google-maps-api-v3-to-stop-ignoring-the-key-parameter/
Can please guide if I am missing something and which one should I take as the correct information.
Thank you!
I think if the documentation says "All Maps API applications should load the Maps API using an API key," then that is the advice to follow. It's probably better advice than postings in a forum (including, perhaps, this one).
It's true that Version 3 will work without a key; but there is no guarantee that they will continue to do so, particularly in the light of the documentation; and using a key brings the benefits of statistics reporting.
The client ID is associated with an Enterprise licence, which raises some of the limits associated with a ordinary free key. Neither unlocks advanced features of the map; both allow usage reporting.
Yes, you have missed something !
The two links you give at the end of your question relate to moving from v2 of the API (where a key was obligatory) to v3 of the API where a key is optional.
It is not necessary to have a key for v3 of the API if you will not have more than 25000 map loads per day.
Over this limit, it is apparently required that you obtain a key and a premium account (payable).
Ensure that you have really understood the contents of the first link you gave, notably the section Obtaining an API key.
Then jump to the linked page on Usage Limits.
I reiterate what I have said : it is NOT required that you have an API key for v3.