node-twitter icon indicating copy to clipboard operation
node-twitter copied to clipboard

503 from Twitter when following "too many" user IDs with streaming API

Open phelps opened this issue 8 years ago • 3 comments

Whenever I attempt to follow too many user IDs with statuses/filter (streaming API), I consistently get back a 503 error from Twitter. (Note: I am keeping the number below Twitter's maximum of 5,000 IDs.) The magic number at which it becomes "too many" IDs is 3,272. As soon as I pass 3,273 or more user IDs, I get back a 503.

I figured this was an issue with Twitter's API. But then I used twurl to make the same request, with 5,000 IDs, and it worked flawlessly. (I tested with 5,001 IDs, just to make sure, and got back the expected 413 Request Entity Too Large.)

What could be happening?

phelps avatar Jun 14 '17 02:06 phelps

Update: I run into the exact same issue when using a different Twitter library, twit -- it errors out when I pass >= 3,273 IDs to follow.

I notice both libraries use Request. Could it have something to do with the way Request is formatting the request?

cc: @ttezel

phelps avatar Jun 14 '17 03:06 phelps

I tried to duplicate this today in node-twitter, and got similar behavior. For me the "magic number" was somewhere between 2100 and 2150.

davidraedev avatar Jul 21 '17 20:07 davidraedev

That's probably because the IDs are sent in the URL as parameters, instead of the POST body.

twitter-lite handles this correctly. Here's a test.

dandv avatar Dec 18 '18 21:12 dandv