Tweetshot is a robust tool for capturing X (Twitter) posts in batch as clean, high-quality screenshots. It supports advanced filtering, metadata export, and automatic packaging. The CLI is designed for AI agents and workflow automation.
- Batch Capture: Rapidly scan and capture profile timelines.
- Flexible Target Modes:
- Count: Specify exactly how many tweets to capture.
- Date: Pull everything since a specific UTC date.
- Hours: Capture posts from the last N hours.
- Deep Filters: Filter by post type (Original, Retweet, Reply, Quote), media content (Text, Image, Video), or presence of external links.
- Pro Output:
- High Resolution: Configurable scale factor (up to 3x).
- Theming: Support for Dark and Light modes.
- Packaging: Output as individual images or a single ZIP archive.
- Metadata: Export tweet data directly to
outputs/as.jsonfiles.
- Two Ways to Use: Modern FastAPI-based Web UI or a powerful CLI.
.
├── app.py # FastAPI server + REST API
├── screenshot.py # Core capture engine + CLI commands
├── auth.py # Interactive auth helper
├── static/ # Web UI (HTML/CSS/JS)
├── outputs/ # (Auto-created) Captured screenshots & metadata
└── auth.json # (Auto-created) Login session storage
- Python 3.10+
# Install dependencies
pip install -r requirements.txt
playwright install chromiumpython app.pyAlternatively: uvicorn app:app --host 127.0.0.1 --port 8000 --reload
Open http://localhost:8000 in your browser.
X capture quality and reliability depend on valid login cookies (auth_token, ct0).
- Web UI: Open the Auth Status bar in the header and paste your
Cookie:header. - CLI: Run
python auth.pyand follow the interactive prompts. - Check Status:
python screenshot.py auth-status
# Basic Batch
python screenshot.py batch "https://x.com/username" --count 10
# Advanced Filtering
python screenshot.py batch "https://x.com/username" \
--since-hours 24 \
--types original,reply \
--media image \
--export-json \
--zip-output
# Headed Mode (for debugging)
python screenshot.py batch "https://x.com/username" --count 5 --headed
