My goal is to write a windows phone free app (with some ads) with milions of google maps requests per day. This request will come form thousands of independent users (free of any charge).
However, the problem is google maps API limits. For simple things, like getting maps or geocoding - no any API key is required. However if I search for places (e.g. Pizza in London or Cinema, Paris or Doctor AnyCityHere) - than 'places API' is accessed. It is limited for 100k requests per day per API KEY (not per user) so if my app will be succesfull it will stop working very soon each day.
According to https://developers.google.com/places/uplift - I can use "Places Library..." rather than "Places API web service" - in order not to use API key, and make limits counts for each user, not entire App. The problem is, that this alternative solution is a JavaScript library, and probably can't be used in WindowsPhone App, am I right?
So the question is: can anyone tell me how to give WindowsPhone users a reliable google maps solution, that makes places searach requests limit for single user, not for enitire app?
For now there is no point to write succesfull google maps client for WindowsPhone because getting success means you either stuck because API requests limit, or you have to pay google for this, am I right? or I am missing something?
You can use Nokia Maps which is based on the powerfull maps of Navteq
Maps and navigation for Windows Phone 8
Related
We are considering using Google Places API for a new web application project and I believe we are vastly underestimating the number of requests we would use.
We would be using place search, Maps JavaScript API map load to grab Place IDs from Google as well as Place Autocomplete to help users find the defined location. So my questions are:
Would the Autocomplete be considered a request on every keystroke?
Would if also be a request when we select the suggestion (Places API)
and update to Map?
I have seen that with the premium Plan autocompletes use 0.1 Maps API Credit, while JavaScript API map load is 1 and Places API is 2 credits. Trying to understand how to count before the 150k limit and after
As mentioned in the comment of your question, Google is making some drastic changes to their collective maps API usage rates. Starting June 11th, the new pricing will go into effect.
Would the Autocomplete be considered a request on every keystroke?
As of now, places autocomplete is counted on every keystroke. Starting June 11th, you have the option to switch to session-based billing. They have different pricing rates which can be see in the pricing sheet link. Depending on your application, you'll want to use the option that minimizes API calls. I think if your use case is one time selecting of location by your users then you're better off with billing by keystroke.
Would if also be a request when we select the suggestion (Places API)
and update to Map?
Selecting a suggestion from Places API would not incur an API request (requesting the suggestions does), but updating a google map using the Map API would use an API request.
The 150k daily limit is going away in favor of the new billing rates, so I would suggest you look into that now. There are some free unlimited services still offered, like the Google Maps Embed API. Loading a map using the Embed API is not counted towards any billing (as of now).
I have been using Google Map API on my site for about a year. I use 3 Distance Matrix requests and 1 Direction API request on each map. There is only 1 map per page.
The requests/sec for the map is about 0.02. So the Distance Matrix requests are about 0.06 and the Direction API requests are about 0.02 accordingly. But for certain hours of the day, while the map requests remain at 0.02 requests/sec, the Distance Matrix requests and the Direction API request jump to extremely high level. For example, the Distance Matrix requests can be as high as 4-5 requests/sec (or 15,000 per hour!). These huge requests start 3-5 AM and end 5-8 PM central time. The page containing the map has a page view count of about 200/hour only.
This started to happen since March. Since March I have been charged by Google $1,900 for these requests. The billing support at Google said this is a technical issue. I have searched everywhere and still not sure where to get technical support from Google.
Standard plan users are not entitled to technical support. Only Premium plan customers can get a technical support from Google.
Do you use a restricted API key? The first step might be adding an IP address restriction (web services) or HTTP referrer restriction (Maps JavaScript API) to your API key to be sure that it is used only by your application.
If you believe that API key is compromised just replace it with another one and add restrictions to new key. Once deleted the old key you will see if some part of your application is broken or not.
Update
Google introduced Google Maps Platform that replaces Google Maps Premium and Standard plans. In Google Maps platform you can file support case with Google Maps support team from your cloud project.
Does the 25,000 per day map load usage limit on the Google Maps JavaScript API v3 apply to the API key or the website using it?
Here is a scenario: A developer, who has an API key, creates multiple websites for multiple clients, each with its own domain name. These websites may be shared on a single server (same IP). The code that calls the Maps API runs on the client side (in the browser). Do these sites share the 25,000 limit or each of them get its own 25,000?
Here is the Google page on usage limits (it does not make this distinction):
https://developers.google.com/maps/documentation/javascript/usage
Edit: The Google Maps API Community Support page refers users to StackOverflow for questions regarding usage. I haven't gotten any answers here yet. Does anyone know how to contact Google and ask them this question? I couldn't find any way to contact them about this.
The usage quota is applied on the per project basis.
The limit of 25K daily map loads is shared between all API keys that belong to the same project. So, if you have only one API key in your project and use it on multiple domains, all these domains will share the 25K quota.
Regarding the last question, you can reach out to Google Maps API support team and ask questions only if you have a Premium plan license. Otherwise you are stick to community support.
https://developers.google.com/maps/premium/support#contact-support
Hope this solves your doubt.
Update
As of 2019 Google introduced a Google Maps Platform and deprecated Premium and Standard plans. In Google Maps Platform there is no daily quota by default, although you can set your own daily limit in your project for each API.
Also you can now file support cases with Google Maps support team from your cloud project interface.
In order to understand usage for map loading, as:
map = new google.maps.Map(document.getElementById('map'), {
zoom: 7,
center: { lat: 42.345, lng: 12.46 }
});
I searched on Google documentation and found this:
How are map loads applied against the usage limits for Google Maps APIs for Web? A single map load is charged when [..] A web page or application displays a map using the Google Maps JavaScript API.
So, in your case, if you use your API key to load different maps on multiple websites, it will result to a unique 25,000 limit of request per day
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.
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.