Twitter – Why does a Twitter API request for a user’s timeline with count=40 return about half the number of results that it should

twitter

Why does

http://twitter.com/statuses/user_timeline.xml?screen_name=erikvold&page=0&count=40

return approximately 15 results?

Should it not return 40 results?

Best Answer

(This answer is being added nearly 3 years later, mainly for the benefit of new API 1.1 users arriving via Google.)

As well as the answers you've already had, the count parameter is a maximum limit, not a "please send me count many".

The count parameter is best described in the documentation for GET statuses/user_timeline:

The value of count is best thought of as a limit to the number of tweets to return because suspended or deleted content is removed after the count has been applied. We include retweets in the count, even if include_rts is not supplied. It is recommended you always send include_rts=1 when using this API method.

Whilst some of that documentation is only relevant to the specific method, count appears to behave in that manner across the Twitter API — it won't reliably given you as many as count results from your method call, but it will reliably give you no more than count results.