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.
$0.0003 per delivered story · $2 free every month · Failed runs never billed
$ 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
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.
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.
Pay as you go
- $2 free credit / month
- 60 requests / min
- List unit prices
Starter
- $15 free credit / month
- 300 requests / min
- 10% off unit prices
Growth
- $50 free credit / month
- 600 requests / min
- 20% off unit prices
Scale
- $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. 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/.
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}'
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 |
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.