Ajj1988
Ajj1988

Reputation: 21

Extracting replies to a tweet using academictwitteR

Having trouble with grabbing tweets using conversation_id. I have academic license and get_bearer() is working fine.

I'm running:

devtools::install_github("cjbarrie/academictwitteR", build_vignettes = TRUE, force = T)
get_bearer()

myquery<-build_query(conversation_id = "1392547623073030144")
myquery

get_all_tweets(query = myquery,
start_tweets = "2020-03-13",
end_tweets = "2021-03-13",
n = Inf,
data_path = "tweet_data",
bind_tweets = FALSE)

and I am getting the error

Error in make_query(url = endpoint_url, params = params, bearer_token = bearer_token, : something went wrong. Status code: 400

Any help would be greatly appreciated.

Upvotes: 1

Views: 213

Answers (1)

The problem is the date format. You have to use the one Twitter uses:

"YYYY-mm-ddT00:00:00Z"

Like this:

get_all_tweets(query = myquery,
start_tweets = "2020-03-13T00:00:00Z",
end_tweets = "2021-03-13T00:00:00Z",
n = Inf,
data_path = "tweet_data",
bind_tweets = FALSE)

Upvotes: 0

Related Questions