| name | xfetch |
| description | Fast X/Twitter CLI scraper. Use when you need to fetch tweets, user profiles, search results, timelines, followers, or any X/Twitter data. No API keys required - uses cookie-based auth. |
| metadata | {"clawdbot":{"emoji":"🐦","requires":{"bins":["xfetch"]},"install":[{"id":"npm","kind":"node","package":"xfetch-cli","bins":["xfetch"],"label":"Install xfetch (npm)"}]}} |
xfetch 🐦
Fast X/Twitter CLI scraper. No API keys. Just cookies and go.
Install
npm install -g xfetch-cli
Authentication
xfetch requires Twitter session cookies (auth_token and ct0).
Set tokens directly:
xfetch auth set --auth-token <token> --ct0 <token>
Check auth status:
xfetch auth check
Get cookies from browser: Open X.com in Chrome DevTools → Application → Cookies → Copy auth_token and ct0 values.
Commands
User Data
xfetch user @handle
xfetch user 12345678
xfetch followers @handle -n 100
xfetch following @handle -n 100
Tweets
xfetch tweets @handle -n 50
xfetch tweet <url-or-id>
xfetch thread <url-or-id>
Search
xfetch search "query" -n 100
xfetch search "from:handle since:2024-01-01"
xfetch search "query" --type latest
Timelines
xfetch home
xfetch home --following
xfetch bookmarks -n 50
xfetch likes @handle -n 50
Output Formats
xfetch tweets @handle --format json
xfetch tweets @handle --format jsonl
xfetch tweets @handle --json
xfetch tweets @handle --plain
Pagination
xfetch tweets @handle --all
xfetch tweets @handle --max-pages 10
xfetch tweets @handle --cursor <cursor>
xfetch tweets @handle --delay 1000
Query ID Management
Twitter changes GraphQL query IDs frequently. xfetch auto-refreshes them.
xfetch query-ids --list
xfetch query-ids --refresh
Global Options
--auth-token <token>
--ct0 <token>
--format <format>
--timeout <ms>
--delay <ms>
--proxy <url>
Examples
Get recent tweets from a user:
xfetch tweets @elonmusk -n 20 --format jsonl
Search for AI content:
xfetch search "AI agents" --type latest -n 50
Get thread/conversation:
xfetch thread https://x.com/user/status/123456789
Export followers to JSON:
xfetch followers @handle --all > followers.json
Rate Limits
xfetch tracks rate limits per endpoint and automatically backs off when approaching limits. For high-volume scraping, use --delay to add time between requests.
Source
GitHub: https://github.com/LXGIC-Studios/xfetch