search_tweets: Get JSON response for a single full archive Tweet search...

Description Usage Arguments Value

View source: R/search-tweets.R

Description

v2_tweets_search_all allows to execute a single Tweet search API call against the /2/tweets/search/all endpoint in the Twitter Academic Research product track.

Usage

1
2
search_tweets(queryString, fromDate = NULL, toDate = NULL,
  nextToken = NA, maxResult = 500, twitterBearerToken)

Arguments

queryString

a character string specifying a value for the Tweet search query parameter (e.g. "sustainability (climate change)", "from:stefandaume" etc). See here for details. Maximum of 1024 characters.

fromDate

an optional character string of format ("YYYY-MM-DD") specifying the date for the oldest Tweets to be included in the search result (interpreted as inclusive); corresponds to the start_time parameter of the /2/tweets/search/all endpoint. Must NOT be a date before "2006-03-21". If no value is supplied (default), it is interpreted as the 30th day before toDate.

toDate

an optional character string of format ("YYYY-MM-DD") specifying the date for the most recent Tweets to be included in the search result (interpreted as inclusive); corresponds to the end_time parameter of the /2/tweets/search/all endpoint. If no value is supplied (default), it is interpreted as the current date.

nextToken

a character string specifying a token used to iterate over search results larger than the maximum of 500. If a Tweet search has more results, the metadata section in the JSON response will provide a next_token value, which can be used to paginate over the next set of results (see here for details.) search_and_store_tweets() uses this mechanism to retrieve complete result sets.

maxResult

an integer specifying the maximum number of Tweets returned in a single search API call (minimum is 10, maximum is 500)

twitterBearerToken

a character string specifying a valid bearer token for the Twitter Academic Research product track (see oauth_twitter_token()).

Value

the Twitter API JSON response as a JSON character string


sdaume/twittrcademic documentation built on Dec. 22, 2021, 11:11 p.m.