I get an error message saying "Rate limit exceeded" when I try to request historical data from GDAX. I use promises and setInterval to request historical price data from GDAX like this:
let promiseArray = //Array with promises
let j = 0;
let grabPrices = setInterval(() => {
if (j === promiseArray.length) {
//Do something when all promises have been resolved
}
else {
promiseArray[j].then(
data => {
//Work with data
}
).catch(error => console.log('An error occurred: ' + error));
j++;
}
}, 1000) //I have even tried to use 10 seconds (10000) as a second argument to setInterval, but it doesn't make any difference.
FROM the official API documentation
Rate Limits When a rate limit is exceeded, a status of 429 Too Many Requests will be returned.
REST API PUBLIC ENDPOINTS We throttle public endpoints by IP: 3 requests per second, up to 6 requests per second in bursts.