Scraper APIHacker News
hackernews.stories
A page of a Hacker News list — the front page, new, best, Ask HN, Show HN or jobs — as the site orders it: title, link, points, author, comment count and time.
- Id
hackernews.stories- Version
- 1
- Billed per
- request — 1 unit for a charged run
- Runs
- within one request
Start it with POST /v1/scrapers/hackernews.stories/runs. How runs work is in Running a scraper; what a run costs is in Usage and units.
Inputs
The fields of input. A field that is not listed here is refused.
| Field | Type | Description |
|---|---|---|
list | "top" | "new" | "best" | "ask" | "show" | "jobs" | Which list: top (the front page), new, best, ask (Ask HN), show (Show HN) or jobs.Default: "top". |
page | integer | The page of the list, from 1; thirty rows a page. Only for top, best, ask and show: new and jobs give their first page.Limit: 1 to 20. Default: 1. |
max_results | integer | Return at most this many rows of the page; all thirty unless you say otherwise.Limit: 1 to 30. Default: 30. |
lististop(the front page),new,best,ask(Ask HN),show(Show HN) orjobs. One run reads one page of thirty rows;pageworks fortop,best,askandshow.rankis the number the page prints beside the row.urlis where the submission links to; a text post has none, andhn_urlis its own page.- A job advert has no
points,authororcomments.commentsis0where the page says "discuss".
Record fields
Every record of a run has these fields. A value that is not known is null — never an empty string and never 0.
| Field | Type | Notes |
|---|---|---|
rank | integer or null | The row's number on the list, as the page prints it: 1 to 30 on the first page, 31 to 60 on the second. |
list | string | The list the row was on: top, new, best, ask, show or jobs. |
page | integer | The page of the list the row was on, from 1. |
item_id | integer | Hacker News's id of the submission. |
title | string or null | The submission's title. |
url | string or null | The address the submission links to; null for a text post (an Ask HN), whose page is hn_url. |
site | string or null | The linked site as the page shows it beside the title, e.g. "github.com/pallets"; null for a text post. |
hn_url | string | The submission's own page on news.ycombinator.com, with its comments. |
points | integer or null | The submission's score; null for a job advert, which has none. |
author | string or null | The username of the account that submitted it; null for a job advert. |
comments | integer or null | How many comments the submission has; 0 when the page says "discuss"; null for a job advert. |
created_at | string (date-time) or null | When it was submitted, in UTC. |
fetched_at | string (date-time) | When the list was read, in UTC. |
Example request
# Start a run and wait up to 60 seconds for it to finish
curl -X POST "https://api.enrichednow.com/v1/scrapers/hackernews.stories/runs?wait=60" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"input":{"list":"top"}}'
# Read its records, with the id the first call answered
curl "https://api.enrichednow.com/v1/runs/$RUN_ID/records?limit=100" \
-H "Authorization: Bearer $ENRICHEDNOW_API_KEY"from enrichednow import EnrichedNow
client = EnrichedNow() # reads ENRICHEDNOW_API_KEY
# Start a run, wait for it to end, and get its records
result = client.scrape("hackernews.stories", {"list": "top"})
print(result.run.id, result.run.status, result.run.record_count)
# Read its records: pages are fetched as you go
for record in result.records:
print(record)Install it with pip install enrichednow, then save as run.py and run python3 run.py
import EnrichedNow from "enrichednow";
const client = new EnrichedNow(); // reads ENRICHEDNOW_API_KEY
// Start a run, wait for it to end, and get its records
const { run, records } = await client.scrape("hackernews.stories", { list: "top" });
console.log(run.id, run.status, run.record_count);
// Read its records: pages are fetched as you go
for await (const record of records) console.log(record);Install it with npm install enrichednow, then save as run.mjs and run node run.mjs
package main
import (
"context"
"fmt"
"log"
"time"
enrichednow "github.com/enrichednow/enrichednow-go"
)
func main() {
client, err := enrichednow.NewClient() // reads ENRICHEDNOW_API_KEY
if err != nil {
log.Fatal(err)
}
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
defer cancel()
// Start a run, wait for it to end, and get its records
run, records, err := client.Scrape(ctx, "hackernews.stories", map[string]any{"list": "top"})
if err != nil {
log.Fatal(err)
}
fmt.Println(run.ID, run.Status, run.RecordCount)
// Read its records: pages are fetched as you go
for records.Next() {
fmt.Println(string(records.Current()))
}
if err := records.Err(); err != nil {
log.Fatal(err)
}
}Install it with go get github.com/enrichednow/enrichednow-go@latest, then save as run.go and run go run run.go
import com.enrichednow.EnrichedNowClient;
import com.enrichednow.ScrapeResult;
import java.util.Map;
public class Run {
public static void main(String[] args) {
EnrichedNowClient client = EnrichedNowClient.fromEnv(); // reads ENRICHEDNOW_API_KEY
// Start a run, wait for it to end, and get its records
ScrapeResult result = client.scrape("hackernews.stories", Map.of("list", "top"));
System.out.println(result.run().id() + " " + result.run().status() + " " + result.run().recordCount());
// Read its records: pages are fetched as you go
for (Map<String, Object> record : result.records()) {
System.out.println(record);
}
}
}Add com.enrichednow:enrichednow-java:0.4.0 to your Maven or Gradle build, then save as Run.java
enrichednow run hackernews.stories --input list=topInstall it with curl -fsSL https://raw.githubusercontent.com/enrichednow/enrichednow-cli/main/install.sh | sh
It starts a run with this scraper’s example input, waits for it to finish and reads its records a page at a time. The key is read from ENRICHEDNOW_API_KEY.
The body on its own:
{
"input": {
"list": "top"
}
}Example response
The run, once it has ended. A run that has not ended within wait comes back with 202 and the status queued or running.
{
"id": "run_841742f37553189ff9c27ba1",
"scraper_id": "hackernews.stories",
"scraper_version": 1,
"status": "ok",
"reason": null,
"input": {
"list": "top"
},
"record_count": 1,
"units": 1,
"units_per_request": 1,
"units_per_record": null,
"units_per_page": null,
"diagnostics": {
"requests": 1,
"bytes": 259214,
"wall_ms": 885,
"facts": {}
},
"created_at": "2026-11-16T22:37:50.170950Z",
"started_at": "2026-11-16T22:37:50.178331Z",
"finished_at": "2026-11-16T22:37:51.066313Z"
}Its records, from GET /v1/runs/{id}/records. The record is a real one: this scraper's own parser read it from a page recorded from the site.
{
"records": [
{
"rank": 1,
"list": "top",
"page": 1,
"item_id": 50547374,
"title": "Unauthenticated remote code execution in Nginx",
"url": "https://www.wiz.io/blog/nginx-http2-rce-vulnerabilities",
"site": "wiz.io",
"hn_url": "https://news.ycombinator.com/item?id=50547374",
"points": 930,
"author": "speedping",
"comments": 412,
"created_at": "2026-11-18T15:19:55Z",
"fetched_at": "2026-11-19T18:07:40.802492Z"
}
],
"next_cursor": null
}A run does not always end ok. Results and statuses lists every status and the reasons every scraper shares; the reasons of the Hacker News scrapers are in their own section there.