You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the easier method as described in the V2 documentation on GitHub, using collect_results.
The problem is as follows. I am trying to loop the whole code through a list of keywords, with the number of tweets for each keyword specific in a dictionary for each keyword that need to be pulled. All of them are below the limit fo 450 requests per 15 min.
Now, I have narrowed down the problem to the following.
If I give an integer value to max_tweets, such as max_tweets = 45000, it works fine…but if I write max_tweets = num and num = 45000 or whatever the value that corresponds to the keyword currently in the loop, the rate limit is hit. The API call does not stop when max_tweets have been reached (if I pass a variable to it). But if I pass an integer directly, the function runs fine.
I have checked the value of num and it is indeed 45k just before being passed to max_tweets, the limit does not apply and rate limit is hit.
Very weird behavior. Anyone got some clues as to this behavior?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I am using the V2 reecent tweets search endpoint.
I am using the easier method as described in the V2 documentation on GitHub, using
collect_results
.The problem is as follows. I am trying to loop the whole code through a list of keywords, with the number of tweets for each keyword specific in a dictionary for each keyword that need to be pulled. All of them are below the limit fo 450 requests per 15 min.
Now, I have narrowed down the problem to the following.
In the method as follows:
In the following collect_results method:
If I give an integer value to
max_tweets
, such asmax_tweets = 45000
, it works fine…but if I writemax_tweets = num
andnum = 45000
or whatever the value that corresponds to the keyword currently in the loop, the rate limit is hit. The API call does not stop when max_tweets have been reached (if I pass a variable to it). But if I pass an integer directly, the function runs fine.I have checked the value of num and it is indeed 45k just before being passed to max_tweets, the limit does not apply and rate limit is hit.
Very weird behavior. Anyone got some clues as to this behavior?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions