src.data
.count_tweets
¶
-
src.data.
count_tweets
( query , from_date , to_date , credentials_path , yaml_key , count_bucket = 'day' , results_per_call = 500 , verbose = False , ** kwargs ) [source] ¶ -
Returns the number of existing Tweets for a given query and time frame. Since this function doesn’t pull tweets, this is a safe option to check the effectiveness of your filters without exhausting the API’s capacity.
- Parameters
-
- query str
-
Query passed to the Twitter API to fecth Tweets.
- from_date str or None
-
Date format as specified by convert_utc_time for the starting time of your search.
- to_date str or None
-
Date format as specified by convert_utc_time for the end time of your search.
- credentials_path str
-
Path for the yaml file with the Twitter API credentials.
- yaml_key str
-
Key within the yaml file containing the Twitter API credentials to be used.
- count_bucket str or None, default=”day”
-
If using the counts api endpoint, will define the count bucket for which tweets are aggregated.
- results_per_call int, default=500
-
Number of Tweets returned per call.
- verbose int or bool, default=False
-
Controls the verbosity when pulling the tweet count.
- Returns
-
- counts dict
-
Number of existing tweets for each bucket.