google maps geocode: I get a new API key and it claims it's invalid - google-maps

I have a geocode library (makeKML.pm at MarginalHacks.com) which uses the Google Maps geocode API. It has stopped working because it was using v2 requests, so I've switched to v3, and I'm told my API key is invalid. So I login to their disastrously confusing cloud console and finally figure out how to make a new server API key. Again I try a request with the new key:
https://maps.googleapis.com/maps/api/geocode/xml?sensor=false&address=659+Valencia+St%2C+San+Francisco+CA&key=<<<my new API key here>>>
I keep getting:
<?xml version="1.0" encoding="UTF-8"?>
<GeocodeResponse>
<status>REQUEST_DENIED</status>
<error_message>The provided API key is invalid.</error_message>
</GeocodeResponse>
Any thoughts on what's going on, or how I can ensure that I'm using the right type of API key? I've turned on the Google Maps Geocode API in the cloud console and registered a new web app which is where I'm getting the server key I'm using.

Your query works without a key
There is no key parameter to the Google Maps Geocoding Web Service; the documentation does state: "Maps API for Business users must include valid client and signature parameters with their Geocoding requests", but that is additional cost (a contract with Google), and not a "key".

Related

Google Maps API not authorized from Flutter app

I'm fairly new to all this so any help is gratefully received. I have a flutter app that calls the Google Maps API. To call the API I pass it my Google API key and in order to try and make it secure I have set up application restrictions in https://console.cloud.google.com/
The problem is that now when I call the Maps API I get the follwoing error:-
This IP, site or mobile application is not authorized to use this API key
Below is a screenshot of the settings that I have applied. What have I done wrong?
UPDATE: Some more information
The relevant APIs are enabled. The SHA-1 Fingerprint is correct. My app is running in debug mode, the certificate is the debug one. If I unrestrict the API key then everything runs okay.

Does google API client Id and static map key both are same?

Background:
We are using static map in our MVC Application.
Url : http://maps.google.com/maps/api/staticmap?center={0}&zoom=13&markers=color:red%7Clabel:%7C{1}&size=500x350
It was working fine but from last few days, I am receiving an exception saying "The remote server returned an error: (403) Forbidden"
After reading few links, I got know that now google api needs api key for static map. But I am having some client Id, crypto key but not API key.
can we use static map without key?
Does client Id and api key are same?
The client ID and cryptographic key is used with Premium plan license of Static Maps.
The API key is used with Standard plan version.
You can authenticate Static maps calls with client ID and digital signature as described in the documentation:
https://developers.google.com/maps/documentation/maps-static/get-api-key#client-id
I hope this helps!

ERROR: Google Maps API error: MissingKeyMapError

The following JavaScript error suddenly appeared:
Google Maps API error: Google Maps API error: MissingKeyMapError
Yes. Now Google wants an API key to authenticate users to access their APIs`.
You can get the API key from the following link. Go through the link and you need to enter a project and so on. But it is easy. Hassle free.
https://developers.google.com/maps/documentation/javascript/get-api-key
Once you get the API key change the previous
<script src="https://maps.googleapis.com/maps/api/js"></script>
to
<script src="https://maps.googleapis.com/maps/api/js?libraries=places&key=your_api_key_here"></script>
Now your google map is in action. In case if you are wondering to get the longitude and latitude to input to Maps. Just pin the location you want and check the URL of the browser. You can see longitude and latitude values there. Just copy those values and paste it as follows.
new google.maps.LatLng(longitude ,latitude )
As per Google recent announcement, usage of the Google Maps APIs now requires a key. If you are using the Google Maps API on localhost or your domain was not active prior to June 22nd, 2016, it will require a key going forward. Please see the Google Maps APIs documentation to get a key and add it to your application.
All Google Maps JavaScript API applications require authentication( API KEY )
Go to https://developers.google.com/maps/documentation/javascript/get-api-key.
Login with Google Account
Click on Get a key button
3 Select or create a project
Click on Enable API ( Google Maps API)
Copy YOUR API KEY in your Project: <script src="https://maps.googleapis.com/maps/api/js?libraries=places&key=(Paste YOUR API KEY)"></script>
Update django-geoposition at least to version 0.2.3 and add this to settings.py:
GEOPOSITION_GOOGLE_MAPS_API_KEY = 'YOUR_API_KEY'
The same issue i was facing couple of months back and that is because end of free google map usage effective from i think June 11, 2018. Google does not provide free google maps now. You need to have a valid API key and valid billing used, which may give you 200$ of free usage.
Refer link for more details: Google map pricing
Follow the process here to get your api key.
If you are upto using only maps with specific user, you can try other map tools.
The script element that loads the API is missing the required authentication parameter. If you are using the standard Maps JavaScript API, you must use a key parameter with a valid API key. If you are a Premium Plan customer, you must use either a client parameter with your client ID or a key parameter with a valid API key.
See the guide to API keys and client IDs.
you must create a project and collect the key in this way:
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=en&key=()"></script>

How do I provide API key when initializing Google Street View in JavaScript?

"Static" Street View documentation says that all request should have an API key added. There is also description how to add it. But looking at JavaScript SV documentation there is no mentioning of API keys. Is using API keys with "dynamic" SV required? How do I add them to my requests?
It is not required but you should according to Google:
All Maps API applications* should load the Maps API using an API key. Using an API key enables you to monitor your application's Maps API usage, and ensures that Google can contact you about your application if necessary. If your application's Maps API usage exceeds the Usage Limits, you must load the Maps API using an API key in order to purchase additional quota.
Here is the link on using the API Key

Google maps: how to generate a key for Google Maps v2?

I have an old website that uses Google maps v2. Previously the website was running under http://domain1.edu. Now it is runs under http://domain2.edu. It appears that I need to update the map key.
On the internet, I was looking for how to do this. I find incomplete info at Google's own website. Here is the link for v2 map key: https://developers.google.com/maps/documentation/javascript/v2/introduction?csw=1#Obtaining_Key
It says:
To create your API key, visit the APIs Console at https://code.google.com/apis/console and log in with your Google Account.
Click the Services link from the left-hand menu, then activate the Google Maps API v2 service.
Once the service has been activated, your API key is available from the API Access page, in the Simple API Access section. Maps API applications use the Key for browser apps
First, I am unable to find "Google Maps API v2" service mentioned above. I am able to find Google Maps API v3, and so I enabled it. I used the key mentioned at https://developers.google.com/maps/documentation/javascript/tutorial#api_key
However, the website key is still not working.
Here is the page with Google map: http://nmai.si.edu/nafvf/attend.aspx
Anyone knows how to fix this?
Thanks and regards!
You are using the deprecated Google Maps Javascript API v2, those keys are no longer available (as the documentation you point to indicates). You need to use a v3 key, and make sure you have the referrers set correctly for that key (you really should update your map to use the v3 API...)
working example (copied from Mike Williams' v2 tutorial, just changed the key)
This link says how to generate the key for android. You need to get the SHA1 of your signing key and then gotto google console to generate the key.