question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'twarc search' retrevieing slightly different results compared to 'rtweet::search_tweets()'?

See original GitHub issue

Hi all,

Trying to get off the ground with the Twitter API and doing some sanity checks for basic calls across different API wrappers. I really like twarc and rtweet, and it has been a pretty straightforward experience so far! Before running larger calls, I’m trying to wrap my head around the basic functionality of the API, especially around geocoded calls. As my baseline, I am trying to pull all the tweets in a two-mile area around College Park, MD, in the last 7 days.

Here is the twarc command I am using:

twarc search --geocode 38.987202,-76.945999,2mi > tweets.jsonl

Which returned 3594 records. Shortly thereafter, I tried the following command in rtweet:

rt2mi <- search_tweets(
  geocode = "38.987202,-76.945999,2mi",
  retryonratelimit = TRUE,
  n = 10000
)

Which returns about 3610 tweets.

Surface-level checks indicate that they are indeed pulling the same tweets, but I’m coming up a bit short using twarc.

Are there any obvious reasons for this discrepancy? Or perhaps I’m missing something about the underlying twitter API? I am using the same API keys and access tokens.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
edsucommented, Sep 19, 2020

If you figure out a good way to read line-oriented-json from R please let us know as it’s a question that has come up here periodically, e.g. #322

1reaction
edsucommented, Sep 19, 2020

Yes, that’s a good question. The twarc command line outputs each tweet on a line so you can count the number of lines in the file. On Unix/OSX you can:

twarc search --geocode 38.987202,-76.945999,2mi > tweets.jsonl
wc -l tweets.jsonl

Does that make sense?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Academic Research Access Retrieving Tweets
I want to retrieve Tweets in English and Tweets tweeted within the United States. Does the following query look correct: GET/2/tweets/search/all ...
Read more >
twarc2 (en) - twarc
This command will search for any tweets mentioning blacklivesmatter from the 7 days.
Read more >
Twarc Commands | Digital Collecting Toolkit
Please note that the syntax for the Twitter's track queries is slightly different than what queries in their search API. So please consult...
Read more >
Start Collecting: Twarc Command Basics - Scholars' Lab Repo
Each time you use twarc to collect twitter data, start here: ... the Twitter's track queries is slightly different than what queries in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found