--- license: odc-by language: [en] pretty_name: Hacker News items (parquet, monthly) size_categories: [10M | poll options, child comment ids | | `dead`, `deleted` | bool | null when false | Counts (2026-11-28): comments 44.06M, stories 6.36M, jobs 18k, polls 2.3k, poll options 16k. ## Quick start Pick whichever fits. Each month is one file (max ~97 MB), so filter by path to read less. **DuckDB (no download, reads straight from the Hub)** ```python import duckdb duckdb.sql(""" select by, count(*) n from 'hf://datasets/adhikasp/hackernews/data/year=2025/*/data.parquet' where type='comment' group by 1 order by n desc limit 10 """).show() ``` **DuckDB CLI** ```sql INSTALL httpfs; LOAD httpfs; SELECT title, score FROM 'hf://datasets/adhikasp/hackernews/data/year=2026/month=11/data.parquet' WHERE type='story' ORDER BY score DESC LIMIT 10; ``` **Polars (lazy, only fetches what it needs)** ```python import polars as pl lf = pl.scan_parquet("hf://datasets/adhikasp/hackernews/data/year=2025/*/data.parquet") lf.filter(pl.col("type") == "story").select("title", "score").sort("score", descending=True).head(10).collect() ``` **pandas** ```python import pandas as pd df = pd.read_parquet("hf://datasets/adhikasp/hackernews/data/year=2026/month=11/data.parquet") ``` **Hugging Face `datasets` (streaming, nothing stored)** ```python from datasets import load_dataset ds = load_dataset("adhikasp/hackernews", split="train", streaming=True) for row in ds.take(3): print(row["id"], row["type"], row["title"]) ``` **Download a slice** ```bash hf download adhikasp/hackernews --repo-type dataset --include "data/year=2025/*" --local-dir hn # or one month with plain curl curl -LO "https://huggingface.co/datasets/adhikasp/hackernews/resolve/main/data/year=2026/month=11/data.parquet" ``` **Whole dataset** (7.3 GiB): `hf download adhikasp/hackernews --repo-type dataset --local-dir hn`, then `duckdb.sql("select count(*) from 'hn/data/*/*/data.parquet'")`. Mirror without the Hub: `https://hacker-news.adhikasp.id/year=2025/month=1/data.parquet` (same files). ### Handy queries ```sql -- most-discussed stories of a month select title, score, descendants from 'hf://datasets/adhikasp/hackernews/data/year=2025/month=1/data.parquet' where type='story' order by descendants desc limit 10; -- comments per month in a year select month, count(*) from 'hf://datasets/adhikasp/hackernews/data/year=2025/*/data.parquet' where type='comment' group by 1 order by 1; ``` ## Notes - Items fetched live can still change (scores, new kids, deletions). The current and previous month are refreshed on each update; older months are stable. - Gaps in `id` are items the API returns as null (never existed or purged). - Hacker News content belongs to its authors and Y Combinator; this is a mirror of what the public API serves. Source/fetcher: `hn-data-fetcher` (PyPI, GitHub `adhikasp/hn-data-fetcher`).