Querying HackerNews with DuckDB directly (HackerTube, HackerBooks & Wikihack)
Reading Karpathy’s
HackerTube, and then seeing a bunch of other apps on top of Hacker News like HackerBooks and Wikihacks:
Karim Jedda noted on
X “simpler to just publish the curated/filtered down datasets and let client” do the rest. That got me thinking: the
dataset is public on Hugging Face, and with DuckDB we can just query it directly from your terminal.
Let’s see how that looks and works.
# Querying all datasets from 2006-2026
Let’s read all rows available in that dataset for 2026 (run it yourself below with integrated DuckDB runner) - just replace 2026 with ** to read all data.
-- total across all years
SELECT count(*) AS total
FROM 'hf://datasets/open-index/hacker-news/data/2026/*.parquet';
|
|
The result for the second query:
See the dataset on Hugging Face open-index/hacker-news · Datasets at Hugging Face, it’s also what Karpathy used for his HackerTube page, see below.
See also Querying Bluesky with DuckDB and SQL for querying other datasets with a single DuckDB query.
# Querying HN for My Mentioned Domains
|
|
Gives the result of story domains: ssp.sh 108, sspaeti.com 8, dedp.online 5.
| type | n | first | last |
|---|---|---|---|
| story | 122 | 2021-03 | 2026-08 |
| comment | 32 | 2023-02 | 2026-08 |
Top stories by score:
| score | cmts | title |
|---|---|---|
| 499 | 241 | Self-Host and Tech Independence |
| 253 | 459 | From M1 MacBook to Arch Linux (Omarchy) |
| 226 | 81 | Finding Flow |
| 180 | 132 | Will AI Replace Human Thinking? |
| 123 | 19 | Data Engineering Vault: 1000 Node Second Brain |
| 108 | 100 | Vim Language, Motions, and Modes Explained (2023) |
| 101 | 79 | My Obsidian note-taking workflow |
| 84 | 22 | Data modeling guide for ClickHouse |
| 25 | 7 | Travel Locally, Where You Are |
| 14 | 1 | Data Engineering Design Patterns (DEDP) |
Rest ≤ 8 points. Posters: mostly articsputnik, then zazuke, sebg, sspaeti.
# HackerTube, HackerBooks & Wikihacks with DuckDB
Let’s now rebuild the HackerTube, HackerBooks & Wikihacks in three DuckDB queries, no UI needed 😉.
Latest full month is July 2026, so let’s try with that:
|
|
But this does not show all the titles so let’s use a more complex query:
|
|
And that looks like this:
# Other queries without title
|
|
|
|
# Further Reads
Origin: Karim Jedda on X, Blog – karpathy, HackerNews


