Source
Query the historical Twitter archive with SQL
A historical archive of public Twitter/X posts — about 43 billion unique posts from 235 million authors (measured 2026-08-26), with engagement counts, reply and quote links, and author profiles — queryable with read-only SQL by text, author, and date.
Query surfaces
twitter.tweetstwitter.token_searchtwitter.author_timelinetwitter.userstwitter.vector_searchembeddings.tweets
Historical archive of public posts and author profiles; source-native records with observation time.
Best for
one author’s whole public posting history through twitter.author_timeline
token search across the archive through twitter.token_search, or column-level token predicates on twitter.tweets
author discovery by bio — twitter.users indexes the lowercase bio text
Fields
tweet_idauthor_idauthor_handleauthor_display_nameauthor_followersis_blue_verifieduser_verifiedoriginal_timestampbucket_datetextlangis_quote_statusquoted_tweet_idin_reply_to_tweet_idquote_countreply_countretweet_countlike_countview_countbookmark_countrequested_user_idobserved_atsource_filetext_is_completearticle_idarticle_titlearticle_textarticle_preview_textarticle_content_statearticle_published_atarticle_modified_atloaded_atreplacement_versionsearch_text_lc
Read live from the schema registry for twitter.tweets — 34 columns. Every relation's full contract is served by /v1/scry/schema.
Queries
An author’s timeline, newest first
The parameterized per-author path; rows are observations, so collapse on tweet_id.
SELECT tweet_id, original_timestamp, like_count, text
FROM (
SELECT * FROM twitter.author_timeline(handle = 'karpathy', limit = 200)
ORDER BY loaded_at DESC
LIMIT 1 BY tweet_id
)
ORDER BY original_timestamp DESC
LIMIT 20;
Recent posts matching two tokens
Scope the date, match the indexed lowercase tokens, drop retweets, collapse revisions.
SELECT tweet_id, author_handle, original_timestamp, like_count, text
FROM (
SELECT * FROM twitter.tweets
WHERE bucket_date >= today() - 90
AND hasAllTokens(search_text_lc, ['clickhouse', 'benchmark'])
AND NOT startsWith(text, 'RT @')
ORDER BY (text_is_complete, observed_at) DESC
LIMIT 1 BY tweet_id
)
ORDER BY original_timestamp DESC
LIMIT 20;Find authors by what their bio says
Profiles converge to one latest row per author; aggregate to be exact.
SELECT author_id, argMax(handle, version) AS latest_handle, max(followers) AS followers, argMax(bio, version) AS latest_bio
FROM twitter.users
WHERE hasAllTokens(bio_lc, ['rust', 'compiler'])
GROUP BY author_id
ORDER BY followers DESC
LIMIT 20;