twarc Plugin
CLI tool for archiving Twitter/X data. Export your tweets to CSV or JSON format.
Commands
Configuration
twarc configure run— Configure twarc with X API credentials
Export Operations
twarc timeline export <username>— Export user timeline to JSONtwarc timeline export_csv <username>— Export user timeline to CSV
Utility
twarc self version— Print twarc versiontwarc help show— Show twarc helptwarc _ _— Run any twarc command directly
Usage Examples
Export all your tweets to JSON
twarc configure run # First time setup with API credentials
twarc timeline export your_username > tweets.json
Export all your tweets to CSV
twarc timeline export_csv your_username > tweets.csv
Installation
pip install twarc
Configuration
Before using twarc, you need to configure it with X API credentials:
- Go to https://developer.twitter.com/en/portal/dashboard
- Create a new app and get API credentials
- Run
twarc configureand enter your credentials when prompted
Required credentials:
- Consumer Key (API Key)
- Consumer Secret (API Secret)
- Access Token
- Access Token Secret
Key Features
- Archive all tweets from a user timeline
- Export to JSON or CSV format
- Full tweet data including metadata
- Supports filtering and search