Recieve real-time updates to user timeline


Is it possible to use the twitter api to recieve real-time updates of a user timeline? If so, what would be the best way?

Sorry if this isn’t the correct subforum.


Sure, best one to use is with the follow parameter


A couple of follow up questions:

  1. Will this really send updates when the user’s timeline updates due to a tweet from another user he is following?
  2. Is there any limit to the amount of users you can apply this to?
  3. Is it free?


Oh, i thought you meant user timeline as in 1 specific user’s tweets like a streaming equivalent of , not tweets by anyone a specific user is following like

In both cases though, the filter endpoint is what you’ll need - it’s free and there’s a 5000 id limit on the number of users you can track, and you can keep open 1 such connection. You can get user ids of accounts someone is following with


Thanks, I’ll give it a try!

Btw, I was looking into webhooks( earlier. Do you know if I can get updates when a user’s timeline is updated (due to his friend’s tweets) from that? I thought so at first but I’m unsure now.


Not for any tweet, but partially yes: here’s stuff you get from Activities API - so whenever a someone Retweets, Replies, @mentions, QuoteTweets you, you’ll be able to get those messages, but not when anyone you follow makes any kind of tweet - just one that includes you.


What you’re describing and requesting is real-time updates to what we call a user’s “home timeline” i.e. all of the Tweets the user would see if they opened and looked at the stuff flowing in from the people they follow. This is no available in the API, but you can approximate it. You can also poll the RESTful home_timeline endpoint, but this is not realtime.


Thanks Igor! you saved me a lot of time. I’ll look into the filter realtime feature :slight_smile:


Ok thanks! Yeah I have tried polling it but I’d prefer realtime.


@anders811 lets buy Enterprise powertrack on 50:50 partnership
i also need to get tweets from 10k or more twitter accounts in realtime .


Thx for the offer, but 5k is enough for me :slight_smile:


Hi again!
I haven’t had much time to look into this and just now started a bit.
Maybe you can help me with a few questions :slight_smile:

  1. Do you have any suggestions on http client libraries for php that work with “filter real-time tweets”? Guzzle maybe?
  2. Is there any difference between and The latter seem Enterprise-only so I’m a bit confused.
  3. I noticed these libraries: & I’m confused as to which api of the ones above (in question 2) that they work with. I don’t feel like paying for Enterprise after all.
  4. Do you know if there are any php examples for connecting to & using the Filter Realtime Tweets Api?

Sorry if these questions seem strange. I’m very new to all this.


I don’t know enough about PHP to say which libraries are good nowadays - there’s a list here - but is the endpoint you want, the other documentation link is for enterprise like you said.


Thanks again Igor!
Sorry if my answers are often late like this one. I seldom get the time to sit down and play around with this.

I came across this post just now: which says that the twitter streaming api only returns around 1% of the tweets. Is it the same for I.e. even if I set my filter parameters quite narrowly it will still only return about 1% of the tweets that match my filter parameters?



The sample stream returns roughly 1% of all tweets on twitter (it’s not exactly 1% but it’s close to it)

The filter stream delivers real-time tweets that match some query

Filter stream will deliver all tweets that match your query, but if the number of tweets that match your query is too large (too large generally means it’s more than the number of tweets in the sample stream), you will start getting limit notices in the stream messages. This is how you know that you are no longer getting all the tweets that match your query.

Hope that helps!


Pheew! :slight_smile:
Thanks again Igor! You’re the best.

closed #18