TweetArchiveGuide

Guide · Updated November 13, 2026 · by Cedano Labs LLC

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

  1. 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).

  2. Understand the prefix

    Everything before the first [ is a JavaScript assignment. The rest is JSON.

  3. Skip the manual work

    Open the whole ZIP in TweetArchive; it reads every part in order and merges them.

  4. 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 ZIP

Honest limitations

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

Sources

TweetArchive is an independent tool made by Cedano Labs LLC. It is not affiliated with, endorsed by, or sponsored by X Corp. “X” and “Twitter” are trademarks of X Corp., used here only to describe the archive format the tool reads. TweetArchive is not a forensic lab or a legal service, and its exports are not certified evidence. Markdown version: /what-is-tweets-js.md.