question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

rate limit for the api

See original GitHub issue

This is not an issue related to this module,

Has anyone experienced rate limit problems ? I have a spreadsheet with around 200 worksheets, I want to bring them all so I iterate the worksheets and do getRows().

I quickly run into

HTTP error 429: Too Many Requests

I can limit the amount of parallel calls, but I am wondering if there’s any way to lift this limit.

Thanks for the great lib 👍

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
dsiffordcommented, Oct 12, 2015

For anybody still interested in a solution for this, I had success using the async package + setTimeout.

The data that I was interesed in appending to my spreadsheet was in JSON format. I needed to proceed through the array and save content from each object within the array.

Here’s an example:

var myJSONData = [
  {
    "name": "Tom", 
    "age": 45
  },
  {
    "name": "Bill",
    "age": 59
  }
  // .... etc
]

async.eachSeries(myJSONData, function(item, callback) {
  sheet_info.worksheets[index].addRow({
      Name: item.name,
      Age: item.age
    }, function(err) {
         if (err) {
           console.log('Too many requests');
         } else {
            setTimeout(function() {
            callback();
            }, 50);
         }
     }
});

Obviously, the example is much more rudimentary than the real thing. Hopefully, you get the idea.

I made ~500 or so requests using this method without any issues.

3reactions
guido4000commented, Apr 4, 2016

@dsifford your solution worked like a charm. I just had to set the timeout to 100 ms.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Everything You Need To Know About API Rate Limiting
This rate-limiting library automatically limits the number of requests that can be sent to an API. It also sets up the request queue ......
Read more >
What is API Rate Limiting and How to Implement It - DataDome
API rate limiting is, in a nutshell, limiting access for people (and bots) to access the API based on the rules/policies set by...
Read more >
Understanding rate limits for APIs and Plans - IBM
In API Connect, rate limits can be defined as unlimited, or with a specified number of calls per second, minute, hour, day, or...
Read more >
Web Service Rate Limits - API data
Hourly Limit: 1,000 requests per hour. For each API key, these limits are applied across all api.data.gov API requests. Exceeding these limits will...
Read more >
Rate Limits - Graph API - Meta for Developers - Facebook
A rate limit is the number of API calls an app or user can make within a given time period. If this limit...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found