12

I am trying to retrieve a list that contains the entire contents of my personal twitter statuses with python and tweepy.

I have successfully authenticated via OAuth but cannot seem to recieve more than about 800 status updates from twitter. My twitter bio page says I have over 2000 tweets. I am well within the 3200 tweet limit Twitter imposes on us.

Any help would be greatly appreciated!

This is my current code (minus OAuth API authentication):

for page in tweepy.Cursor(api.user_timeline, count=200).pages(16):
    page_list.append(page)
    n = n+1
    print n

for page in page_list:
    for status in page:
       print status.text
Tim Bueno
  • 401
  • 2
  • 5
  • 11

2 Answers2

8

You need to specify include_rts=True as a parameter to api.user_timeline; retweets are not included by default. If you retweet a lot of things, this is likely where your missing tweets have gone.

Sam
  • 439
  • 5
  • 10
2

Twitter does not return more than 800 statuses. This is written in the Twitter API documentation (https://developer.twitter.com/en/docs/tweets/timelines/api-reference/get-statuses-home_timeline) :

This method is can only return up to 800 statuses, including retweets, across all pages.

air-dex
  • 4,130
  • 2
  • 25
  • 25