Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local_rate_limited #360

Open
post04 opened this issue Nov 19, 2023 · 0 comments
Open

local_rate_limited #360

post04 opened this issue Nov 19, 2023 · 0 comments

Comments

@post04
Copy link

post04 commented Nov 19, 2023

I see no mention of local_rate_limited here. I have a lot of info on it that I can contribute.

For simplicity, I'll be saying LRL. So LRL seems to be a somewhat new thing to the API, you can see some mentions of it in march of 2022 but that's only on the official v2 API, besides from that, this change from what I'm aware is brand new to the v1.1 and graphql (gql) API's, or at least added within the past 3 months. You can request to almost any endpoint to trigger it. All you need to do is request on >15 threads for >5 minutes or so. You'll see that at some point you start getting response code 429's with bodies that say local_rate_limited. You should note that any X-Rate-Limit headers will not be indicative of you hitting a rate limit.

With that being said, here's how you should think of LRL. This is basically a thread limit. For as long as I've been using twitter's API, I've never seen a proper attempt at a thread limit be implemented and I think they've finally added one.

Let's go back to what I said earlier though. I said, "You can request to almost any endpoint to trigger it." This is because, from my research, I've found a few endpoints that don't have this LRL and I think I've figured out what they all have in common.
https://twitter.com/i/api/1.1/friendships/create.json
https://twitter.com/i/api/graphql/5V_dkq1jfalfiFOEZ4g47A/CreateTweet
https://twitter.com/i/api/graphql/ojPdsZsimiJrUGLR1sjUtA/CreateRetweet
All three of these are immune to LRL, and all three of them don't return any X-Rate-Limit headers. I'm not sure this is intended at all, the endpoints don't have any rate limit expected but I don't see any reason they should bypass LRL protections. Either way, that's how it seems to work from what I've noticed. I've not yet been able to force any endpoints that typically give LRL and X-Rate-Limit headers to not return those but that would be pretty neat regardless and this would be the way to do it.

Thanks for reading!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant