captures tweets, replies, media (photos, videos, gifs), quote tweets, link embeds, and every referenced author's profile.
bunx archive-twitter elonmusk --token "..." --zipcycle several accounts (spreads rate limits):
ARCHIVER_TOKENS="AAA,BBB,CCC" bun run src/cli.js jack| flag | description |
|---|---|
--token <auth_token> |
an auth_token cookie value. repeatable for multiple accounts. |
--tokens-file <path> |
file with one auth_token per line (or comma/space separated). |
--out <dir> |
output directory. default: <handle>-archive. |
--zip |
also produce a <out>.zip alongside the folder. |
--client <name> |
emusks client to emulate (e.g. tweetdeck). default: web. |
--endpoint <name> |
graphql endpoint: web | main | tweetdeck | ... |
--concurrency <n> |
parallel media downloads. default: 12. |
tokens can also come from the ARCHIVER_TOKENS env var.
- open x.com logged in
- devtools > application > cookies >
https://x.com - copy the value of
auth_token
any account that hits a rate limit is cooled down while the others keep working.
you should serve your archive folder with a static server:
cd <handle>-archive && bunx serveto share it, upload the folder to any static host (cloudflare pages, etc.). pass --zip to also get a single archive file.
please ensure you have permission before archiving tweets from any user.
not affiliated with X Corp. viewer by cv
