Rishikant181 / Rettiwt-API

A CLI tool and an API for fetching data from Twitter for free!
https://rishikant181.github.io/Rettiwt-API/
MIT License
309 stars 31 forks source link

Seemingly Random Rate Limited #322

Closed flashmercurymcfly closed 10 months ago

flashmercurymcfly commented 1 year ago

Just updated to the new version and will randomly get Rate Limit Exceeded (429) back when using the getTweets method. Weird part is that this'll happen for a few minutes, go back to fetching tweets with no issue, then go back to returning the same error above. Not really sure if there's anything you can do to get around this.

I probably shouldn't post the full error message here since it's absurdly long but here's a small snippet

 AxiosError: Request failed with status code 429
at settle (/home/ryan/hoshi-bot/hoshi-bot/node_modules/axios/dist/node/axios.cjs:1896:12)
at Unzip.handleStreamEnd (/home/ryan/hoshi-bot/hoshi-bot/node_modules/axios/dist/node/axios.cjs:2940:11)
at Unzip.emit (node:events:525:35)
at endReadableNT (node:internal/streams/readable:1359:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
code: 'ERR_BAD_REQUEST',
...
data: 'Rate limit exceeded\n'
flashmercurymcfly commented 1 year ago

Just saw that I'm fully rate limited (for what I assume is the rest of the day) so I guess there's nothing that can be done about this besides not making so many requests I assume?

Rishikant181 commented 1 year ago

@flashmercurymcfly For the time being, I don't think anything can be done.

But yeah, as far as I can tell, the rate limit is random. Sometimes it is limited, then after 5 minutes or so, it works normal and to be fair, I don't what is going on with Twitter.

Although I'll be trying to make the API crash 'gracefully' if it hits the rate limit.

4yR1l1k commented 11 months ago

Does the same conditions apply with regards to the rate limit, or have this code shown any hope for bypassing the rate limit?

Rishikant181 commented 11 months ago

@4yR1l1k This library is made by reverse engineering the Twitter web app. So the rate limits face by this is the same as the one you will face while using Twitter from the browser, which is much higher than the official Twitter API.

TL;DR The rate limits are much higher than the official Twitter API