TwiFlux

Tweet to JSON

Export single Twitter/X posts into validated, machine-readable JSON. Engineered for data engineers and researchers with 64-bit Snowflake string precision, uncollapsed note-tweet text, and rich media entity resolution.

Extracts normalized JSON with string IDs (64-bit Snowflake safe), author metadata, UTC timestamps, and media references.

Try a sample post:

How to convert a tweet to JSON

  1. Paste one public post link

    Paste the specific Twitter or X post URL you want to export. Profile, search, and media URLs do not identify one post.

  2. Inspect the normalized fields

    Check the full text, string ID, author, source URL, timestamps, returned metrics, and media references before downloading.

  3. Download or copy JSON

    Choose Download JSON for a local file or Copy JSON to pass the structured result to a script, archive, or database pipeline.

Why 64-bit Twitter Snowflake IDs require string types

Twitter generates post identifiers using the Snowflake algorithm — a 64-bit unsigned integer composed of a 41-bit millisecond timestamp, 10-bit machine identifier, and 12-bit per-machine sequence number. These IDs currently exceed 19 decimal digits (e.g. 1888473829102938472).

Under the IEEE 754 specification used by standard JavaScript engines and JSON specifications, Number.MAX_SAFE_INTEGER is capped at 9,007,199,254,740,991 (53 bits). Storing Snowflake IDs as raw numeric literals causes irreversible floating-point rounding errors (e.g., converting ...472 into ...500), which breaks post lookups and relational joins. TwiFlux strictly preserves all tweet IDs as string types (id_str) across both JSON keys and values.

Normalized JSON schema & field specifications

Every exported tweet follows a consistent, non-lossy dictionary schema designed for immediate ingestion into PostgreSQL (JSONB), MongoDB, Elasticsearch, or DuckDB:

  • id_str (string): The full 64-bit Snowflake identifier.
  • source_url (string): The canonical permalink on x.com.
  • created_at (string): Standardized publication timestamp preserving UTC timezone offsets.
  • author (object): Contains name, screen_name, author id_str, and high-res avatar source link.
  • full_text (string): Full uncompressed content, including emojis, CJK glyphs, and unshortened Note Tweet text up to 25,000 characters.
  • entities (object): Extracted arrays for expanded URLs (resolving opaque t.co wrappers), hashtags, user mentions, and attached media metadata.
  • media (array): Detailed asset declarations with native pixel dimensions, aspect ratios, thumbnail references, and video variant stream links (MP4 & HLS .m3u8).
  • metrics (object): Authentic public engagement numbers (likes, retweets, replies, quotes, bookmarks, impressions) captured at fetch time.

Downstream workflows: Python, Node.js, and CLI automation

Because TwiFlux outputs clean UTF-8 JSON without nested SDK bloat, querying and automating data pipelines is straightforward:

# Extract post ID and author using jq:

cat tweet.json | jq '{id: .id_str, user: .author.screen_name, text: .full_text}'

# Ingest into Python pandas or database:

import json, pandas as pd

data = json.load(open("tweet.json", encoding="utf-8"))

df = pd.json_normalize(data)

Tweet to JSON questions

Why are Twitter IDs formatted as strings instead of numbers in the JSON output?

Twitter Snowflake IDs are 64-bit unsigned integers (such as 1888473829102938472). Standard JavaScript numbers and JSON parsers conform to IEEE 754 double precision floats, where the maximum safe integer is 2^53 - 1 (9,007,199,254,740,991, or 16 digits). Storing Snowflake IDs as numbers causes floating-point roundoff truncation in the last 3-4 digits. TwiFlux strictly preserves id_str as a UTF-8 string to prevent data corruption in your database.

How does this converter handle X Premium long-form Note Tweets?

Standard scrapers only capture legacy 280-character excerpts from the legacy.full_text field, which appends an ellipsis and a t.co link. TwiFlux inspects note_tweet.note_tweet_results payloads to extract the full uncompressed text up to 25,000 characters without truncation.

How do I access original uncompressed image files from the JSON?

Each media entry in the entities.media array includes media_url_https. Twitter serves compressed previews by default (?name=small or ?name=900x900). To retrieve the highest quality master asset, append :orig or name=orig to the image URL, which is fully documented in the media metadata schema.

Is the JSON export format ready for database ingestion?

Yes. Timestamps use standard formats, string IDs prevent BigInt truncation, entity arrays (URLs, mentions, hashtags) are cleanly isolated, and missing metrics remain explicit nulls rather than inaccurate zeros.

Explore related developer tools

Part of our Twitter Data & Export Suite. Need plain text for language models? Use Tweet to TXT. Need multi-format exports for an entire thread? Switch to Twitter Thread to JSON or the Tweet Downloader.