PLhery / node-twitter-api-v2

Strongly typed, full-featured, light, versatile yet powerful Twitter API v1.1 and v2 client for Node.js.
https://www.npmjs.com/package/twitter-api-v2
Apache License 2.0
1.25k stars 175 forks source link

API V2 Stream TooManyConnections #440

Closed quarkhadron closed 1 year ago

quarkhadron commented 1 year ago

Been getting TooManyConnections for the past few days. Everytime I try to run the app, it keeps crashing because too many connection. However, I tried to stop the app, stream.close() a few times and still haven't solved the issue.

Here is the code

const stream = await Twitter.v2.searchStream({ autoConnect: false });

await stream.connect({ autoReconnect: true, autoReconnectRetries: Infinity }).then(console.log('Connecting to Twitter...'));

 //await stream.close();

Here is part of the error response rateLimit: { limit: 40000, remaining: 39995, reset: 1673846259 }. It has not reached the limit yet, however, the app just won't reconnect to the stream.

How to solve this problem?

zidane-sc commented 1 year ago

@quarkhadron have you found the solution bro?

npomfret commented 5 months ago

Are you using the Pro version of the api?