1

I would like to know how to retrieve more than 200 tweets from a twitter page. I know its limited to 200 but read you can retrieve more,Im using php and using this following line of code to get the 200 tweets

  $xmldata = 'http://twitter.com/statuses/user_timeline/BBCNews.xml?count=200';

Could someone show me some example code in how to do this?

thanks

jimmy
  • 15
  • 1
  • 2
  • 5

1 Answers1

4

With the twitter API you can only get up to 200 posts per page. You would have to add a &page=x to get the page of tweets (there is a hard limit of 3200 posts)

View the api documentation here

https://dev.twitter.com/docs/api/1/get/statuses/user_timeline

An example of the api call for json would be

https://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name=twitterapi&count=200&page=2

and an example for the xml call would be

https://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name=twitterapi&count=200&page=2

So what i would suggest is if you want to get all 3200 posts is to set up the script in a function to change the page number each time

bretterer
  • 5,693
  • 5
  • 32
  • 53
  • Please see the posts again for the edit. There is a limit of 200 posts per page... you must add page=XX to the url – bretterer Mar 08 '12 at 19:33
  • hey have tried to do that before and wasnt able to do it, what do you mean by "in a look"? thanks – jimmy Mar 08 '12 at 19:37
  • Sorry... it was "in a function" meaning so you can loop through each page. Also check my sample calls as they are working examples – bretterer Mar 08 '12 at 19:42