What is the need for API key? - google-maps

The tutorial for Google maps API states that an API key is required for making calls to the API. The example given on the page however does not use an API key. So why would'nt someone choose to make the call without an API key and not worry about exceeding any limits?
Thanks,
Yash

Since version 3 you the API key is not mandatory anymore. You still can provide one though to track your usage because the limit still exists. See also this answer.

Related

Whenever I use an google maps API key it doesn’t work

I can’t seem to use they API key I generated when running the android emulators. The very first app I made with any API key I generated works but anytime I make a new app and plug in the API key it doesn’t work. It says it’s having trouble with google play services. Anyone know how to fix this?
It seems that the API key is restricted to your first app where you used the API key, I would suggest that you use new API key for each app that you make as this will also help you track your usage for each app that you make.
You may also see the API key best practices to help you in restricting your API key to avoid unexpected usage.

Which API key is needed to use Google Maps API?

Here is the link I'm trying to access:
https://maps.googleapis.com/maps/api/place/textsearch/xml?query=restaurants+in+Sydney&sensor=true
According to some documentation on Google.com, it doesn't look like an API key is needed for their Maps service anymore. Can anyone see why the link I posted above wouldn't work?
If it does need an API key, could someone specific which API key is needed from Google?
In this case you should add a key
Required parameters
query — The text string on which to search, for example: "restaurant". The Place service will return candidate matches based on this string and order the results based on their perceived relevance.
key — Your application's API key. This key identifies your application for purposes of quota management and so that Places added from your application are made immediately available to your app. Visit the APIs Console to create an API Project and obtain your key.
sensor — Indicates whether or not the Place request came from a device using a location sensor (e.g. a GPS) to determine the location sent in this request. This value must be either true or false.
https://developers.google.com/places/documentation/search
Not exactly. Some of their APIs to not require keys with each request, but you must still authenticate. From their developer docs:
All Maps API applications* should load the Maps API using an API key.
You can read about the different APIs and their requirements here.

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.

Using google maps API with varied domains

Ok, so I have a site that uses the google maps API, and I want to serve it from more domains. The fact that the API key is tied to a domain greatly hinders my efforts on this front.
Is there any solution more elegant than getting a key for every domain?
There is one way you can avoid using the API key completely - use the version 3 API.
The v3 API is still in 'beta' but it has the key (no pun intended) functionality that most people use for their maps and there are no keys required. Nor will there be in the future according to Google. If you can get by without features like draggable markers, then v3 will work well. I use it for my primary map page and have no problems with it.
You can set up a proxy. But obviously that will complicate your code, and it's your responsibility to make sure only your domains can access the proxy.