Streaming API Connection limiting?



Was interested in using the Streaming API, and came across this section:

Each account may create only one standing connection to the public endpoints, and connecting to a public stream more than once with the same account credentials will cause the oldest connection to be disconnected.

Clients which make excessive connection attempts (both successful and unsuccessful) run the risk of having their IP automatically banned.

Is this stating that only one connection is allowed per authorized application? Eg. What if multiple users are using an app at the same time? It reads as if the older connection would be cut off.


The specific rule here is that each account can only have one connection to the public endpoints (sample/filter) - rather than app - but you will also be throttled if there are too many connections from a single IP.


So when you say account your referring to an actual Twitter account correct? My Twitter app was made under my Twitter account, but the app itself doesnt require any Twitter login from the user, it simply displays a few tweets from pre-selected users. So what is the limits with a situation like that? Eg: Whats the connection limit if there is no logged in user, or does the account that created the Twitter application to get the keys (my account) used in this case?


So without the account authentication, you’re using app-only authentication, and you’ll be limited to a single connection.


And im assuming thats a single connection per installed app correct?


In public stream connection to statuses/filter.json, How many connection could we make from a single IP?


You’ll get to make 1 connection per app ID. As per our Developer Policy, you should not use multiple app IDs to circumvent this limitation, and multiple connections from a single IP may result in suspensions.


Thank you @andypiper for your kind reply. Having more than 20k auth users in a single twitter app and established site stream for them.

For some users wish to establish public stream?

As per Twitter Developer Policy, We need maintain only one public stream per app ID. It meant all users public stream request must be handle in one stream.

Is i’m correct? or Can we make as much public stream connection as auth users in single twitter app ?

Note: All public stream request triggered from Single IP.


As you specified,

each account can only have one connection to the public endpoints (sample/filter) - rather than app.

For example, i have one twitter app which contain more that 30K accounts.
Then i can make 30K connection to “” endpoint, Is it correct?


you will also be throttled if there are too many connections from a single IP

It meant we can’t establish all 30K connections from Single IP. we need to divide and connect from set of IPs.

Please connect me, if i am not correct.


I too have the same doubt. I am still not clear, if we use the same app across multiple IPs where each IP has a different user’s authentication, is violating any rules.

AppID: A1
Token: T1

AppID: A1
Token: T2

Will the above configuration be allowed without violating any terms and conditions?
Or will I be able to make just one connection per App ID irrespective of the number of authentications?

Thanks in advance.


You should not use multiple app IDs or tokens to attempt to circumvent any connection or rate limits. If these are all completely different apps with different functions and purposes then there should be no issue.


Thanks Andy.

Any opinions or suggestions on how we can fetch data for our different clients on a real time basis? Rest API causes a lot of delay.


The public APIs are not intended for high volume use cases - you should take a look at the realtime PowerTrack products available commercially from Gnip instead.


That’s unclear.
If I use public stream, and want to do 2 streams with each a specific filter (2 StatusListener, 2 FilterQuery and 2 Stream), so I need 1IP for each? or can have the same IP but with different account Twitter and/or different application? I’m lost, how to do?
Thanks in advance


If you exceed 2 streams from an IP and App ID, one of the old connections will be disconnected. This is regardless of user tokens in use.


So with 1 IP and 2 AppID (created with the same Twitter account) it’s OK ?


What is the purpose of the two app IDs? You should not create additional app IDs to run identical code just for the purpose of avoiding being limited.

In this specific case you are asking about, you should not find your connections restricted. You will not be able to run more than 2 connections, as stated above.