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

Rate limit not reset when twitter says it will be? #365

Closed nicholasg97 closed 9 months ago

nicholasg97 commented 9 months ago

Hey, so recently I noticed I was getting a 429 rate-limit error. In debugging I noticed that the headers being returned indicated a x-rate-limit-reset: value which should be the epoch time that the rate-limit resets. After waiting until after the specified time, I ran my script, got 429 again and the x-rate-limit-reset time changed to 15 minutes further in time.

Has anyone experienced this? My script ran 10 times before it turned it self off, meaning I tried to get tweets 10 times which all received 429 responses. Is it possible there is another more aggressive rate limit that they have implemented because of my 10 requests that isn't showing up in the failed response headers?

Rishikant181 commented 9 months ago

That's something that happens on the Twitter side of things. All we can do as of now is just test it out with different waiting times. One thing that is worth trying out is actually using a small delay between each successive request, even when Twitter does not return Error 429.

But yeah, it does require a bit of experimentation. I'll let you know when I find something,

nicholasg97 commented 9 months ago

Interesting yea, just for reference I was just using rettiwt.tweet.search once every minute and it took about 36 hours for it to return its first 429... So nothing crazy as far as requests per second...

Do we know if generating a new cookie from the same account gets around the rate-limit?

Rishikant181 commented 9 months ago

Do we know if generating a new cookie from the same account gets around the rate-limit?

I don't think so, but it does have the chance of getting your login attempt to be flagged for verification via a one-time-password, which this library unfortunately can't handle as of now.