View source: R/search_tweets.R
search_tweets | R Documentation |
Returns Twitter statuses matching a user provided search query.
search_tweets2 Passes all arguments to search_tweets. Returns data from one OR MORE search queries.
search_tweets(
q,
n = 100,
type = c("mixed", "recent", "popular"),
include_rts = TRUE,
geocode = NULL,
since_id = NULL,
max_id = NULL,
parse = TRUE,
token = NULL,
retryonratelimit = NULL,
verbose = TRUE,
...
)
search_tweets2(...)
q |
Query to be searched, used to filter and select tweets to
return from Twitter's REST API. Must be a character string not to
exceed maximum of 500 characters. Spaces behave like boolean
"AND" operator. To search for tweets containing at least one of
multiple possible terms, separate each search term with spaces
and "OR" (in caps). For example, the search Some other useful query tips:
|
n |
Desired number of results to return. Results are downloaded
in pages when The Twitter API rate limits the number of requests you can perform
in each 15 minute period. The easiest way to download more than that is
to use You are not guaranteed to get exactly |
type |
Character string specifying which type of search
results to return from Twitter's REST API. The current default is
|
include_rts |
Logical, indicating whether to include retweets in search results. Retweets are classified as any tweet generated by Twitter's built-in "retweet" (recycle arrows) function. These are distinct from quotes (retweets with additional text provided from sender) or manual retweets (old school method of manually entering "RT" into the text of one's tweets). |
geocode |
Geographical limiter of the template
"latitude,longitude,radius" e.g., |
since_id |
Supply a vector of ids or a data frame of previous results to
find tweets newer than |
max_id |
Supply a vector of ids or a data frame of previous results to
find tweets older than |
parse |
If |
token |
Use this to override authentication for
a single API call. In many cases you are better off changing the
default for all calls. See |
retryonratelimit |
If If you expect a query to take hours or days to perform, you should not
rely solely on |
verbose |
Show progress bars and other messages indicating current progress? |
... |
Further arguments passed as query parameters in request
sent to Twitter's REST API. To return only English language
tweets, for example, use |
Twitter API documentation recommends limiting searches to 10 keywords and operators. Complex queries may also produce API errors preventing recovery of information related to the query. It should also be noted Twitter's search API does not consist of an index of all Tweets. At the time of searching, the search API index includes between only 6-9 days of Tweets.
List object with tweets and users each returned as a data frame.
A tbl data frame with additional "query" column.
https://developer.twitter.com/en/docs/twitter-api/v1/tweets/search/api-reference/get-search-tweets
tweet_search_recent()
, tweet_search_all()
, rtweet-deprecated
tweet_search_recent()
, rtweet-deprecated
Other tweets:
get_favorites()
,
get_mentions()
,
get_timeline()
,
lists_statuses()
,
lookup_tweets()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.