title: Name Error - name api is not defined
body: <p>I am trying to extract tweets from twitter within certain time frame. code</p>
  
  <pre><code>import tweepy
  import csv
  from tweepy import OAuthHandler
  consumer_key = ''
  consumer_secret = ''
  access_token = ''
  access_secret = ''
  
  auth = OAuthHandler(consumer_key, consumer_secret)
  auth.set_access_token(access_token, access_secret)
  
  #csvFile=open('tweets.csv','a')
  #csvWriter=csv.writer(csvFile)
  
  for tweet in tweepy.Cursor(api.search,
                             q="#tatamotors",
                             lang="en",
                             since="2016-01-12",
                             until="2016-06-07").items():
  
      print (tweet.created_at, tweet.text)
      #csvWriter.writerow([tweet.created_at,tweet.text.encode('utf-8')])
  </code></pre>
  
  <p>i am getting - "name error: name api is not defined"</p>