+------------------------------------------+--------------------------------------+
| .. centered:: |Search Tweets|_ |
+------------------------------------------+--------------------------------------+
- | `GET search/tweets`_ | :meth:`API.search` |
+ | `GET search/tweets`_ | :meth:`API.search_tweets` |
+------------------------------------------+--------------------------------------+
| .. centered:: :ref:`Accounts and users` |
+------------------------------------------+--------------------------------------+
Search Tweets
-------------
-.. automethod:: API.search
+.. automethod:: API.search_tweets
Accounts and users
==================
With the bearer token received, we are now ready for business::
api = tweepy.API(auth)
- for tweet in tweepy.Cursor(api.search, q='tweepy').items(10):
+ for tweet in tweepy.Cursor(api.search_tweets, q='tweepy').items(10):
print(tweet.text)
\ No newline at end of file
auth = tweepy.AppAuthHandler("Consumer Key here", "Consumer Secret here")
api = tweepy.API(auth)
- for status in tweepy.Cursor(api.search, "Tweepy", count=100).items(250):
+ for status in tweepy.Cursor(api.search_tweets, "Tweepy",
+ count=100).items(250):
print(status.id)
for page in tweepy.Cursor(api.followers, screen_name="TwitterDev",
self.assertEqual(self.api.get_saved_search(s.id).query, 'test')
self.api.destroy_saved_search(s.id)
- @tape.use_cassette('testsearch.json')
- def testsearch(self):
- self.api.search('tweepy')
+ @tape.use_cassette('testsearchtweets.json')
+ def testsearchtweets(self):
+ self.api.search_tweets('tweepy')
@tape.use_cassette('testgeoapis.json')
def testgeoapis(self):
@pagination(mode='id')
@payload('search_results')
- def search(self, q, **kwargs):
- """search(q, *, geocode, lang, locale, result_type, count, until, \
- since_id, max_id, include_entities)
+ def search_tweets(self, q, **kwargs):
+ """search_tweets(q, *, geocode, lang, locale, result_type, count, \
+ until, since_id, max_id, include_entities)
Returns a collection of relevant Tweets matching a specified query.