CoinGecko-API
CoinGecko-API copied to clipboard
"error code: 1015" not treated as rate limit error
I was for-looping to get prices of multiple tokens. My server receives error: SyntaxError: Unexpected token e in JSON at position 0. I used debugger and found out that the problem occurs here in CoinGecko.js:
//Check if page is returned instead of JSON
if (body.startsWith('<!DOCTYPE html>')) {
Utils._WARN_('Invalid request', 'There was a problem with your request. The parameter(s) you gave are missing or incorrect.');
} else if (body.startsWith('Throttled')) {
Utils._WARN_('Throttled request', 'There was a problem with request limit.');
}
//Attempt to parse
body = JSON.parse(body);
Do you still need help ?