# Hacker News API — $0.0003 per story

> Hacker News API: HN stories by search query or the live front page — points, comments. $0.0003 per delivered story, nothing delivered means nothing charged.

[Home](https://quanticdata.io/)/[Collectors](https://quanticdata.io/collectors/)/*Hacker News API*

# Hacker News API

A Hacker News API that answers two questions from one endpoint: what is on the front page right now, and what HN has ever posted about a term. Leave the query empty for the live front page, or search the full archive by relevance or by date — either way you get one row per story with points, author, comment count, the outbound link and the discussion permalink.

[Get my free API key](https://app.quanticdata.io/register) [See the request](/collectors/hacker-news-api/#integration)

$0.0003 per delivered story · $2 free every month · Failed runs never billed

POST /v1/scraper/collectors/hacker_news/run

```
$ curl $QD/hacker_news/run \
    -H "Authorization: Bearer $QD_API_KEY" \
    -d '{"max_results": 30}'
{ "status": "done", "count": 30,
  "results": [
    {
      "id": "…",
      "title": "…",
      "url": "…",
      "points": … } ],
  "cost": 0.009 }
# 30 storys × $0.0003 · nothing delivered, nothing charged
```

**$0.0003 / story**6,666 storys on the free $2 every month

**Semantic input**query, type, sort — no URL lists

**Up to 200**storys per run, pagination handled for you

**No browser**read over HTTP/TLS — cheaper and faster than rendering

On this page: [What it is](/collectors/hacker-news-api/#what) [Output fields](/collectors/hacker-news-api/#output) [Inputs](/collectors/hacker-news-api/#input) [Pricing](/collectors/hacker-news-api/#pricing) [Integration](/collectors/hacker-news-api/#integration) [Use cases](/collectors/hacker-news-api/#use-cases) [Versus the alternatives](/collectors/hacker-news-api/#compare) [FAQ](/collectors/hacker-news-api/#faq)

## What a Hacker News API does

Hacker News publishes a Firebase feed of raw item ids, which means reconstructing a front page or a search is a fan-out of hundreds of per-item lookups you then have to assemble and rank yourself. This collector reads the official Algolia index that HN itself uses for search, so a front page or a keyword query comes back already ordered and already joined — one call per run, not a tree of them.

What lands is a flat table: title, the outbound `url` (null when the post is a text submission), `points`, `author`, `comments` and the timestamps, plus the `hn_url` that points at the discussion. Ask HN and Show HN are selectable as their own types, and self-post text arrives with its tags stripped, so a corpus of Show HN launches or Ask HN threads is a filter setting rather than a scraping project.

Input is meaning, not a URL *query* *type* *sort* *max_results*

## What one story looks like

Every delivered story carries these fields. Nullable means the source did not publish it — the field stays empty instead of being guessed.

| Field | Type | What it holds |
| --- | --- | --- |
| `rank` | integer | 1-based position. |
| `id` | string | HN item id. |
| `title` | string | Story title. |
| `url` | string · nullable | Outbound link (null for text posts). |
| `points` | integer · nullable | Upvotes. |
| `author` | string · nullable | Submitter. |
| `comments` | integer · nullable | Comment count. |
| `created_at` | string · nullable | Submission time (ISO 8601). |
| `text` | string · nullable | Self-post text (Ask HN), tags stripped. |
| `hn_url` | string | Link to the HN discussion. |
| `tags` | string[] | Index tags (story, show_hn…). |

## Inputs

The whole request. Anything you leave out falls back to the default shown in the catalog.

| Input | Type | Required | What it does |
| --- | --- | --- | --- |
| `query` | string | no | What to search. Empty = current front page. |
| `type` | string | no | Story type filter (default: story when searching, front_page otherwise). One of: `story`, `ask_hn`, `show_hn`, `front_page`. |
| `sort` | string | no | relevance (default when searching) or date (newest first). One of: `relevance`, `date`. |
| `max_results` | integer | no | How many stories to deliver at most (1–200). You pay only for delivered stories. |

Pricing

## Hacker News API pricing

$0.0003 per delivered story. A run that delivers nothing costs nothing: blocked pages, challenges and retries are on us, and the $2 monthly allowance covers about 6,666 storys before you spend anything.

**$0.0003**per delivered story*$0.24 per 1,000 delivered storys*

**6,666 storys**on the free allowance*$2 every month, no card*

**Zero rows**zero charge*blocks, captchas and retries are on us*

**−30%**on volume tiers*the catalog returns your key's price*

### Pay as you go

$0/mo

- $2 free credit / month

- 60 requests / min

- List unit prices

### Starter

$19/mo

- $15 free credit / month

- 300 requests / min

- 10% off unit prices

Most popular

### Growth

$79/mo

- $50 free credit / month

- 600 requests / min

- 20% off unit prices

### Scale

$299/mo

- $250 free credit / month

- 1,200 requests / min

- 30% off unit prices

Same wallet, same key and same $2 monthly allowance as every other [Data API](https://quanticdata.io/web-data-api-for-ai/). Prices are launch pricing read live from the billing config — `GET /v1/scraper/collectors` returns the price your key actually pays.

Integration

## One POST, typed rows

Base URL `https://api.quanticdata.io/v1`, Bearer auth, the same key as every other Data API. Endpoint: `POST /v1/scraper/collectors/hacker_news/run`.

```
curl -X POST https://api.quanticdata.io/v1/scraper/collectors/hacker_news/run \
  -H "Authorization: Bearer $QD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"max_results":30}'
```

```
import requests

r = requests.post(
    "https://api.quanticdata.io/v1/scraper/collectors/hacker_news/run",
    headers={"Authorization": f"Bearer {QD_API_KEY}"},
    json={
        "max_results": 30
    },
    timeout=120,
)
for row in r.json()["payload"]["results"]:
    print(row)
```

```
const res = await fetch(
  "https://api.quanticdata.io/v1/scraper/collectors/hacker_news/run",
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.QD_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({"max_results":30}),
  },
);
const { payload } = await res.json();
console.table(payload.results);
```

```
claude mcp add quantumproxies \
  -e QUANTUMPROXIES_API_KEY=qd_live_your_key_here \
  -- npx -y quantumproxies-mcp

# then, in the chat:
> run the hacker_news collector with max_results=30
```

## What people build with the Hacker News API

Three shapes of work this endpoint was designed around.

### Launch and sentiment monitoring

Search your product, a competitor or a topic across the whole archive and get every story with its points and comment count, so a spike in attention is a row with numbers rather than a screenshot someone sent you.

### Front-page datasets

Take the live front page on a schedule and you accumulate a time series of what the audience surfaced, ranked, with the outbound link and discussion link on each row.

### Show HN and Ask HN mining

Target the Show HN or Ask HN type to build a clean set of launches or questions — title, submitter, self-text and engagement — for trend analysis or lead discovery.

## Hacker News API versus rolling your own

The differences that actually cost time when you build this in-house.

|  | DIY scraper | This collector |
| --- | --- | --- |
| Assembly | Fan-out of per-item id lookups | One call, stories already ranked |
| Coverage | Front page or a hand-rolled index | Front page or the full Algolia archive |
| Row shape | Item ids to resolve and join | Title, points, author, comments, links |

## FAQ

Questions we get about the Hacker News API.

[Something else? Ask us →](mailto:hello@quanticdata.io)

### Which Hacker News API is this reading?

The official Algolia-powered search index — the same one behind HN's own search box — for both keyword queries and the front page. It is not the Firebase item feed, so you get ranked stories in one response instead of a list of ids to resolve one by one.

### Can I search old stories, or only what is live now?

Both. An empty query returns the current front page; a query with `sort` set to relevance or date searches the entire archive, so you can pull the highest-scoring stories about a term or the most recent ones.

### Do I get the comments themselves?

You get the comment count per story and the `hn_url` that links to the discussion, plus self-post text for Ask HN threads. The endpoint is story-level; it does not return the individual comment tree.

### Is there a free Hacker News API?

Every account gets $2 of credit every month with no card, which is about 6,666 delivered storys on this endpoint at $0.0003 each. It renews monthly, and a run that delivers nothing is never billed — so a failed or blocked attempt does not eat the allowance.

### How much does one run cost?

Multiply the rows you actually receive by $0.0003. A run capped at 200 storys — the maximum for this collector — costs $0.06 if every row comes back, and less when the source has fewer. Volume tiers take up to 30% off, and `GET /v1/scraper/collectors` returns the price your key actually pays.

## Run the Hacker News API now

$2 of free credit every month, no card. Your key returns its own prices from `GET /v1/scraper/collectors`.

[Get my free API key](https://app.quanticdata.io/register)

Related: [All 65 collectors](https://quanticdata.io/collectors/) [Reddit scraper API](https://quanticdata.io/collectors/reddit-scraper-api/) [Google search results API](https://quanticdata.io/collectors/google-search-results-api/) [Keyword research API](https://quanticdata.io/collectors/keyword-research-api/) [Stack Overflow API](https://quanticdata.io/collectors/stack-overflow-api/) [npm registry API](https://quanticdata.io/collectors/npm-registry-api/) [Documentation](https://quanticdata.io/docs/)

---

Source: https://quanticdata.io/collectors/hacker-news-api/ · Site index for AI: https://quanticdata.io/llms.txt
