Hello guys,
I'm facing the "Rate Limit Exceeded" error with Adsense management API. The problem clearly isn't with daily request quota, since I make very few requests and the overview in the Google API console also says the quota is fine, currently I see 3% of daily quota used and the requests per second chart shows maximum average requests per second for last day as 0.0444 requests/sec. At the time I'm writing this, it's about 9 hours until midnight PDT and I'm getting the error.
The error starts appearing at random times every day (usually just 1-2 hours before midnight, but sometimes as early as today, 9-10 hours before the end of the day) and disapears about 45 minutes after midnight PDT, effectively blocking me from generating any report through API until the quota reset at midnight. I have also set the Per-user limit to 10 requests/second/user (even though I'm not sending more than one request every few minutes) but it didn't help.
Does anyone have any clue how could I fix this and what could be the problem? I have absolutely no idea why this happens since I'm not sending many requests at once, and also not using the allowed 10000 requests/day quota almost at all, reports at developer's console say that the average is about 500 requests/day.
Thanks to all for any input.
Even when I tried to push the request directly through the Google API console, I'm getting the error.
...
I have also set the Per-user limit to 10 requests/second/user (even though I'm not sending more than one request every few minutes)
while True:
events = cfg_vars.service[cal_servicelist].events().list(
calendarId = cal_GCAL_ID,
maxResults = 100000,
showDeleted = False,
pageToken = page_token
).execute()
page_token = events.get('nextPageToken', False)
tokennumber += 1
# sleep(2)
...
Thanks for the suggestion, I'll try to add some sleep function, even though I'm not convinced that it will help, since I never send more than 2-3 requests at once and the limit is set to 10 requests per second.
However the backoff is out of the question, when I start getting the error, it doesn't stop until the next midnight, no matter how long I wait between API requests.
Hello Sergio,
yes, that's how it looks, however I have raised the limit of requests/second/user to 10 which is the maximum and recently, as galeksic suggested, I have also added a 2 second sleep time between each API request and it still didn't help. And also, I'm never sending more than 3 requests at once, so the requests/second/user should be more enough. At this point, I am also the only one who uses the application which makes use of the API, so there's only me requesting 2-3 API requests through the web application once per hour and still it sometimes ends up with the rate limit exceeded error...
By the way, is there any way how to avoid the need of every message that I post to be manually reviewed by the moderator before it's posted? It takes a day or two before my messages appear here in the group.
Thanks.
Claus
I see... Well, it depends on what "very large" is, but I'm mainly getting current day report for page views, clicks, CTR, CPC and earnings. It's true that all stats are going up very fast in the last 1-2 months as we are getting more traffic and page views so you might be right here. On the other hand, it's not that big, I don't want to break Adsense rules so I won't disclose any number just in case, but I think any popular blog or some similar site can reach the number of page views that we have, so it's not anything extreme.
Anyway, does it mean that if the report is large, I have no way how to get it through the API without triggering the rate limit? I.e. the the rate limit is triggered when I'm trying to get a report for more than some specific number of page views?
Also I would say that the only report that triggers this error is report for today. I never had problems with report for the whole last month for example. As I am thinking about it, this is something that I might try to test next, I haven't tried if other reports besides today's report work when the today's report returns rate limit error.
Thanks,
Claus
Hello Sergio,
have you received my email? Because I didn't get anything back from you since I sent the email, maybe it ended up in your spam folder? If you don't have it, I can resend it.
Thanks and sorry for the inconvenience,
Claus