Adsense Management API "Rate Limit Exceeded" error - google-api

I'm facing with "Rate Limit Exceeded" error with Adsense management API every day around midnight (PDT), when I say around, I mean both before and after midnight. 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 4 requests used out of 10000.
However, even when I tried to push the request directly through the Google API console, I'm getting the error. The response shown when I send request through the API explorer in the API console is: "domain": "usageLimits", "reason": "rateLimitExceeded", "message": "Rate Limit Exceeded"
The error appears every day 1-3 hours before midnight and disapears about 45 minutes after 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)
Does anyone have any clue how could I fix this and what could be the problem?
Thank you.

Related

What's the http status code if a site key exceeds 1000 QPS for recaptcha?

in recaptcha document, it says that if a site key exceeds 1000 QPS, then some requests may not be processed, I am wondering how I can identify this error if this happens? I assume a http code of 429 is thrown by google server?
The reCAPTCHA-specific quota page links to a more general Google API quota page that says
If you exceeded a quota with an HTTP/REST request, Google Cloud returns an HTTP 429 TOO MANY REQUESTS status code.
If you exceed a quota with an API request, Google Cloud returns an HTTP 413 REQUEST ENTITY TOO LARGE status code.
If you exceeded a quota using gRPC, Google Cloud returns a ResourceExhausted error. How this error appears to you depends on the service.
If you exceeded a quota using a Google Cloud CLI command, the gcloud CLI outputs a quota-exceeded error message and returns with the exit code 1.
Since you mention HTTP, I imagine you're in one of the first two categories. If you're going through their REST interface, you'll get 429. If you're going through the API, you'll get 413.

Suddenly getting 403 from YouTube data-API

I am suddenly getting a 403 error when sending requests to YouTube's data-API.
This is the error I am getting in production for all requests:
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. YouTube Data API has not been used in project 944988770273 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=944988770273 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"extendedHelp": "https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=944988770273"
}
],
"code": 403,
"message": "Access Not Configured. YouTube Data API has not been used in project 944988770273 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=944988770273 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
}
}
I haven't done anything do disable the keys, and the dashboard still says the project and key is enabled?
This seems to be due to YouTube setting my daily limit to 0 for some reason, effectively "banning" the usage on the current project in use.
If this happens error-message happens to anyone, remember to check the quotas for the project.
I filled an issue on Youtube Bug Tracker related to it. The feedback was:
This means that your project’s access to YouTube Data API Service has been disabled.
Please fill out and submit the exceptions form below: https://support.google.com/youtube/contact/yt_api_form?hl=en
No reasons why.

YouTube Data API units per day limited to 0

I am trying to implement the YouTube Data API v3 in my Python project. However it seems that I always get a error with usage limits.
Here is the specific error I am seeing:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. YouTube Data API has not been used in project 236433974813 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=236433974813 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"extendedHelp": "https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=236433974813"
}
],
"code": 403,
"message": "Access Not Configured. YouTube Data API has not been used in project 236433974813 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=236433974813 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
}
}
The console says 0 quota (I cannot post images due to low reputation, but it says this when looking at the quotas.)
I have the free trial activated.
You need to first go to the GCP console and activate the YouTube Data API for your project. You must do this for each API in each project.
https://console.cloud.google.com

Google Calendar API : "Backend Error" code 503

When I use the Google calendar API to create a new Calendar, I randomly get "Backend Error". Do you have any idea why ? Have you experienced the same behavior ?
First request :
POST https://www.googleapis.com/calendar/v3/calendars Authorization:
Bearer ya29.UQEd-xxx
Content-Type: application/json; charset=utf-8
{"summary":"My new calendar name"}
Google answer (around 20 seconds later):
{ "error": { "errors": [ { "domain": "global", "reason":
"backendError", "message": "Backend Error" } ] "code": 503, "message":
"Backend Error" } }
The calendar is not created
Another request :
POST https://www.googleapis.com/calendar/v3/calendars Authorization:
Bearer ya29.UQEd-yyy
Content-Type: application/json; charset=utf-8
{"summary":"My new calendar name"}
Google answer (around 5 seconds later) : 200
The calendar is created
503 Service Unavailable
The server is currently unavailable (because it is overloaded or down for maintenance). Generally, this is a temporary state.
503 is a standard HTTP error that happens sometimes. Google ops probably has a graph somewhere showing the frequency of the errors and depending on their priorities may be working to fix it. You should catch the error and either give a human the chance to retry or implement exponential backoff.
Google Apps Calendar Resource API Limits and Quotas
For all errors that are time based (maximum of N things for N seconds per thread), especially the 503 status code errors, we recommend your code catch the exception and, using an exponential backoff algorithm, wait for a small delay before retrying the failed call.
https://twitter.com/googlecalendar/with_replies
Yes google calendar services are currently unavailable. Confirmed from twitter.
For people visiting this in the future, I think that a 503 error can also be thrown when there are an insane number of events and Google Calendar simply chokes on them. I had a event that somehow got duplicated 18k times on a single day and event trying to use events.list with a maxResults of 1 resulted in a 503 error.

Intermittent Http Error 403 When Invoking Google Custom Search API

I'm getting the following error intermittently when invoking the custom search api from a server side setup:
HttpError 403 when requesting https://www.googleapis.com/customsearch/v1?q=John+Doe+john%40simpler.com&alt=json&cx=&key= returned "There is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your API key configuration if request from this IP or referer should be allowed.
I'm using a server api key, and have confirmed that the configured server ip address is correct. And about 50% of the time my request come back fine, too. I'm issuing the request from the server like this:
service = build("customsearch", "v1",
developerKey=api_key)
custom_search_context = <my_context>
res = service.cse().list(
q=search_query_string,
cx=custom_search_context,
).execute()
My requests per sec are well with in the configured limit of 10/sec and daily purchased limit of 5000 requests.
One more thing I noticed is that Google counts a forbidden request towards the daily limit, too.
Any pointers on why I'm being presented with the error only intermittently would be very helpful
The error can be raised when you're exceeding a request/second limit. Can you confirm that your request rate is below your configured user rate limit? It might be worth noting that the limit is enforced even if you don't explicitly provide a user value in your requests.

Resources