# 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.

Hacker News stories, one of the Hacker News scrapers.

| | |
| --- | --- |
| 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](https://docs.enrichednow.com/running-a-scraper.md); what a run costs is in [Usage and units](https://docs.enrichednow.com/usage-and-units.md).

## Inputs

The fields of `input`. A field that is not listed here is refused.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `list` | "top" \| "new" \| "best" \| "ask" \| "show" \| "jobs" | no | Which list: top (the front page), new, best, ask (Ask HN), show (Show HN) or jobs. Default: `"top"`. |
| `page` | integer | no | 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 | no | Return at most this many rows of the page; all thirty unless you say otherwise. Limit: 1 to 30. Default: `30`. |

- `list` is `top` (the front page), `new`, `best`, `ask` (Ask HN), `show` (Show HN) or `jobs`. One run reads one page of thirty rows; `page` works for `top`, `best`, `ask` and `show`.
- `rank` is the number the page prints beside the row. `url` is where the submission links to; a text post has none, and `hn_url` is its own page.
- A job advert has no `points`, `author` or `comments`. `comments` is `0` where 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

It starts a run with this scraper's example input and waits up to 60 seconds for it. The key is read from `ENRICHEDNOW_API_KEY`.

```bash
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"}}'
```

## 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`.

```json
{
  "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.

```json
{
  "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](https://docs.enrichednow.com/results-and-statuses.md#reason-codes) lists every status and the reasons every scraper shares; [the reasons of the Hacker News scrapers](https://docs.enrichednow.com/results-and-statuses.md#hacker-news) are in their own section there.
