How to get latest 25 tweets using user_timeline API


#1

Hi All,

I am new to Twitter and have question for experts.

I am using https://api.twitter.com/1.1/statuses/user_timeline.json?count=25&exclude_replies=true&screen_name=myscreenname to retrieve latest 25 tweets. However it return less tweets. It random, sometimes I get 5 tweets back and sometime 8. How do I get the last 25 tweets? Please advise.

Thank you.


#2

Increase the count value. It is more of a maximum than an exact count. They way this works is it get’s 25 tweets, then excludes the replies and then returns what’s left. You should also consider that if you ask for 50, they might all be replies and get excluded. You would then want to make additional paginated requests until you get the amount you want.