R/search-tweets.R
search_tweets.Rd
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.
search_tweets(queryString, fromDate = NULL, toDate = NULL, nextToken = NA, maxResult = 500, twitterBearerToken)
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 |
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 |
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.) |
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 |
the Twitter API JSON response as a JSON character string