Skip to main content

Archive tweets from the command line

Project description

twarc

twarc is a command line tool and Python library for collecting and archiving Twitter JSON data via the Twitter API. It has separate commands (twarc and twarc2) for working with the older v1.1 API and the newer v2 API and Academic Access (respectively). It also has an ecosystem of plugins for doing things with the collected data.

See the twarc documentation for running commands: twarc2 and twarc1 for using the v1.1 API. If you aren't sure about which one to use you'll want to start with twarc2 since the v1.1 is scheduled to be retired.

Install

If you have python installed, you can install twarc using:

pip3 install twarc

Once installed, you should be able to use the twarc and twarc2 command line utilities, or use it as a Python library - check the examples here for that.

Other Tools

Twarc is purpose build for working with the twitter API for archiving and studying digital trace data. It is not built as a general purpose API library for Twitter. While the primary use is academic, it works just as well with "Standard" v2 API and "Premium" v1.1 APIs.

For a list of general purpose Twitter Libraries in different languages see the Twitter Documentation. For Python, TwitterAPI and tweepy are both up to date and maintained. They also support v2 APIs, and their data format with expansions may differ from twarc. There is also a reference implementation of the v2 Academic Access Search and v1.1 Premium Search from Twitter here. The v2 version of this script is compatible with twarc.

For R there is academictwitteR. Unlike twarc, it focuses solely on querying the Twitter Academic Research Product Track v2 API endpoint. Data gathered in twarc can be imported into R for analysis as a dataframe if you export the data into CSV using twarc-csv.

Getting Help

Check the tutorials to get started, or follow along with this recorded stream introducing twarc. If you run into trouble, feel free to make a post on the Twarc Repository or on the Twitter Developer Forums.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

twarc-2.9.4.tar.gz (53.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

twarc-2.9.4-py3-none-any.whl (55.7 kB view details)

Uploaded Python 3

File details

Details for the file twarc-2.9.4.tar.gz.

File metadata

  • Download URL: twarc-2.9.4.tar.gz
  • Upload date:
  • Size: 53.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for twarc-2.9.4.tar.gz
Algorithm Hash digest
SHA256 af88b2df5b18c5b90b4ad5993cc799862cac5744e6316a5bf4fe300bb9d86fcf
MD5 e33ae5d93b2f294b18ff05f6e2571ce5
BLAKE2b-256 719d5a5e9b09d789720f63cc52d9462d6a834253efc7c6726f852148fa0932a5

See more details on using hashes here.

File details

Details for the file twarc-2.9.4-py3-none-any.whl.

File metadata

  • Download URL: twarc-2.9.4-py3-none-any.whl
  • Upload date:
  • Size: 55.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for twarc-2.9.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a2619a6f3028fb30d6cb911fe24415b1909da72d5a3bb496f04e560b3fee02d6
MD5 ba743d1ac74f4a0265cde373893d1d4d
BLAKE2b-256 c288495ab47e9c10644caa55965a2384feb805594d50ed269c597acbd11a071a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page