Google Places API Invalid request - google-maps

I've started looking into Google Places API recently and have enabled the API through my Google Developer Console. I tested the API through the following URL in my browser (please note that I have intentionally changed my key below):
https://maps.googleapis.com/maps/api/place/textsearch/xml?query=hotel&location=43.683308,-79.614296&radius10000&key=thisismykey478erjr84
Worked fine, I got back the XML, but when I tried it again I got the following:
<PlaceSearchResponse>
<status>INVALID_REQUEST</status>
</PlaceSearchResponse>
Now, as far as I know I'm given a courtesy limit of 1,000 requests/day. I know I did not go over 1000 requests. I figured maybe I'm only allowed a certain number of requests per hour or per minute so I waited.
Next day same problem! And today as well.
Not sure what to do in this case, any advice?

The radius parameter is missing the = separator. Try radius=10000.

Related

Zoopla API returns <h1>Developer Inactive</h1>

I've been trying to use Zoopla's property search API a few days now. First day I used the API, it was straight forward. I registered for a new key, and could do requests via the documentation. Starting yesterday, all the requests I would do would always return a 403 response with the body <h1>Developer Inactive</h1>.
I tried creating a new API key but the problem is still the same. Is anyone using the API that can share some knowledge about it? Seems to be deprecated, but I cannot understand how I was getting results from it without issues for a single day.
https://developer.zoopla.co.uk/docs/Property_listings
Ive just hit the exact same issue, trying to create an app using the API, worked great on the first day, but since coming back to my project today it no longer works!
It appears the API is dead and no longer maintained - https://medium.com/#mariomenti/how-not-to-run-an-api-looking-at-you-zoopla-bda247e27d15
Very frustrating.
The API is in the process of getting shut down and moved to a new solution.
When signing up to the API, it does not tell you this, which is strange.
When you sign up, the API key will die after 24 hours. However, if you email help#zoopla.co.uk with your email address and API key, they will reinstate the API access.

Google places API RefererNotAllowedMapError

I know I have to set the credentials I have done so, I have waited about half an hour between credential change, I've tried many domains, ports, and I still get the RefererNotAllowedMapError
These are the values I've set in my API key credentials properties:
https://gist.github.com/onzag/23b01979d9bd99c749d8a998c4fa841d
I've tried no value at all, I've tried even an open api key with no restrictions at all (which gives a different error and says that it's expired); I've created a couple of dozen api keys with different combinations, no luck.
I've tried exact paths, without wildcards, different domains, I've removed the protocol; I've read every single trick I can find online and nothing does the job.
Does anyone have an idea? Do I need to create a new developer account?...
I figured it out for anyone else struggling with a impossible to fix RefererNotAllowedMapError, it has nothing to do with your credentials, at all, you are forced to enable google maps javascript API even if the development guide says that places is an independent API from maps.
The error is totally misleading there's nothing wrong with your credentials.

google maps requests are forbidden with a status of 403 after working very well for at least a day

I am using the Google Maps Javscript Api, v3 and everything is working well up to a point where the requests for the map images are forbidden with a status of 403. Usually the map stops loading after a period of time in which the page/session is open: it may be 24 hours, it may be more than 48h, I couldn't actually find a more accurate period.
Given the fact that we want to have a live website and a testing one – different domains, I generated 2 different keys, and I am loading them conditionally, but the html rendered is the one expected.
var mapKey = VanillaRate.Domain.Settings.AppSettings.GoogleMapsApiKey;
and the script tag is:
script src="https://maps.googleapis.com/maps/api/js?key=#(mapKey)&libraries=places" async defer
The usage limits were not exceeded, the referrer is well set.
The error appears when the map is zoomed and it's:
Failed to load resource: the server responded with a status of 403 () - maps.googleapis.com/maps/api/js/StaticMapService.GetMapImage?....
Since I couldn’t find any exact posted situation nor documentation about it, it is possible to be a timeout on google servers for security reasons and this is why the requests are forbidden for a session longer than a day?
EDIT: I forgot to mention that after refreshing the tab, everything works well. If it was indeed the usage limit, would the server respond with success after refresh? I've read that in this case, the map wouldn't work all day. Is that right?
If the response is still a HTTP 403 (Forbidden) error, the signature was not necessarily the problem, it may be related to usage limits instead.
This typically means your access to the web service has been blocked on the grounds that your application has been exceeding usage limits for too long or otherwise abused the web service.
I find this answer on google developer. There is no simply way to resolve this problem. Google recommended two solutions:
Reduce requests to the server;
Or, 'purchasing additional allowance for your Google Maps APIs for Work license.'
You can also try to access to the the Google Cloud Support Portal to signal your problem.
I find this informations in google developer here. You can find on this link some solutions like I detail to you and the explanation of your problem.
"The usage limits were not exceeded"
Are you sure? You're loading the places library, in which case this applies:
Google Places API Web Service
Default 1,000 free requests per day,
increased to 150,000 free requests per day after identity
verification.
https://developers.google.com/maps/pricing-and-plans/
See also:
https://developers.google.com/places/web-service/usage
https://developers.google.com/maps/documentation/javascript/places#UsageLimits

Google Place Reviews API - Photos return 403 on pageload

I'm currently using the Google Places API to pull reviews onto a webpage. Everything is working fine except for the Photos of the people leaving reviews. When trying to get the photo of the reviewer, it's returning a 403 Forbidden on every other page load. It seems that there might be a rate limit perhaps?
The problem is I can't find any documentation about rate limits and how to get the picture to display without issue. Am I missing something in the docs?
My API call is this;
https://maps.googleapis.com/maps/api/place/details/json?placeid=PLACE_ID&key=API_KEY
That returns quite a long JSON array (I've cut it down). One of those fields is;
{
"result" : {
"reviews" : [
{
"profile_photo_url" : "//lh5.googleusercontent.com/url/photo.jpg"
}
}
}
}
Like I said, if I refresh a couple of times it'll cause a 403 error for the images get request. Anyway to cache or allow more requests?
I found out why this was happening. It's to do with rate limits on the photo media which is why it was giving a 403 error in the console. The developer docs outline the limits for the media requested.
An excerpt of the docs...
The Google Places API Web Service enforces a default limit of 1,000
free requests per 24 hour period, calculated as the sum of client-side
and server-side requests. If your app exceeds the initial limit, the
app will start failing. You can increase this limit free of charge, up
to 150,000 requests per 24 hour period, by enabling billing on the
Google API Console to verify your identity. A credit card is required
for verification. We ask for your credit card purely to validate your
identity. Your card will not be charged for use of the Google Places
API Web Service.
Best thing to do is to cache the media once it's requested to avoid going over the limit which is especially useful if you're reloading the page lots of times for testing local development changes.

Google Map API key expires

I have generated a Google Map API Key using Google console and currently that has 'None' restriction. It works fine and I am able to consume Google Places API without any problem. I am using Ionic framework and my application is purely based on HTML and AngularJS (JavaScript).
Now as my key works as expected for some duration, it stops working all of a sudden after sometime. Google service returns 'UNKNOWN ERROR' as response for all calls. To resolve this I need to generate another key and without code changes everything works fine. I have used URL https://maps.googleapis.com/maps/api/js?key=AIzaSyDgM6rXXXXXXXXXXXXXXXXXXXXTA68vY5g&callback=&libraries=places and pasted it in browser and copied the content of the generated JavaScript in a file and referring it locally. Also FYI, I don't have any server side code with me.
Now I have precisely 2 questions.
Do I need to change my Google API key every week to keep it active? Or once the restriction is set to 'Android' or 'HTTPS' then the key will work as long as I want?
If I publish my app in Android store is it safe to place the Google API Key in app files (JavaScript or HTML)? Is there a better way of doing it? Google best practices says we should keep it outside root, but then how should I do it?
You might not have billing enabled on your project.
Without billing enabled you only get 1,000 free requests per 24 hour period (calculated as the sum of client-side and server-side requests).
After you enable billing you get up to 150,000 requests per 24 hour period free of charge.
It might be slightly confusing that JS API Places library usage counts against the Places API limit, but that is the case: the daily usage is calculated as the sum of client-side and server-side requests combined.