title: Download historical tweets from more than one month ago
body: <p>I am trying to download tweets from way past months between certain date range. I am able to download only with a week but not past that.</p>
  <p>Code:</p>
  <pre><code>import tweepy
  from tweepy import Stream
  from tweepy import OAuthHandler
  from tweepy.streaming import StreamListener
  import pandas as pd
  import json
  import csv
  import sys
  import time
  
  ckey = 'key'
  csecret = 'key'
  atoken = 'key'
  asecret = 'key'
  
  def toDataFrame(tweets):
  
      DataSet = pd.DataFrame()
  
      DataSet['tweetID'] = [tweet.id for tweet in tweets]
      DataSet['tweetText'] = [tweet.text.encode('utf-8') for tweet in tweets]
      DataSet['tweetRetweetCt'] = [tweet.retweet_count for tweet in tweets]
      DataSet['tweetFavoriteCt'] = [tweet.favorite_count for tweet in tweets]
      DataSet['tweetSource'] = [tweet.source for tweet in tweets]
      DataSet['tweetCreated'] = [tweet.created_at for tweet in tweets]
      DataSet['userID'] = [tweet.user.id for tweet in tweets]
      DataSet['userScreen'] = [tweet.user.screen_name for tweet in tweets]
      DataSet['userName'] = [tweet.user.name for tweet in tweets]
      DataSet['userCreateDt'] = [tweet.user.created_at for tweet in tweets]
      DataSet['userDesc'] = [tweet.user.description for tweet in tweets]
      DataSet['userFollowerCt'] = [tweet.user.followers_count for tweet in tweets]
      DataSet['userFriendsCt'] = [tweet.user.friends_count for tweet in tweets]
      DataSet['userLocation'] = [tweet.user.location for tweet in tweets]
      DataSet['userTimezone'] = [tweet.user.time_zone for tweet in tweets]
      DataSet['Coordinates'] = [tweet.coordinates for tweet in tweets]
      DataSet['GeoEnabled'] = [tweet.user.geo_enabled for tweet in tweets]
      DataSet['Language'] = [tweet.user.lang for tweet in tweets]
      tweets_place= []
      #users_retweeted = []
      for tweet in tweets:
          if tweet.place:
              tweets_place.append(tweet.place.full_name)
          else:
              tweets_place.append('null')
      DataSet['TweetPlace'] = [i for i in tweets_place]
      #DataSet['UserWhoRetweeted'] = [i for i in users_retweeted]
       
      return DataSet
  
  OAUTH_KEYS = {'consumer_key':ckey, 'consumer_secret':csecret,'access_token_key':atoken, 'access_token_secret':asecret}
  auth = tweepy.OAuthHandler(OAUTH_KEYS['consumer_key'], OAUTH_KEYS['consumer_secret'])
  #auth = tweepy.AppAuthHandler('key', 'key')
   
  api = tweepy.API(auth, wait_on_rate_limit=True,wait_on_rate_limit_notify=True)
  if (not api):
      print (&quot;Can't Authenticate&quot;)
      sys.exit(-1)
  else:
  # I am trying to download from Dec 1st to Dec 7th but I am not able to
  
      cursor = tweepy.Cursor(api.search, q='#chennairains OR #chennaihelp OR #chennaifloods',since= '2015-12-20',until='2015-12-21',lang='en',count=100)
      results=[]
      for item in cursor.items():
          results.append(item)
          
      DataSet = toDataFrame(results)
      DataSet.to_csv('output.csv',index=False)
  </code></pre>
  <p>The program very well download data from within a week but not able to download from more beyond a week. I did try referencing few posts here but most of them are left unanswered.</p>