Hacker News

Search Hacker News stories and comments by keyword, author, story, points and date, and read up to 100 items by id in one call, as typed JSON.

Embed
Preview of the card
<a href="https://scrapelyserp.com/docs/hackernews"><img src="https://scrapelyserp.com/docs/_api/public/orgs/affc5b0f-d3c2-423a-8143-9d10db5736ae/spaces/981e6275-da3f-446c-82de-889f59c83b6f/pages/eaf6e4e0-1d48-498e-979a-0e95d539b1c0/social-card.svg?v=3e7ae33eec8b" alt="Hacker News" width="600" height="315"></a>

Search Hacker News stories and comments by keyword, author, story, points and date, and read up to 100 items by id in one call, as typed JSON.

At a glance

Two GET endpoints under /v1/structured/hackernews/. Each answers { endpoint, url, credits, duration_ms, data }. Each call is charged for the data it moves, and a call we could not read is 502 TARGET_FAILED and costs nothing. Rates are estimates until production traffic measures them.

Endpoint

What

Typical

GET /v1/structured/hackernews/search

Stories and comments matching query, with filters

about 5 million stories or about 2 million comments per credit, up to 100 per call

GET /v1/structured/hackernews/items

Items by ids, up to 100 per call

about 2.5 million items per credit

curl -G "https://api.scrapelyserp.com/v1/structured/hackernews/search" \
  -H "Authorization: Bearer $SCRAPELY_API_KEY" \
  --data-urlencode "query=web scraping" \
  -d sort=date \
  -d min_points=20

Parameter

Type

Default

Description

query

string

—

The search terms. Leave it out to list by the filters alone.

type

story, comment, ask_hn, show_hn, all

story

story, comment, ask_hn (Ask HN), show_hn (Show HN) or all.

sort

relevance, date

relevance

relevance, or date for newest first (to watch for mentions).

author

string

—

Only this user’s items, e.g. pg.

story

string

—

Only items under this story (its id or link): with type=comment, its comments.

min_points

integer

—

Only items with at least this many points. Comments have no points.

since

string

—

Only items from this time on: 2026-01-31, 2026-01-31T12:00:00Z or Unix seconds.

until

string

—

Only items up to this time, in the same forms.

limit

integer

30

Results per page, 1–100.

cursor

string

—

The next_cursor of the previous page (a page number).

Each result has id, type (story, comment, poll, pollopt or job), title, url (where a link story points), hn_url, author, points, comments, text (plain text of a text story or a comment), created_at, story_id, story_title and parent_id. A field an item does not have is null: a comment has no title and no points. total counts every match.

A query reaches its first 1,000 results

However large total is, only the first 1,000 results of a query can be paged to: limit times cursor must not exceed 1,000, or the call is a 400 that names the largest cursor. next_cursor is null at the end of that window. To go further back, narrow the query with since and until and ask again.

A query that matches nothing is an empty results with a total of 0. To watch for mentions, search with sort=date and a since that moves forward. A comment can match without its words being in the story, so filter on story to read one thread.

Full reference → GET /v1/structured/hackernews/search

Items by id

Parameter

Type

Default

Description

ids (required)

string

—

Comma-separated item ids (stories, comments, jobs, polls), e.g. 8863,2921983; links to items work too. Up to 100.

data.items are in the order you asked, with id, type, title, url, hn_url, author, points, comments (a story's whole comment count), text, created_at, parent_id and reply_ids, the ids of its direct replies, which you can send straight back as ids to read a thread level by level. A deleted item keeps only its id, type and time, with deleted set. An id that is not an item comes back in data.not_found, and a call where none is an item is a free 404 NOT_FOUND. If any id cannot be read after retries the whole call fails and costs nothing, so an answer is never partly missing.

Full reference → GET /v1/structured/hackernews/items

Updated