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
If you need more than 100 Tweets, you have to use the paginator method and specify the limit i.e. the total number of Tweets that you want. Replace limit=1000 with the maximum number of tweets you want. Replace the limit=1000 with the maximum number of tweets you want (gist).
Tweepy provides the convenient Cursor interface to iterate through different types of objects. Twitter allows a maximum of 3200 tweets for extraction.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With