TweetArchiveGuide
What is tweets.js and why isn’t it JSON?
tweets.js is the file in your X archive’s data folder that holds your posts. It is JSON wrapped in a JavaScript assignment — window.YTD.tweets.part0 = [ … ] — so the bundled viewer can load it, which is why JSON tools reject it. TweetArchive strips that prefix (without running the code), parses the JSON, and shows it as a timeline.
Step by step
Find the file
Look in the archive’s data folder for tweets.js (sometimes tweet.js, or tweets-part1.js, tweets-part2.js for big archives).
Understand the prefix
Everything before the first [ is a JavaScript assignment. The rest is JSON.
Skip the manual work
Open the whole ZIP in TweetArchive; it reads every part in order and merges them.
Export clean data
Download posts as CSV or JSON with IDs kept as text.
Open my ZIP in the browser
TweetArchive reads your X archive on your device. Nothing is uploaded. Free preview; $19 once for everything.
Open my archive ZIPHonest limitations
- There is no official public specification of the archive format that we could read; TweetArchive follows what several independent parsers document and discovers file names instead of assuming one layout.
- Some archives omit @usernames for DM partners; those people appear as a numeric user ID.
- TweetArchive is not affiliated with X Corp. and does not log in to X for you.
- Post IDs are larger than JavaScript can store as numbers, so they must be kept as strings (id_str). TweetArchive does that.
Frequently asked questions
Why is it .js and not .json?
So the offline viewer page can load it with a script tag. The data itself is JSON after the prefix.
What fields does a post have?
Parsers document fields like id_str, full_text, created_at, favorite_count, retweet_count, entities, and in_reply_to_status_id_str.
Can I just delete the prefix?
Yes, deleting text up to the first [ usually gives valid JSON. Never run the file as code in a tool you don’t trust.
What about direct-messages.js?
Same pattern: window.YTD.direct_messages.part0 = [ … ].
Related
- How to download your official X archive
- Privacy: what TweetArchive does and doesn’t see
- How do I open my X (Twitter) archive ZIP?
- Your archive.html is not loading
- How do I view DMs in my X archive?
- How do I search X archive DMs as evidence?
- How do I export X archive photos with the real date?
- How do I export my X archive to PDF?
- My X archive is several GB and won’t open on Windows
- I deleted my X account and only have the archive
- X archive media dates are wrong
- Is it safe to upload my X archive to a website?
- How do I download my official X archive?
- How do I convert my X archive to CSV or JSON?
- How do I view threads in my X archive?