Google calendar API service account rate limit - google-calendar-api

I have a google service account setup for their calendar api, but it seems as though I can only make 5 requests per second. I've only figured that out from trial and error, there are no per second rate limit settings on my developer console settings.
I have 'queries per day' and 'queries per 100 seconds per user', both of which are currently set to 1,000,000.
I'm definitely not hitting these limits, so I can only assume there is a hidden 'per second' rate limit that is being applied. Does anyone know if that is the case?
Thanks!

I think this documentation will help you to understand more the Calendar usage limits.
Google Calendar puts certain limits in place to protect our users and infrastructure from abusive behavior. When these limits are reached by a user, Google Calendar will go into read-only mode for that user, and all edit actions will fail for a certain period of time. Most users will never hit these limits, as they are well above the activity level of a typical Calendar user.
I'd also like to add a few tips to work efficiently with your quota:
Use push notifications instead of polling.
If you cannot avoid polling, make sure you only poll when necessary (for example poll very seldomly at night).
Use incremental synchronization with sync tokens for all collections instead of repeatedly retrieving all the entries.
Increase page size to retrieve more data at once by using the maxResults parameter.
Update events when they change, avoid re-creating all the events on every sync.
Use exponential backoff for error retries.
Check the performance tips of the Calendar API

Related

Vision API quota/budget limit and API key security

I have never used Vision API before but recently I have found it very powerful for a project of mine. However I have two concerns regarding its budget limiting, in order to not get an unexpected bill:
Is it possible to set a monthly cost limit? I have been used to Compute Engine which gives me an almost exact cost of the month but this seems not possible here. Since I will be using the API for labelling I have set the label detections requests per minute and per user to a specific amount, also to be sure I have set the global request per minute and per user to the same amount, all the other quotas to 0. If I have understood correctly, setting the max calls quota per minute to 4, for example, should provide a maximum of 178560 calls per month, right? Should this limit my budget? Am I safe?
The API will be used as an API key in a mobile app. I have followed the code examples for iOS & Android and I have seen the key is written in the code. Is this safe? For a better security I have restricted the key to iOS/Android apps bundle and to Cloud Vision API only. Would it be a safe enough option?
Thanks everyone for any help!
Yes, it’s possible to set a monthly cost limit. Refer to this doc for more information about creating the budget, setting the budget scope, budget amount and threshold. Yes your understanding is correct by setting the max calls quota per minute to 4, it should provide a maximum of 178560 calls per month. It shouldn’t limit the maximum quotas.
API keys that are embedded in the code are not safe and secured.
Do not embed API keys directly in code. API keys that are embedded in code can be accidentally exposed to the public. For example, you may forget to remove the keys from code that you share. Instead of embedding your API keys in your applications, store them in environment variables or in files outside of your application's source tree.
Refer to this doc for more information about best practices for securing an API key.
Edit based on a question in the comment:
Can the quotas be seen as a hard limit?
The quotas might be seen as a hard limit only if you don't have any other resources running in your GCP project other than Vision API requests. Refer to this doc for more information about capping API usage.
If you want to set a hard limit and disable billing, configure a Cloud Function to call the Cloud Billing API that disables billing for the project as described in the GCP doc.
Note: Use this feature only if you want to stop the spending and might be willing to shutdown all your Google Cloud services and usage when your budget limit is reached.

Evernote Rate Limit

I have an app that have hundreds of users and connects to Evernote. As I have more users I make more requests to Evernote and it is causing a lot of rate limiting for my users and causing frustration. Is there a way to get my current limit increased from Evernote?
I have fixed a lot of inefficient calls I used to do, but we still have the same issue.
Rate limits are applied to calls against the Evernote API on a per API key, per user, per time period basis. This means that the API limits the number of calls a third-party app can make for each individual user during a given one-hour period. [source]
The number of users of your application is irrelevant. The source for that quote details a number of reasons and fixes.
If you've optimised your code fully, this may be a "special case". You should contact Evernote developer support.

How to prevent throttling with Firestore when executing high amount of reads?

I am a Google blaze plan user and I have an express server containing a simple endpoint that just pulls from firestore. During high traffic hours, I can retrieve 5000+ simultaneous read requests which eventually throws this error below,
Error: 8 RESOURCE_EXHAUSTED: Quota exceeded.
After I wait a few minutes I am able to read the collection again.
Update:
Unsure why the downvotes without any explainations.. but I also have a Mutex system which I think may be leading to hitting these limits. If fails to lock a document using transactions, it goes down an array of snapshots until a lock is given. If the array becomes empty, it does another read to firebase for another set of N documents, which is only 50 in my case.
So my question is, is there a limit on the amount of transactions or reads per second that we're allowed to do from a single connection (my express server)? I don't think it's stated anywhere in the documents.
It looks like you're reaching one of the read/write/transaction limits stated in this page.
Might be this one Maximum writes per second per database: 10,000 (up to 10 MiB per second) but I'm only guessing...
To answer your question, according to this link, the maximum concurrent connections for mobile/web clients per Firebase database is 1,000,000. Thus, your connections seem to not exceed the limits.
For the Blaze Plan project, the limit for Cloud Firestore Document Read is 50K/day, since free usage from Spark Plan is included in Blaze Plan. The limit is such, unless you have set any budget limit in your Billing account. The usage will be reset at midnight of PST. If you upgrade your plan to Flame Plan, the limit is 250K/day.
Here you may read about the official Cloud Firestore Quotas and limits, such as maximum document reads, maximum size for a document, that can be useful. Furthermore you may monitor your database usage and check your plan's limits from the “Usage” tab in the Firebase console. You can check usage over the current billing period, the last 30 days, or the last 24 hours.
Stackdriver Monitoring is also a practical tool for monitoring document reads/writes/deletes, active connections and snapshot listeners.
A good practice, if you want to avoid unexpected charges on your billing account, would be to create an alerting policy based on the Cloud Firestore metrics, as stated here.
Additionally, you can estimate and verify your monthly costs on the “Blaze Plan” by using this Blaze Plan calculator.
For anyone who runs into this issue in the future, please check your App Engine budget settings under "Application Settings". I set the daily spending limit to avoid unnecessary charges during testing and it slipped my mind. I increased the budget and the error is currently gone.
AWS usually sends me an email when my budget has been exceeded.

Google Analytics real-time - keep alive

i have a realtime platform when users are staying on pages for a long duration, i found that after 5 minutes (more or less) the GA realtime stop show them so i created timer that each 4 minutes send pageview and this way all users remain "connected" to GA.
I wonder if it's a good approach or it's can may produce un-accurate data on the reports later.
Is anyone experienced that?
Your terminology seems a little off - users do not become "disconnected" from Google Analytics, the difference between realtime reports and data from the reporting api is that the former shows only a subset of ad hoc computed dimensions and metrics whereas the reporting api shows, after some processing latency, the full set of metrics and dimensions, including stuff that required more processing time like session- and user scoped data.
Other than that your approach is fine. There is a limit on the number of API calls you are allowed to make - the documentation has an example on how to calculate your calls to stay within the limits, and Google suggests to implement some sort of serverside caching if you do need a lot of realtime dashboards.
But this is not going to affect the data quality of reports in any way. Realtime API is a read-only API, the worst thing that can happen is that you exceed your quota and get blocked for the rest of the day. So there is no way this would create "un-accurate data on the reports later".

Linkedin API throttle limit

Recently I was developing an application using Linkedin people-search API. Documentation says that a developer registration has 1 lac API calls per day, but when I have registered this API, and ran a python script, after some 300 calls it says throttle limit exceeds.
Did anyone face such kind of issue using Linkedin API, comments are appreciated.
Thanks in advance.
It's been a while but the stats suggest people still look at this and I'm experimenting with the LinkedIn API and can provide some more detail.
The typical throttles are stated as both a max (e.g. 100K) and a per-user-token number (e.g. 500). Those numbers together mean you can get up to a maximum of 100,000 calls per day to the API but even as a developer a single user token means a maximum of 500 per day.
I ran into this, and after setting up a barebones app and getting some users I can confirm a daily throttle of several thousands of API calls. [Deleted discussion of what was probably, upon further consideration, an accidental back door in the LinkedIn API.]
As per the Throttle Limits published by LinkedIn:
LinkedIn API keys are throttled by default. The throttles are designed
to ensure maximum performance for all developers and to protect the
user experience of all users on LinkedIn.
There are three types of throttles applied to all API keys:
Application throttles: These throttles limit the number of each API call your application can make using its API key.
User throttles: These throttles limit the number of calls for any individual user of your application. User-level throttles serve
several purposes, but in general are implemented where there is a
significant potential impact to the user experience for LinkedIn
users.
Developer throttles: For people listed as developers on their API keys, they will see user throttles that are approximately four times
higher than the user throttles for most calls. This gives you extra
capacity to build and test your application. Be aware that the
developer throttles give you higher throttle limits as a developer of
your application. But your users will experience the User throttle
limits, which are lower. Take care to make sure that your application
functions correctly with the User throttle limits, not just for the
throttle limits for your usage as a developer.
Note: To view current API usage of your application and to ensure you haven't hit any throttle limits, visit
https://www.linkedin.com/developer/apps and click on "Usage & Limits".
The throttle limit for individual users of People Search is 100, with 400 being the limit for the person that is associated with the Application as the developer:
https://developer.linkedin.com/documents/throttle-limits
When you run into a limit, view the api usage for the application on the application page to see which throttle you are hitting.

Resources