How do I check if my domain is grandfathered? - google-maps

I have thoroughly read through the updated google API Terms and Conditions:
https://developers.google.com/maps/pricing-and-plans/standard-plan-2016-update
Specifically, this excerpt:
Active domains created before June 22, 2016, continue to be able to access the Google Maps JavaScript API, Static Maps API, and Street View Image API without an API key. They are not affected by keyless access being unavailable for new domains.
My question is, how do I figure out if my domain is grandfathered and can continue to call the static maps API without the API_KEY parameter?

You can test if your domain was whitelisted by trying to load a map without an API key. If you manage to get the static map image it means you were whitelisted.
The whitelist has 25000 queries per day limit which is equivalent to the free quota limit when you are using a key.
To be able to monitor your usage and, if needed, get more quota it would be best for you to start using an API key. You can then check quota and monitor your usage in the Google Developer Console

Related

Google Maps Static API is asking for API Key

When using the google maps static API service, all my requests are showing up as a 403 Forbidden. When taking a look at my request, I notice this error message: "The Google Maps API server rejected your request. This service requires an API key."
The code that is calling the service is below:
<img src="http://maps.googleapis.com/maps/api/staticmap?center=Albany,+NY&zoom=13&scale=false&size=600x300&maptype=roadmap&format=png&visual_refresh=true" alt="Google Map of Albany, NY">
I've used the static map service before and it worked fine and easily. But for some reason, all my requests show up as a 403 now? I've never had to use an API key in the past. If I do use an API key with this call, it works.
What is going on here?
The Google Static Maps API now requires a key (as of June 22, 2016), existing applications should be "grandfathered" with keyless access. See this blog post for more information (relevant text below):
As of June 22, 2016 we are making the following changes to the Google Maps APIs Standard Plan:
We no longer support keyless access (any request that doesn't include an API key). Future product updates are only available for requests made with an API key. API keys allow us to contact developers when required and help us identify misbehaving implementations.
We have implemented a simple 25,000 map loads per day free limit to new Google Maps JavaScript API, Static Maps API, and Street View Image API implementations. The confusing 90-consecutive-day grace period for these APIs is being retired on October 12, 2016. With this change, developers can predictably plan for growth while media sites and US nonprofits can request more quota at no charge via our dedicated support programs.
We have reduced the daily map load maximum limit you can purchase for Google Maps JavaScript API, Static Maps API, and Street View Image API from 1,000,000 to 100,000 requests per API.* We believe higher-volume developers are best served with a Premium Plan license, which includes technical support and a Service Level Agreement, and with this change we've also created consistency between Standard Plan quotas across our maps and web service APIs.
We now count Google Maps JavaScript API client-side requests towards the daily limit of the associated web service API.*
The new policies will apply immediately to all Maps API implementations created on or after June 22nd, 2016.
Existing applications have been grandfathered based on their current usage to ensure that they continue to function both now and in the future. We will also be proactively contacting all existing API key users who, based on usage growth patterns, may be impacted in the future. If you’re an existing user, please take the time to read our Policy Update for Standard Plan summary for details on how each of these changes might affect your implementation.

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.

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

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
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!
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

How does Google Geocoding API usage limits apply to [Sales]force.com?

The following are the usage limits as specified by Google on their Developer Guide pages:
Google Maps JavaScript API v3 => For-profit web sites are permitted to generate up to 25,000 map loads per day
Google Geocoding API => subject to a query limit of 2,500 geolocation requests per day
Google Maps API for Business => may perform up to 100,000 requests per day
Am trying to evaluate using any one of the above for use with Visualforce on Salesforce.com (SFDC) platform [*]
I understand for a public website the requests are per IP. Now for SFDC, there could be many different Organizations on a particular server (say, NA1). So, two different companies using SFDC and Google Maps API could have an URL at https://na1.salesforce.com/something_here and their requests should be counted separately.
Will it be so? What will happen in case of each API?
[*]SFDC is a SaaS cloud for the purpose of our discussion. All users login through the same page but they could be logged into different "orgs"/"organizations" but their URLs might look similar
It's important to differentiate between the server-side and client-side limits here. The server-side geocoding api would have have the 2500 limit enforced across the shared Salesforce instance based on how many machines the requests come from (I assume NA1 isn't 1 huge server). Multiple organization using the free geocoding API would all share the same server-side geocoding limit. I've actually run into the same limits using Google's own App Engine platform, where a bunch of applications share the same outbound IP address.
For any sort of guaranteed performance you'll need to send the queries from your own server or go the Maps for Business route which lets you authenticate your queries to get those higher limits.
Client-side geocoding via the JavaScript API doesn't have these server-limits, so if users do any sort of action to trigger a geocode or two using the JS API is the best route.
You can already create your own "bucket" to track your 25K map loads per day by signing up for an API Key.
This question on SO addresses the geocoding API specifically being run from a visualforce page directly, Salesforce: Google maps query status 620 G_GEO_TOO_MANY_QUERIES and it does seem to mean that without a key the limits are shared. I would suspect that unless you plan on giving the app away that you are working on, you will pretty much be forced to pick up an upgraded API key. One thing you may want to look at to work around this is hosting the maps portion in another location, and iframing it into Salesforce.