0
import tweepy

CONSUMER_KEY = ''
CONSUMER_SECRET = ''
ACCESS_KEY = ''
ACCESS_SECRET = ''

auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
api = tweepy.API(auth,wait_on_rate_limit=False)

    user = api.me()
    print(user.name)

    def main():
        search = ('asas','aadfsdfds',...)
        numberofTweets = 1000
        x = 0
        for tweet in tweepy.Cursor(api.search, search).items(numberofTweets):
            print(x)
            x +=1
            try:
                tweet.retweet()
                tweet.favorite()
                print("tweet retweeted.")
            except tweepy.TweepError as e:
                print(e.reason)
            except StopIteration:
                break

I set the number of tweet 1000, but it stops. 37. (check with x variable.)

How can I increase this limit? Why it ignores 1000?

babeyh
  • 659
  • 2
  • 7
  • 19
  • Does this answer your question? [Tweepy (Twitter API) Not Returning all Search Results](https://stackoverflow.com/questions/17371652/tweepy-twitter-api-not-returning-all-search-results) – MShakeG Apr 05 '20 at 15:35
  • I read and try it, but it doesn't work. – babeyh Apr 05 '20 at 15:43
  • have you checked the search rate limits for your app: https://developer.twitter.com/en/docs/basics/rate-limits – MShakeG Apr 05 '20 at 15:46
  • "24 hours limit 1000 like" I delete the array (search), I add only one word in Cursor; `... .Cursor(api.search, q='asdsd', ...` and it works. :) I don't understand how it worked. – babeyh Apr 05 '20 at 18:17

0 Answers0