Source

Query Hacker News with SQL

Every Hacker News story and comment, queryable with read-only SQL — source-native records, timestamps, authors, scores, and a live tail.

Surface

  • Records45.3M+ stories + comments
  • Canonicalhackernews.items
  • FreshnessLive
  • Extentoriginal_timestamp 2006-10-09 to 2026-09-11
  • Cadencefull archive plus live tail; measured lag in /v1/scry/schema
  • MethodPublic Hacker News item API and archive-derived source-native records.
  • StatsLast stats snapshot: 2026-09-11T21:15:03Z

Query surfaces

  • hackernews.items

Public Hacker News item API and archive-derived source-native records.

Best for

phrase coinage and terminology diffusion
author-level activity and score histories
public discussion around technical topics

Fields

  • hn_id
  • search_key
  • source
  • external_type
  • kind
  • uri
  • hn_type
  • title
  • outbound_url
  • payload
  • blake3_hash
  • original_author
  • original_timestamp
  • parent_hn_id
  • story_hn_id
  • upvotes
  • comment_count
  • word_count
  • metadata
  • entity_id
  • anchor_entity_id
  • is_deleted
  • created_at
  • updated_at
  • loaded_at
  • search_text_lc

Read live from the schema registry for hackernews.items — 26 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>'])
  • Prunesparent_hn_id IN (<ids>)
  • Prunesstory_hn_id = <id>
  • Prunesoriginal_author = '<handle>'

Queries

Recent Hacker News items

Start from a bounded source-native sample before adding filters or aggregates.

SELECT hn_id, title, original_author, original_timestamp, uri
FROM hackernews.items
WHERE title != ''
ORDER BY hn_id DESC
LIMIT 20;

Author activity over time

Aggregate public Hacker News posts and comments by author and year.

SELECT toYear(original_timestamp) AS year,
       count() AS items,
       sum(ifNull(upvotes, 0)) AS upvotes
FROM hackernews.items
WHERE original_author = 'pg'
  AND original_timestamp IS NOT NULL
GROUP BY year
ORDER BY year DESC
LIMIT 20;

Gaps

  • Hole2006-10-09 to 2026-08-25: story_hn_id is NULL on ~78% of archive comments (nested replies never linked by the import; the live tail resolves it since 2026-08-25, the archive pass is pending) — a linkage hole, not a missing-row hole. Reconstruct threads through parent_hn_id, never story_hn_id alone.
  • Notedeleted or unavailable items remain marked as deleted rather than reconstructed
  • Noteauthors and timestamps may be absent on incomplete source records

Related proof pages