I recently (like 4 hours ago) added an api key and enabled billing for Google Cloud Platform so my Google Maps Javascript API wouldn't get blocked at 25,000 places autocomplete requests. I expected to see usage statistics in Google Cloud Platform immediately but still it shows zero usage activity. Am I doing something wrong?
I think you are checking the wrong API.
Try going to Google Places API Web Service : Key features include autocomplete, search, place picker, photos and add place
OR
Google Maps JavaScript API: build and style a map onto your website.
Check the usage statistic of these two API to see the request related to place autocomplete. Hope this helps
Related
I created a site with google maps online (in javascript) .I took an api key from Google Maps, but it doesnt work, because every time i open the browser i receive an image with a message that it cann't load correctly the Google Mps. Do you know, should i have done something with HTTP referrer or with API libraries in Google Map Api's Settings??
Google's new billing and pricing model requires you to add a credit card to use even the free API's. The documentation/tutorial page which shows code examples, will provide a key, however it will not work until you add your billing info.
If you are using the Javascript API for Static Maps, it is no longer free but you can use the $200 monthly credit being offered. It should allow you over 1+ million maps loads per month.
https://cloud.google.com/maps-platform/pricing/sheet/ https://developers.google.com/maps/documentation/javascript/tutorial
Is it possible to get the following summary from the google direction service api:
There is a summary property returned by the API but it doesn't matcch the summaries on google. (see screen grab)
Google Maps App != Google Maps APIs and Service
Just to set the correct expectations, you shouldn't expect the Google Maps APIs and Web Services and the Google Maps App to work in the exact same way at all times.
The Google Maps App gathers data from many different sources, such as Wikis, local business listings or Google+ information. The Directions API on the other hand uses a mix of information from the Geocoding API with other APIs to determine the best path to a given location.
What now?
In short, you can't expect these two different things to return the same, and the Directions API is not equipped to return all the data you are looking for.
You can however try the following:
Make multiple requests (as you pointed) and use the optional alternatives parameter;
Mix you data with data from third parties, like Google does.
Hope it helps !
The google maps request is going to the Google Maps Api (javascript).
But I am getting this error message
And yes the google maps api is enabled and I have generated a key that I am using in my code.
But getting this error "This API project is not authorized to use this API", screenshot below
According to the recent changes announced on June 22, 2016
We now count Google Maps JavaScript API client-side requests towards the daily limit of the associated web service API.*
http://googlegeodevelopers.blogspot.com.es/2016/06/building-for-scale-updates-to-google.html
That means you have to enable Geocoding API in your project if you use geocoding service of Maps JavaScript API. If you use places library, you have to enable Places API and so on.
I am having this problem as well, but only on some pages within my site - on other pages, it works fine. All the pages which use the maps API use it in exactly the same way, via a shared javascript library.
I compared the network calls on pages with and without the error, and they appear to be 100% identical except for the Referrer URL (https://site.url/page/that/works vs. https://site.url/page/that/fails).
I have https://site.url in the "Accept requests from these HTTP referrers" list, and this functionality used to work on all the pages! It stopped working recently, perhaps as recently as this weekend, yesterday, or today.
Are you appending the maps script by hand on your website, or using a plugin? Can you send here your website URL?
Anyway, here it is how to append the API key:
Let's assume that you have the following piece of code
<script async defer src="//maps.googleapis.com/maps/api/js" type="text/javascript"></script>
To append the apy key, you must add ?key=YOUR_API_KEY at the end of the src path, like this:
<script async defer src="//maps.googleapis.com/maps/api/js?key=YOUR_API_KEY" type="text/javascript"></script>
If, instead, your src path already has some appended parameters (for example, "//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"), just add &key=YOUR_API_KEY at the very end:
"//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&key=YOUR_API_KEY"
This is how you append the API parameter (obviously, replace YOUR_API_KEY with your API key code).
You can find more information on obtaining a google maps key at https://developers.google.com/maps/documentation/javascript/get-api-key
Your API key should be up and running within 5 minutes. Enjoy!
To make it work
we need to use Google Maps Geocoding Api and Google Maps Javascript Api
I was unfortunately using only the javascript one.
It's working fine now.
I'm trying to clarify the usage limits for Google Maps services (e.g. Places, Directions, etc) when used with the Google Maps Javascript API.
According to the official documentation
The JavaScript Maps API V3 is a free service, available for any web
site that is free to consumers
and
For-profit web sites are permitted to generate up to 25 000 map loads
per day using the Google Maps JavaScript API v3.
Now each Google Maps service API has its own usage limits:
Places API allows 1,000 or 100,000 (if you're verified) requests per 24
hours.
Directions API allows 2,500 requests per day
In my web app I'm using the places library and direction service via the Javascript API. Do the usage limits for each service apply when used with the Javascript API? The documentation doesn't make that clear.
Yes. The usage limit for Google maps APIs affects only when your site gets more traffic.
Each API has its own usage limitation.
Google Geocoding Service: 2,500 requests per day
Google Maps Javascript API : up to 25,000 map loads per day for each
service.
This includes:
a map is displayed using the Maps JavaScript API (V2 or V3) when
loaded by a web page or application;
a Street View panorama is displayed using the Maps JavaScript API (V2
or V3) by a web page or application that has not also displayed a
map;
a SWF that loads the Maps API for Flash is loaded by a web page or
application; or
a single request is made for a map image from the Static Maps API.
a single request is made for a panorama image from the Street View
Image API.
If you think that your site exceeds these usage limit, then you should consider to purchase a Maps API for Business license.
Check the following sites for additional information:
Understanding how the Maps API usage limits affect your
sites
What usage limits apply to the Maps API?
Hope that the above information helps you.
Below are the details about Maps JS API - Billing. I checked with chat support. Hope this helps some one
Once we enable billing we will have free 28500 map loads each month ($200 free credits each month). Reference link: https://mapsplatform.google.com/pricing
If we haven’t enable billing we will not able to use this feature once our free credits are over
Once we enable billing we have the possibility for the following
a) We can set a limit for our daily usage. Reference link: https://developers.google.com/maps/optimization-guide#consumption_optimization
b) We can track our usage
One page load will be considered as one map load
I'm working on a website using the Google Maps Javascript API v3.
The free version of the API is limited by 25000 requests a day. But what happens if this limit is reached?
Is there a way to detect that the request limit has been reached so a fallback Google Maps Image API map can be displayed instead?
The usage limit is based on site or application, not the client IP address.
You can use the Google API console to monitor your usage if you add an API key to each of your map requests. I have not seen a way to query the usage programmatically.
https://code.google.com/apis/console
Per the comment below by #alds, it does appear that JS Maps API v3 and Static Maps API are separate services, therefore having separate request limits. Falling back to a static Google map image could help.
This also explains the usage limits in better detail:
http://googlegeodevelopers.blogspot.com/2011/11/understanding-how-maps-api-usage-limits.html
You cannot detect via the API that the request limit has been reached. There are no events that are fired and the API does not expose a function or property to determine that the API quota has been reached.
Google has decided that this is not a feature they will implement.
https://issuetracker.google.com/issues/35830575#comment12
#kilogauss I would disagree that falling back to static Google Map is not an option.
According to https://developers.google.com/maps/faq#usagelimits
"Web sites and applications using the Google Maps API may at no cost generate up to 25,000 map loads per day FOR EACH service" (capitalization and boldface mine).
And on https://developers.google.com/maps/faq#usage_pricing, you can see that JS Maps API v3 and Static Maps API are separate services.