Source

Query Stack Exchange with SQL

Questions and answers across the Stack Exchange network — Stack Overflow, Mathematics, and every other landed site — queryable with read-only SQL by site, tag, author, score, and text.

Surface

  • Records83.4M+ questions + answers
  • Canonicalstackexchange.posts
  • FreshnessLive
  • Extentoriginal_timestamp 2008-07-31 to 2024-08-04
  • Cadencedata-dump base through 2024; only four sites (physics, electronics, tex, english) advance past their dump edge via the API tail
  • MethodStack Exchange data dumps plus a quota-bounded API tail; source-native post records.
  • StatsLast stats snapshot: 2026-08-27T12:11:07Z

Query surfaces

  • stackexchange.posts
  • embeddings.stackexchange_posts

Stack Exchange data dumps plus a quota-bounded API tail; source-native post records.

Best for

accepted answers and score-ranked questions per site and tag
Stack Overflow alone holds ~59.7M posts — scope site first
author output and score aggregates across sites

Fields

  • id
  • site
  • site_group
  • post_type
  • parent_id
  • title
  • payload
  • tags
  • original_author
  • original_author_id
  • score
  • view_count
  • answer_count
  • comment_count
  • accepted_answer_id
  • is_accepted
  • original_timestamp
  • last_activity_date
  • uri
  • metadata
  • source_file
  • ingested_at
  • loaded_at
  • search_text_lc

Read live from the schema registry for stackexchange.posts — 24 columns. Every relation's full contract is served by /v1/scry/schema.

Indexed predicates

  • PruneshasToken(search_text_lc, '<lowercase-token>')
  • PruneshasAllTokens(search_text_lc, ['<t1>','<t2>'])
  • PruneshasAnyTokens(search_text_lc, ['<t1>','<t2>'])
  • Prunessite = '<site>'

Queries

Top-scored questions on a topic

Scope site and post type, then match lowercase tokens and rank by score.

SELECT id, title, score, original_timestamp
FROM stackexchange.posts
WHERE site = 'stackoverflow'
  AND post_type = 'question'
  AND hasAllTokens(search_text_lc, ['borrow', 'checker'])
ORDER BY score DESC
LIMIT 20;

Sites by size

One aggregate shows which sites landed and how large each is.

SELECT site, count() AS posts
FROM stackexchange.posts
GROUP BY site
ORDER BY posts DESC
LIMIT 20;

Gaps

  • Hole2024-03-01 to 2026-08-01: post-dump-edge gap, ongoing at declaration (`to` is the declaration date, not a coverage resumption): the dump-backed base ends per site across 2024-03..2024-05, and the API tail back-fills forward chronologically on only 4 sites (physics, electronics, tex, english) — every other site ends at its dump edge until the tail widens or a dump true-up lands
  • Notecoverage ends at each site’s dump edge (2024-03 to 2024-05 for 183 of 184 sites); the declared hole is published on the schema entry — read it before treating 2024–2026 silence as real
  • Noteanswers reference their question through parent_id; post_type distinguishes 'question' from 'answer'
  • Notewithout a site or post_type filter a text search spans every landed site