Getting Quota Exceeded on calling the Google Photos API. What are the actual quotas? - google-photos

I am uploading photos to Google Photos and placing them in Albums via the Photos Library API.
Every now and then, I get an error "Quota exceeded for quota metric 'Write requests' and limit 'Write requests per minute per user' of service 'photoslibrary.googleapis.com' for consumer 'project_number:XXXXXXX'.
The documentation states 10,000 requests per project per day. But then it says In addition to these limits there are other quotas that exist to protect the reliability and integrity of our systems. I am assuming it's referring to the "per minute per user" that I am receiving.
So what is the actual limit? How many times can I call the API per minute?
P.S. There is a API quote page for Google Sheets API, which states that the limit is 60 requests per minute. Does that limit also apply to other Google APIs?
P.P.S. There is a similar question from 2018, but the issue was too much bandwidth - doesn't apply to my situation.

Related

Pricing on google calendar API quota increase

My google calendar usage already exceeded the "Queries per minute" quota, which is 10,000. And my application hits 20,000 requests per minute for the moment, so I'm expecting to increase the quota to 200,000. When I tried to do it I was asked to create a billing account, which I'm going to do, but I need to know the pricing before that.
Despite my effort I was unable to find the exact information on pricing. Please help me understand the pricing involved with increasing the quotas of google calendar API.
To give more information about the application, this is a backup application where we backup all the Google workspace data including the calendar events using service accounts. So all the payment for calendar service will be done by my company.
Thank you.

Google Vision AI set monthly quotas

Is there any way to set a monthly quota for Google Vision AI?
Right now I'm able to find quotas only for:
requests per minute;
requests per user per minute.
I just want to be sure that I won't spend more than a predefined number of dollars for this API.
You can set up billing alerts so that you are notified. You can break it down by Product, including Vision API.
There's no way to have Vision API automatically block all requests once reaching a certain dollar amount. However you could listen for budget alerts and have your app react accordingly.

Is it normal to have a lot of Compute Engine API requests?

I was looking at my API & Services dashboard and I see a lot of requests to the Compute Engine API. I created a VM a few days ago but have stopped it. However I am still seeing ~50 requests in the last hour. and overall from creating the instance and adding stuff there has been ~18,000 requests in total.
Is this normal behavior? Can I be billed for this amount of requests? Is there a limit?
There are two types of API requests. Those that your code (Cloud SDK) create or service to service requests and those made by Google Cloud to manage/monitor your services.
Is this normal behavior?
For Google Cloud management, yes. My account has millions of API requests.
Can I be billed for this amount of requests?
Yes. If you click on the "Compute Engine API" from "APIs & Services". However, I am not sure how the breakdown in pricing is calculated. Some services such as Stackdriver show "no billing information".
Is there a limit?
For Google Management and Monitoring API calls, I am not sure but I believe that Google does not limit itself but I might be wrong to prevent errant services (bugs).
For API calls that you or your services generate, yes for both a quota and request per second. Rate limits are enforced every 100 seconds and are refreshed. This limit is per project: details. Once you exceed these limits (quota/rate) your API calls will receive 403 (rateLimitExceeded) until the quota is refreshed.

Google Cloud Vision API returning "429 - Quota Exceeded"

I've had a Cloud Function that makes Vision API requests, specifically Document Text Detection requests. My peak requests rate is usually around ~120-150 requests per minute on an average day.
I've suddenly been getting resource quota exceeded errors for Vision API requests with a request rate at 2500 requests per minute. Some things to note:
I've had no code changes in 3 months
I deleted and redeployed the Cloud Function making these requests to stop any problematic image that was causing a runaway loop
My code calling the API nor the cloud functions themselves were getting retried so there really wasn't a way that I could exponentially increase my request rate overnight with no changes introduced.
The service account making the Vision calls is making the normal amount of requests and is only in use by the cloud function i.e. not being used by someone's local script
I've since turned on retries to mitigate this issue since it'll "work" with exponential back off but this is expensive to do, especially with the vision API. Is there anything I can do to find out the root cause of this issue?
To identify the specific quota being exceeded, Stackdriver API helps by using Monitoring quota metrics as explained here .
GCP lets you specify quota being exceeded in greater depth using the Stackdriver API and UI, with quota metrics appearing in the Metrics Explorer.

How to rate limit per user in API Gateway?

I'm running a business API on AWS, through API Gateway and Lambda.
Currently, I handle rate limiting with the built in usage plans and api keys.
Each account tier (think basic, medium, premium) is associated to a usage plan, to which each customer's api key is linked.
I just found out that there is a hard (but increasable) limit of 500 api keys that a single AWS account can have per region (https://docs.aws.amazon.com/fr_fr/apigateway/latest/developerguide/limits.html).
Is it sustainable to rely on api keys to rate limit each customer ? We will get to the 500 limit eventually. Are there other solutions we could use ?
Thanks a lot
If you read the table carefully you will notice that the last column has a header "Can Be Increased" and value "Yes" for "Maximum number of API keys per account per region".
Just contact support once you will be getting close to your limit and ask for an increase. It may take up to 2-3 work days, but otherwise it should be only a matter of asking.