Datasets:
Add 2016-04 (202,679 items)
Browse files- README.md +39 -48
- data/2016/2016-04.parquet +3 -0
- stats.csv +1 -1
README.md
CHANGED
|
@@ -53,7 +53,7 @@ configs:
|
|
| 53 |
|
| 54 |
This dataset contains the complete [Hacker News](https://news.ycombinator.com) archive: every story, comment, Ask HN, Show HN, job posting, and poll ever submitted to the site. Hacker News is one of the longest-running and most influential technology communities on the internet, operated by [Y Combinator](https://www.ycombinator.com) since 2007. It has become the de facto gathering place for founders, engineers, researchers, and technologists to share and discuss what matters in technology.
|
| 55 |
|
| 56 |
-
The archive currently spans from **2006-10** to **2016-04**, with **
|
| 57 |
|
| 58 |
We believe this is one of the most complete and regularly updated mirrors of Hacker News data available on Hugging Face. The data is stored as monthly Parquet files sorted by item ID, making it straightforward to query with DuckDB, load with the `datasets` library, or process with any tool that reads Parquet.
|
| 59 |
|
|
@@ -80,11 +80,11 @@ Along with the Parquet files, we include `stats.csv` which tracks every committe
|
|
| 80 |
|
| 81 |
| Metric | Committed | Full Archive |
|
| 82 |
|--------|----------:|------------:|
|
| 83 |
-
| Items |
|
| 84 |
-
| Months |
|
| 85 |
| First month | 2006-10 | 2006-10 |
|
| 86 |
| Last committed | 2016-04 | |
|
| 87 |
-
| Total size |
|
| 88 |
| Contributors | | 1,085,135 |
|
| 89 |
| Stories | | 6,032,585 |
|
| 90 |
| Comments | | 41,264,455 |
|
|
@@ -98,13 +98,11 @@ You can load the full dataset, a specific year, or even a single month. The data
|
|
| 98 |
|
| 99 |
DuckDB can read Parquet files directly from Hugging Face without downloading anything first. This is the fastest way to explore the data:
|
| 100 |
|
| 101 |
-
The `type` column is stored as a small integer: `1` = story, `2` = comment, `3` = poll, `4` = pollopt, `5` = job. The `"by"` column (author username) must be quoted in DuckDB because `by` is a reserved keyword.
|
| 102 |
-
|
| 103 |
```sql
|
| 104 |
-- Top 20 highest-scored stories of all time
|
| 105 |
-
SELECT id, title,
|
| 106 |
FROM read_parquet('hf://datasets/open-index/hacker-news/data/*/*.parquet')
|
| 107 |
-
WHERE type =
|
| 108 |
ORDER BY score DESC
|
| 109 |
LIMIT 20;
|
| 110 |
```
|
|
@@ -114,8 +112,8 @@ LIMIT 20;
|
|
| 114 |
SELECT
|
| 115 |
strftime(time, '%Y-%m') AS month,
|
| 116 |
count(*) AS items,
|
| 117 |
-
|
| 118 |
-
|
| 119 |
FROM read_parquet('hf://datasets/open-index/hacker-news/data/2024/*.parquet')
|
| 120 |
GROUP BY month
|
| 121 |
ORDER BY month;
|
|
@@ -123,19 +121,19 @@ ORDER BY month;
|
|
| 123 |
|
| 124 |
```sql
|
| 125 |
-- Most discussed stories by total comment count
|
| 126 |
-
SELECT id, title,
|
| 127 |
FROM read_parquet('hf://datasets/open-index/hacker-news/data/2025/*.parquet')
|
| 128 |
-
WHERE type =
|
| 129 |
ORDER BY descendants DESC
|
| 130 |
LIMIT 20;
|
| 131 |
```
|
| 132 |
|
| 133 |
```sql
|
| 134 |
-- Who posts the most Ask HN questions?
|
| 135 |
-
SELECT
|
| 136 |
FROM read_parquet('hf://datasets/open-index/hacker-news/data/*/*.parquet')
|
| 137 |
-
WHERE type =
|
| 138 |
-
GROUP BY
|
| 139 |
ORDER BY posts DESC
|
| 140 |
LIMIT 20;
|
| 141 |
```
|
|
@@ -146,7 +144,7 @@ SELECT
|
|
| 146 |
extract(year FROM time) AS year,
|
| 147 |
count(*) AS mentions
|
| 148 |
FROM read_parquet('hf://datasets/open-index/hacker-news/data/*/*.parquet')
|
| 149 |
-
WHERE type =
|
| 150 |
GROUP BY year
|
| 151 |
ORDER BY year;
|
| 152 |
```
|
|
@@ -158,7 +156,7 @@ SELECT
|
|
| 158 |
regexp_extract(url, 'https?://([^/]+)', 1) AS domain,
|
| 159 |
count(*) AS stories
|
| 160 |
FROM read_parquet('hf://datasets/open-index/hacker-news/data/*/*.parquet')
|
| 161 |
-
WHERE type =
|
| 162 |
GROUP BY year, domain
|
| 163 |
QUALIFY row_number() OVER (PARTITION BY year ORDER BY stories DESC) <= 5
|
| 164 |
ORDER BY year, stories DESC;
|
|
@@ -182,7 +180,7 @@ ds = load_dataset(
|
|
| 182 |
)
|
| 183 |
print(f"{len(ds):,} items in 2024")
|
| 184 |
|
| 185 |
-
# Load today's live blocks
|
| 186 |
ds = load_dataset(
|
| 187 |
"open-index/hacker-news",
|
| 188 |
name="today",
|
|
@@ -224,7 +222,6 @@ import duckdb
|
|
| 224 |
conn = duckdb.connect()
|
| 225 |
|
| 226 |
# Score distribution: what does a "typical" HN story look like?
|
| 227 |
-
# type=1 is story (stored as integer: 1=story, 2=comment, 3=poll, 4=pollopt, 5=job)
|
| 228 |
df = conn.sql("""
|
| 229 |
SELECT
|
| 230 |
percentile_disc(0.50) WITHIN GROUP (ORDER BY score) AS p50,
|
|
@@ -232,7 +229,7 @@ df = conn.sql("""
|
|
| 232 |
percentile_disc(0.99) WITHIN GROUP (ORDER BY score) AS p99,
|
| 233 |
percentile_disc(0.999) WITHIN GROUP (ORDER BY score) AS p999
|
| 234 |
FROM read_parquet('hf://datasets/open-index/hacker-news/data/*/*.parquet')
|
| 235 |
-
WHERE type =
|
| 236 |
""").df()
|
| 237 |
print(df)
|
| 238 |
```
|
|
@@ -252,7 +249,7 @@ The chart below shows items committed to this dataset by year. As the historical
|
|
| 252 |
2013 ██████████████████████████████ 2.0M
|
| 253 |
2014 ███████████████████████████░░░ 1.8M
|
| 254 |
2015 █████████████████████████████░ 2.0M
|
| 255 |
-
2016 ███████████░░░░░░░░░░░░░░░░
|
| 256 |
```
|
| 257 |
|
| 258 |
You can also query the per-month statistics directly from the `stats.csv` file included in the dataset:
|
|
@@ -366,12 +363,12 @@ Here is an example item from the dataset. This is a story submission with a link
|
|
| 366 |
```json
|
| 367 |
{
|
| 368 |
"id": 1,
|
| 369 |
-
"deleted":
|
| 370 |
-
"type":
|
| 371 |
"by": "pg",
|
| 372 |
-
"time": "2006-10-09T18:21:
|
| 373 |
"text": "",
|
| 374 |
-
"dead":
|
| 375 |
"parent": 0,
|
| 376 |
"poll": 0,
|
| 377 |
"kids": [15, 234509, 487171],
|
|
@@ -379,8 +376,7 @@ Here is an example item from the dataset. This is a story submission with a link
|
|
| 379 |
"score": 57,
|
| 380 |
"title": "Y Combinator",
|
| 381 |
"parts": [],
|
| 382 |
-
"descendants": 0
|
| 383 |
-
"words": ["y", "combinator"]
|
| 384 |
}
|
| 385 |
```
|
| 386 |
|
|
@@ -389,12 +385,12 @@ And here is a comment, showing how discussion threads are connected via the `par
|
|
| 389 |
```json
|
| 390 |
{
|
| 391 |
"id": 15,
|
| 392 |
-
"deleted":
|
| 393 |
-
"type":
|
| 394 |
"by": "sama",
|
| 395 |
-
"time": "2006-10-09T19:51:
|
| 396 |
"text": "\"the way to get good software is to find ...",
|
| 397 |
-
"dead":
|
| 398 |
"parent": 1,
|
| 399 |
"poll": 0,
|
| 400 |
"kids": [17],
|
|
@@ -402,8 +398,7 @@ And here is a comment, showing how discussion threads are connected via the `par
|
|
| 402 |
"score": 0,
|
| 403 |
"title": "",
|
| 404 |
"parts": [],
|
| 405 |
-
"descendants": 0
|
| 406 |
-
"words": []
|
| 407 |
}
|
| 408 |
```
|
| 409 |
|
|
@@ -413,22 +408,21 @@ Every Parquet file shares the same schema, matching the [HN API](https://github.
|
|
| 413 |
|
| 414 |
| Column | Type | Description |
|
| 415 |
|--------|------|-------------|
|
| 416 |
-
| `id` |
|
| 417 |
-
| `deleted` |
|
| 418 |
-
| `type` |
|
| 419 |
-
| `by` | string | Username of the author who created this item
|
| 420 |
| `time` | timestamp | When the item was created, in UTC |
|
| 421 |
| `text` | string | HTML body text. Used for comments, Ask HN posts, job listings, and polls |
|
| 422 |
-
| `dead` |
|
| 423 |
-
| `parent` |
|
| 424 |
-
| `poll` |
|
| 425 |
-
| `kids` | list\<
|
| 426 |
| `url` | string | The external URL for link stories. Empty for text posts and comments |
|
| 427 |
-
| `score` |
|
| 428 |
| `title` | string | Title text for stories, jobs, and polls. Empty for comments |
|
| 429 |
-
| `parts` | list\<
|
| 430 |
-
| `descendants` |
|
| 431 |
-
| `words` | list\<string\> | Tokenized words extracted from the title and text fields |
|
| 432 |
|
| 433 |
### Data splits
|
| 434 |
|
|
@@ -492,9 +486,6 @@ We have not applied any additional filtering or quality scoring to the data. All
|
|
| 492 |
|
| 493 |
### Known limitations
|
| 494 |
|
| 495 |
-
- **`type` is an integer.** The item type is stored as a TINYINT enum: `1`=story, `2`=comment, `3`=poll, `4`=pollopt, `5`=job. When writing DuckDB queries, use `WHERE type = 1` for stories rather than `WHERE type = 'story'`.
|
| 496 |
-
- **`by` is a reserved keyword in DuckDB.** Always quote it with double quotes: `"by"`.
|
| 497 |
-
- **`deleted` and `dead` are integers.** They are stored as 0/1 rather than booleans.
|
| 498 |
- **Comment text is HTML.** The `text` field contains raw HTML as stored by HN, not plain text. You may need to strip tags depending on your use case.
|
| 499 |
- **Deleted items have sparse fields.** When an item is deleted, most fields become empty, but the `id` and `deleted` flag are preserved.
|
| 500 |
- **Scores are point-in-time snapshots.** The score reflects the value at the time the ClickHouse mirror last synced, not necessarily the final score.
|
|
|
|
| 53 |
|
| 54 |
This dataset contains the complete [Hacker News](https://news.ycombinator.com) archive: every story, comment, Ask HN, Show HN, job posting, and poll ever submitted to the site. Hacker News is one of the longest-running and most influential technology communities on the internet, operated by [Y Combinator](https://www.ycombinator.com) since 2007. It has become the de facto gathering place for founders, engineers, researchers, and technologists to share and discuss what matters in technology.
|
| 55 |
|
| 56 |
+
The archive currently spans from **2006-10** to **2016-04**, with **11806892 items** committed to this dataset so far out of **47,332,789 items** in the full archive. New items are published every 5 minutes through an automated live pipeline, so the dataset stays current with the site itself.
|
| 57 |
|
| 58 |
We believe this is one of the most complete and regularly updated mirrors of Hacker News data available on Hugging Face. The data is stored as monthly Parquet files sorted by item ID, making it straightforward to query with DuckDB, load with the `datasets` library, or process with any tool that reads Parquet.
|
| 59 |
|
|
|
|
| 80 |
|
| 81 |
| Metric | Committed | Full Archive |
|
| 82 |
|--------|----------:|------------:|
|
| 83 |
+
| Items | 11806892 | 47,332,789 |
|
| 84 |
+
| Months | 115 | |
|
| 85 |
| First month | 2006-10 | 2006-10 |
|
| 86 |
| Last committed | 2016-04 | |
|
| 87 |
+
| Total size | 2833.0 MB | |
|
| 88 |
| Contributors | | 1,085,135 |
|
| 89 |
| Stories | | 6,032,585 |
|
| 90 |
| Comments | | 41,264,455 |
|
|
|
|
| 98 |
|
| 99 |
DuckDB can read Parquet files directly from Hugging Face without downloading anything first. This is the fastest way to explore the data:
|
| 100 |
|
|
|
|
|
|
|
| 101 |
```sql
|
| 102 |
-- Top 20 highest-scored stories of all time
|
| 103 |
+
SELECT id, title, by, score, url, time
|
| 104 |
FROM read_parquet('hf://datasets/open-index/hacker-news/data/*/*.parquet')
|
| 105 |
+
WHERE type = 'story' AND title != ''
|
| 106 |
ORDER BY score DESC
|
| 107 |
LIMIT 20;
|
| 108 |
```
|
|
|
|
| 112 |
SELECT
|
| 113 |
strftime(time, '%Y-%m') AS month,
|
| 114 |
count(*) AS items,
|
| 115 |
+
countIf(type = 'story') AS stories,
|
| 116 |
+
countIf(type = 'comment') AS comments
|
| 117 |
FROM read_parquet('hf://datasets/open-index/hacker-news/data/2024/*.parquet')
|
| 118 |
GROUP BY month
|
| 119 |
ORDER BY month;
|
|
|
|
| 121 |
|
| 122 |
```sql
|
| 123 |
-- Most discussed stories by total comment count
|
| 124 |
+
SELECT id, title, by, score, descendants AS comments, url
|
| 125 |
FROM read_parquet('hf://datasets/open-index/hacker-news/data/2025/*.parquet')
|
| 126 |
+
WHERE type = 'story' AND descendants > 0
|
| 127 |
ORDER BY descendants DESC
|
| 128 |
LIMIT 20;
|
| 129 |
```
|
| 130 |
|
| 131 |
```sql
|
| 132 |
-- Who posts the most Ask HN questions?
|
| 133 |
+
SELECT by, count(*) AS posts
|
| 134 |
FROM read_parquet('hf://datasets/open-index/hacker-news/data/*/*.parquet')
|
| 135 |
+
WHERE type = 'story' AND title LIKE 'Ask HN:%'
|
| 136 |
+
GROUP BY by
|
| 137 |
ORDER BY posts DESC
|
| 138 |
LIMIT 20;
|
| 139 |
```
|
|
|
|
| 144 |
extract(year FROM time) AS year,
|
| 145 |
count(*) AS mentions
|
| 146 |
FROM read_parquet('hf://datasets/open-index/hacker-news/data/*/*.parquet')
|
| 147 |
+
WHERE type = 'story' AND lower(title) LIKE '%rust%'
|
| 148 |
GROUP BY year
|
| 149 |
ORDER BY year;
|
| 150 |
```
|
|
|
|
| 156 |
regexp_extract(url, 'https?://([^/]+)', 1) AS domain,
|
| 157 |
count(*) AS stories
|
| 158 |
FROM read_parquet('hf://datasets/open-index/hacker-news/data/*/*.parquet')
|
| 159 |
+
WHERE type = 'story' AND url != ''
|
| 160 |
GROUP BY year, domain
|
| 161 |
QUALIFY row_number() OVER (PARTITION BY year ORDER BY stories DESC) <= 5
|
| 162 |
ORDER BY year, stories DESC;
|
|
|
|
| 180 |
)
|
| 181 |
print(f"{len(ds):,} items in 2024")
|
| 182 |
|
| 183 |
+
# Load today's live blocks
|
| 184 |
ds = load_dataset(
|
| 185 |
"open-index/hacker-news",
|
| 186 |
name="today",
|
|
|
|
| 222 |
conn = duckdb.connect()
|
| 223 |
|
| 224 |
# Score distribution: what does a "typical" HN story look like?
|
|
|
|
| 225 |
df = conn.sql("""
|
| 226 |
SELECT
|
| 227 |
percentile_disc(0.50) WITHIN GROUP (ORDER BY score) AS p50,
|
|
|
|
| 229 |
percentile_disc(0.99) WITHIN GROUP (ORDER BY score) AS p99,
|
| 230 |
percentile_disc(0.999) WITHIN GROUP (ORDER BY score) AS p999
|
| 231 |
FROM read_parquet('hf://datasets/open-index/hacker-news/data/*/*.parquet')
|
| 232 |
+
WHERE type = 'story'
|
| 233 |
""").df()
|
| 234 |
print(df)
|
| 235 |
```
|
|
|
|
| 249 |
2013 ██████████████████████████████ 2.0M
|
| 250 |
2014 ███████████████████████████░░░ 1.8M
|
| 251 |
2015 █████████████████████████████░ 2.0M
|
| 252 |
+
2016 ██████████████░░░░░░░░░░░░░░░░ 985.9K
|
| 253 |
```
|
| 254 |
|
| 255 |
You can also query the per-month statistics directly from the `stats.csv` file included in the dataset:
|
|
|
|
| 363 |
```json
|
| 364 |
{
|
| 365 |
"id": 1,
|
| 366 |
+
"deleted": false,
|
| 367 |
+
"type": "story",
|
| 368 |
"by": "pg",
|
| 369 |
+
"time": "2006-10-09T18:21:51Z",
|
| 370 |
"text": "",
|
| 371 |
+
"dead": false,
|
| 372 |
"parent": 0,
|
| 373 |
"poll": 0,
|
| 374 |
"kids": [15, 234509, 487171],
|
|
|
|
| 376 |
"score": 57,
|
| 377 |
"title": "Y Combinator",
|
| 378 |
"parts": [],
|
| 379 |
+
"descendants": 0
|
|
|
|
| 380 |
}
|
| 381 |
```
|
| 382 |
|
|
|
|
| 385 |
```json
|
| 386 |
{
|
| 387 |
"id": 15,
|
| 388 |
+
"deleted": false,
|
| 389 |
+
"type": "comment",
|
| 390 |
"by": "sama",
|
| 391 |
+
"time": "2006-10-09T19:51:01Z",
|
| 392 |
"text": "\"the way to get good software is to find ...",
|
| 393 |
+
"dead": false,
|
| 394 |
"parent": 1,
|
| 395 |
"poll": 0,
|
| 396 |
"kids": [17],
|
|
|
|
| 398 |
"score": 0,
|
| 399 |
"title": "",
|
| 400 |
"parts": [],
|
| 401 |
+
"descendants": 0
|
|
|
|
| 402 |
}
|
| 403 |
```
|
| 404 |
|
|
|
|
| 408 |
|
| 409 |
| Column | Type | Description |
|
| 410 |
|--------|------|-------------|
|
| 411 |
+
| `id` | int64 | Unique item ID, monotonically increasing across the entire site |
|
| 412 |
+
| `deleted` | bool | True if the item was soft-deleted by its author or by moderators |
|
| 413 |
+
| `type` | string | One of: `story`, `comment`, `job`, `poll`, `pollopt` |
|
| 414 |
+
| `by` | string | Username of the author who created this item |
|
| 415 |
| `time` | timestamp | When the item was created, in UTC |
|
| 416 |
| `text` | string | HTML body text. Used for comments, Ask HN posts, job listings, and polls |
|
| 417 |
+
| `dead` | bool | True if the item was flagged or killed by moderators |
|
| 418 |
+
| `parent` | int64 | The ID of the parent item. For comments, this points to either a story or another comment |
|
| 419 |
+
| `poll` | int64 | For poll options (`pollopt`), the ID of the associated poll |
|
| 420 |
+
| `kids` | list\<int64\> | Ordered list of direct child item IDs (typically comments) |
|
| 421 |
| `url` | string | The external URL for link stories. Empty for text posts and comments |
|
| 422 |
+
| `score` | int64 | The item's score (upvotes minus downvotes) |
|
| 423 |
| `title` | string | Title text for stories, jobs, and polls. Empty for comments |
|
| 424 |
+
| `parts` | list\<int64\> | For polls, the list of associated poll option item IDs |
|
| 425 |
+
| `descendants` | int64 | Total number of comments in the entire discussion tree below this item |
|
|
|
|
| 426 |
|
| 427 |
### Data splits
|
| 428 |
|
|
|
|
| 486 |
|
| 487 |
### Known limitations
|
| 488 |
|
|
|
|
|
|
|
|
|
|
| 489 |
- **Comment text is HTML.** The `text` field contains raw HTML as stored by HN, not plain text. You may need to strip tags depending on your use case.
|
| 490 |
- **Deleted items have sparse fields.** When an item is deleted, most fields become empty, but the `id` and `deleted` flag are preserved.
|
| 491 |
- **Scores are point-in-time snapshots.** The score reflects the value at the time the ClickHouse mirror last synced, not necessarily the final score.
|
data/2016/2016-04.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e2daea4a10fd7ce61f17dca1379a970ef0dad8cde65f73899dbea9a42296e459
|
| 3 |
+
size 54016536
|
stats.csv
CHANGED
|
@@ -111,5 +111,5 @@ year,month,lowest_id,highest_id,count,dur_fetch_s,dur_commit_s,size_bytes,commit
|
|
| 111 |
2015,12,10652796,10820435,167348,4,29,45325687,2026-03-14T10:41:15Z
|
| 112 |
2016,1,10820436,11008769,187797,4,79,51501598,2026-03-14T10:41:49Z
|
| 113 |
2016,2,11008770,11199774,191004,4,123,50355398,2026-03-14T10:43:14Z
|
| 114 |
-
2016,3,11199775,11401538,201761,18,
|
| 115 |
2016,4,11401539,11604217,202679,5,0,54016536,2026-03-14T10:47:26Z
|
|
|
|
| 111 |
2015,12,10652796,10820435,167348,4,29,45325687,2026-03-14T10:41:15Z
|
| 112 |
2016,1,10820436,11008769,187797,4,79,51501598,2026-03-14T10:41:49Z
|
| 113 |
2016,2,11008770,11199774,191004,4,123,50355398,2026-03-14T10:43:14Z
|
| 114 |
+
2016,3,11199775,11401538,201761,18,112,53369736,2026-03-14T10:45:35Z
|
| 115 |
2016,4,11401539,11604217,202679,5,0,54016536,2026-03-14T10:47:26Z
|