Google Places API OVER_QUERY_LIMIT - google-places-api

I'm working on a script which sends a few hundreds of API calls to Google Places API using the [nearbySearch]. After a few requests, I quickly get an OVER_QUOTA_LIMIT error.
In Google Cloud Console, I can see the requests made in the last days or hours but:
I'm a far cry from the 6 000 requests/minutes limit
I don't see any Quota Exceed Error in the graph
(https://developers.google.com/maps/documentation/javascript/places#place_search_requests)
If I scroll down a bit, I can see that there's apparently a "Premium Plan", but no request have been made up to now.
Now I can see that the Premium Plan is not available anymore for sign up or new customers..
So I guess it's just a graph to support people who have previously signed for this plan but that it is not relevant in my case.
My payment settings have been set up correctly so I don't understand what's happening here.
Thank you so much.

Related

Google Places API and Measurement of Quota Requests

I wonder if someone else has experienced the same issue, and might have an answer to it.
I am using the Google Places API. There I do two kinds of requests
https://maps.googleapis.com/maps/api/place/textsearch/
and
https://maps.googleapis.com/maps/api/place/details/
After I have done about 20,000 of these requests my Quota of 150,000 has been eaten up, and I do get an error message.
The strange thing is, when I look at the Google API Console I can see the following:
In the API & Services Section I can see the following (which reflects the real requests I have done)
and in the IAM & admin section I do see a much higher value
This looks artifically high, and is limiting the service way to early.
Does anyone else have the same issue?
I figuert out, why there is this difference in request in the API view and requests in the Quota view.
When using the TextSeach Places API, each text search request, will be multiplied by a factor 10 towards your free contingent.
it is mentioned at this page:
TextSearchRequests

zagat content in the Places API - ERROR

I am many errors on my Maps API Console.
I am the website owner, not the developer or webmaster.
Got an email from Google about new pricing. Below is the email.
Today we are announcing important changes, including our new name - Google Maps Platform, a simplified product structure, pay as you go pricing for all, and more. Please take a few minutes to review the announcement to familiarize yourself with the upcoming changes.
We would like to highlight a few updates that may impact your implementation. Beginning June 11th, we are launching our new pricing plan and providing all users access to support. We’ll continue to offer a free tier — all developers will receive $200 of free monthly usage of our core products.
How does this affect your current account(s)?
Based on your usage over the last 3 months and our new pricing plan, we estimate that your monthly cost will exceed the current $200 free tier.
I am trying to figure out why I have so many API calls.
I am seeing in the console, that in the "Google Places API Web Service" I have alot of "Zagat content in the Places API" calls, and they all result in error.
I am trying to figure out how this is happening, but not finding any info online. I see that the "zagatselected" parameter was discarded May of 2017. I can not figure out what is causing these errors.
Everything has been working fine, I have my own API key, and have for a long while. The only reason I am really looking into this, is because Google will now start charging me monthly.
Is it possible you expose your Maps API key to the client, don't have any restrictions on it, and someone else is calling the API/raising those errors?
If you have a snippet of code like this....
<script src="https://maps.googleapis.com/maps/api/js?key=[APIKEYHERE]&libraries=geometry,places&callback=initialize">
...on a public web page, it would be easy for someone else to take the API key and use it themselves, unless you add a IP or referrer restriction to only allow it to be used client-side from your website. You can set up restrictions on who can use your API key following these instructions.
I suspect that the new Google Maps and Places API pricing scheme (which significantly lowers the number of free Places API calls) might cause some less ethical users to use keys they can scrape off websites.

Extending YouTube API Quota with limited funds

With a simple java program, I send GET requests using YouTube Data API specifically videos.list, in order to get the public metadata of a video and store it as .json files.
For my universities research, we have to do this with all available YouTube video IDs provided in the Youtube-8M Database.
Therefore, I would like to know if there is a way to extend the available quota for requests (I already know about the billing option, but I am a student and my university is small).
I have read the YouTube API terms, which states that only one project per client may be used to send such requests with the necessary API Key.
If I understand it correctly, even my simple java code is such a client.
In some other Stack Overflow questions about extending ones daily quota with API Keys, some suggested creating multiple accounts or projects.
Is this a legal option or not? Or is there another possibility to get a higher quota for simple requests used in research like I do right now?
If you go to the Google Developer console where you enabled the YouTube API. the second tab is called quota
Click the pencil next to which ever quota it is that you are blowing out. A new window will pop up with a link called apply for higher quota.
Fill out the form to apply. To my knowledge you do not have to pay for additional YouTube quota but it can take time to get approved. Make sure you comply with everything on the form.
I have never heard of the one project per client term. Technically you can run your application using different API Keys it should work fine. Technically there is nothing wrong with creating additional projects on Google Developer console. You don't need to go as far as creating another Google account.

Change the "queries per second per user" allowed for Google Analytics API

I'm getting an error 403 userRateLimitExceeded when trying to use my Google Analytics API to fetch data for more than one site at a time.
The documentation tells me to set QPS (queries per second) to 10 in the developer console. I can't find this setting anywhere.
How can I set the QPS for my Google Analytics API to 10?
In the Google developer console go to the API manager over view. click the quota tab and then the little pencil thing.
default is one request a second. you can set it up to 10
Tip: if you are still having issues look into sending quotauser you can trick it a little by sending a random number with each request.

Garb request to Google Analytics fails from home ISP, but works elsewhere

I'm trying to use the garb gem to access data from the Google analytics API and find that http requests using garb work just fine from a Linode account, but are refused from home (Comcast). Is Google rejecting some kinds of http requests from certain ISPs, or am I just doing something wrong? Simple example is below:
require 'garb'
Garb::Session.login('XXXXXX#gmail.com', 'XXXXXX')
#profile = Garb::Profile.all.first
#report = Garb::Report.new(#profile)
#report.metrics :visits
puts #report.results
This give => [#<OpenStruct visits="21">] on my Linode, but the exact same thing run from my home ISP gives:
Garb::DataRequest::ClientError: "<errorsxmlns=.........
Which is raised here in garb:
def send_request
response = if #session.single_user?
single_user_request
elsif #session.oauth_user?
oauth_user_request
end
raise ClientError, response.body.inspect unless response.kind_of?(Net::HTTPSuccess)
response
end
The initial session login works just fine from both IPs. The error is only thrown when results are requested. Is there anything I can do to fix this? I haven't (yet) verified that I get exactly the same behavior going through clientlogin/data requests by hand. I'm pretty convinced it is not a gem issue, but an IP-related one--perhaps something to do with Google web services quota policies--but I'm willing to entertain all possible solutions.
Thanks,
Orion
You've probably made too many calls to google in a short space of time. I haven't seen it happen with Garb, but I've seen it happen when using an API to scrape search results pages. Google notices and flags your IP. Try browsing to google.com and running a normal google search from the ip that's blocked, you'll probably be required to enter a captcha. They probably block API calls from that IP at this stage, you'll get cleared eventually after a few days I think.
Jeremy's probably right.
Google Analytics API has multiple quotas you need to worry about. See here their list here. I've hit the 10 queries per second per IP address quota and/or the 10 concurrent requests per profile before. I also saw 4 concurrent requests per IP address somewhere.
You should post the full error message Garb gives you next time, since those have actually helped me figure out what caused it in the past.
Also, these quotas are for projects sending registered API keys along with their requests. If you're not, the quotas are much lower. I hit the quota for an unregistered project before. Registering your project is fairly easy, and you just add the following line
Garb::Session.api_key = 'API_KEY'
to your code (I'm using Sija's fork) before the Garb::Session.login line.
Another thing, once you register your project, go to Quotas page on the API console and click the "Set per-user limits" and up that from the default 1.0 to the max 10.0 requests/second/user. If you click "Request more" they give some tips for optimizing your calls/timing as to not hit the limit.

Resources