twipper.premium

twipper.premium.search_tweets(access, query, page_count, from_date, to_date, language=None, filter_retweets=False)

This function retrieves historical tweets on batch processing from Twitter’s Full Archive or 30Day. These tweets contain the specified words on the query, which can use premium operators as specified on https://developer.twitter.com/en/docs/tweets/rules-and-filtering/overview/premium-operators. Additionally, some extra arguments can be specified in order to particularize the tweet search, so on to retrieve the exact content we are looking for. Retrieved tweets are stored on a list which will lated be returned once it is filled with the retrieved tweets.

Parameters:
  • access (twipper.credentials.Twipper) – object containing all the credentials needed to access api.twitter
  • query (str) – contains the query with the words to search along Twitter historic data.
  • page_count (int) – specifies the amount of pages (100 tweets per page) to retrieve data from.
  • from_date (str) – starting date of the time interval to retrieve tweets from (yyyymmddhhmm format)
  • to_date (str) – end date of the time interval to retrieve tweets from (yyyymmddhhmm format)
  • language (str) – is the language on which the tweet has been written.
  • filter_retweets (boolean, optional) – can be either True or False, to filter out retweets or not, respectively.
Returns:

description

Returns a list containing all the retrieved tweets from Twitter, which means all the available tweets from the user specified on the arguments of the function.

Return type:

tweets (list)

Raises:

ValueError – raised if the introduced arguments do not match or errored.

twipper.premium.search_user_tweets(access, screen_name, page_count, from_date, to_date, language=None, filter_retweets=False)

This function retrieves historical tweets on batch processing from Twitter’s Full Archive or 30Day from a specific user via its screen name (Twitter name). These tweets contain the specified words on the query, which can use premium operators as specified on https://developer.twitter.com/en/docs/tweets/rules-and-filtering/overview/premium-operators. Additionally, some extra arguments can be specified in order to particularize the tweet search, so on to retrieve the exact content we are looking for. Retrieved tweets are stored on a list which will lated be returned once it is filled with the retrieved tweets.

Parameters:
  • access (twipper.credentials.Twipper) – object containing all the credentials needed to access api.twitter
  • screen_name (str) – is the Twitter’s public name of the account that tweets are going to be retrieved, note that the account must be public.
  • page_count (int) – specifies the amount of pages (100 tweets per page) to retrieve data from.
  • from_date (str) – starting date of the time interval to retrieve tweets from (yyyymmddhhmm format)
  • to_date (str) – end date of the time interval to retrieve tweets from (yyyymmddhhmm format)
  • language (str) – is the language on which the tweet has been written.
  • filter_retweets (boolean, optional) – can be either True or False, to filter out retweets or not, respectively.
Returns:

description

Returns a list containing all the retrieved tweets from Twitter, which means all the available tweets from the user specified on the arguments of the function.

Return type:

tweets (list)

Raises:

ValueError – raised if the introduced arguments do not match or errored.