pythontwittertwitter-searchsttwitterapi

Twitter API - Python , searching for tweet by date


# Initiate the connection to Twitter
twitter = Twitter(auth=oauth)

# Search for latest tweets about "pakistan"
results = twitter.search.tweets(q='pakistan',until=2008 - 08 - 19, )

print results

I am trying to retrieve tweets that are earlier than this date by one week. It does not return anything. However, I have searched manually on twitter and found that tweets exist.


Solution

  • When you use the Twitter API to download tweets you will have access to tweets back to roughly one week old. This is despite the fact that you can see tweets older than one week on Twitter's website. This is a built-in limitation of the API.