0

For example, I want to parse all tweets of Microsoft .

Twitter has API - GET statuses/user_timeline. But how I can see, This method can only return up to 3,200 of a user’s most recent Tweets.

So, can I parse all tweets of some screen_name?

Tharif
  • 13,794
  • 9
  • 55
  • 77
Denis
  • 3,595
  • 12
  • 52
  • 86

1 Answers1

1

You might be a bit better with GET search/tweets, adding the query q=@Microsoft.

However, you will have problems as well:

  1. You'll get all tweets mentioning @Microsoft, not only the ones at the user_timeline. You will have to filter afterwards

  2. Although there is not limit in theory, as the one of 3200 of GET statuses/user_timeline, you probably wont be able to get all tweets from a user. By definition, Twitter API does not provide that kind of service. If you want all tweets you'll need to use a service like topsy (not free)

  3. You'll have to use pagination since every query to GET search/tweets gives you a maximum of 100 tweets, and if you need to get more than 450*100 tweets (remember you'll get a mixture of tweets as pointed out in 1. above), you'll have to handle Twitter rate limits and launch your queries in windows of 15 minutes

Sorry there is not a simpler answer to your question... Hope it helps anyway.

(EDIT: 450*100 is assuming you use application-only authentication. If not, it is 180*100)

lrnzcig
  • 3,868
  • 4
  • 36
  • 50
  • thank you for response. As I understand it, I can't get all tweets even using the browser. – Denis Mar 29 '15 at 11:12
  • Well, Twitter does not guarantee you'll get *all* tweets. However, in my experience, it is good enough... – lrnzcig Mar 29 '15 at 11:14