Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to increase Google Sheets v4 API quota limitations

Tags:

The new Google Sheets API v4 currently has an unlimited read/write quota per day (which is fantastic), but restricted to 500 reads/writes per account per 100 seconds, and 100 read/writes per key per 100 seconds (or, I have found, multiple keys coming from the same IP). This is probably plenty for most use cases, but I have an edge case that requires bringing a frequently-updated Google Sheet with 70 tabs down to a node.js server that distributes these to user's clients every ~30-60 seconds or so (users are data annotators who are student research assistants). This wasn't so bad early in the project when there were only 20-30 tabs, but now that the data is large the server is blowing through the 100 quota and returning errors every 10-15 minutes.

The problem is such that:

  1. Frequent data updates: Only data on 1-5 of the 70 tabs is likely to be updated on any given minute, but which tabs have new data is random (so I am pulling down the whole sheet of 70 = 70 reads).
  2. Update interval: The need for updates happens randomly at about 30 second to 5-minute intervals (so some within the quota, some about 3-5x the quota).
  3. Throttling: I have tried throttling the update to be within the 100 calls/100 seconds (my previous solution), but this introduces large usability issues, significantly decreasing usability/productivity/work quality.
  4. Quota increase: The sheets API does not currently appear to include a way to pay to increase the quota. It does allow filling out a form to request an increase in the quota, but I'm not sure what the mean response time is on this (my request is only a few days old).
  5. Multiple service accounts: I have tried using multiple service accounts to get the full 500 requests/100 seconds quota (rather than the per-user quota), since this is a server, but Google Sheets looks to rate-limit to 100 requests/100 seconds from a given IP
  6. Alternatives: I have considered that this project may have just grown beyond the size that Sheets is easily able to handle, but there do not appear to be any good, usable, self-hosted, collaborative spreadsheets with easy-to-interface-to APIs out there.

Are there settings/methods suggested to achieve the full 500 calls/100 seconds for a server?

like image 778
Peter Jansen Avatar asked Jul 20 '17 21:07

Peter Jansen


People also ask

How do I increase my Google API limit?

Increase the quota for an APIGo to Google Cloud and sign in as a Google Workspace super administrator. Under Project, select the project you're using for the migration. Quotas. Using the checkboxes, select one or more quotas to edit, then click Edit Quotas.

How do I check Google API limit?

Visit the Enabled APIs page of the API library in the API Console, and select an API from the list. To view and change quota-related settings, select Quotas. To view usage statistics, select Usage.

How do you set a limit in Google Sheets?

To set a character limit in Google Sheets, use a custom formula (with the LEN Function) in Data Validation. Select the cell (here, B2) or data range where you want to apply the data validation rule, and in the Menu, go to Data > Data validation.


2 Answers

You can request quota update in Google Cloud Platform and it will be increased to 2500 per account an 500 per user. (about your #4) enter image description here

like image 65
Alex Avatar answered Oct 15 '22 23:10

Alex


  1. You can use spreadsheets.get to read the entire spreadsheet in a single call, rather than 1 call per request. Alternately, you can use spreadsheets.values.batchGet to read multiple different ranges in a single call, if all you need are the values.

  2. The Drive API offers "push notifications", so you can get notified when changes occur and react to those, instead of polling for them. The latency of the notifications is a little on the slow side, but it gets the job done.

like image 39
Sam Berlin Avatar answered Oct 15 '22 23:10

Sam Berlin