Hacker News Search Scraper avatar

Hacker News Search Scraper

Pricing

from $6.67 / 1,000 results

Go to Apify Store
Hacker News Search Scraper

Hacker News Search Scraper

Search Hacker News stories and comments: title, URL, author, points, comment counts and full comment text, with filters for Show HN, Ask HN, front page, author, score and date. Keyless Algolia index.

Pricing

from $6.67 / 1,000 results

Rating

0.0

(0)

Developer

Farhan Febrian Nauval

Farhan Febrian Nauval

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

23 days ago

Last modified

Categories

Share

Hacker News Search Scraper — Stories, Comments, Show HN & Ask HN

Search the whole Hacker News archive through its Algolia index: stories and comments with title, link, author, points, comment counts and full comment text, filtered by type, author, score and date. Keyless. No login, no browser, no proxy needed.

Input

Every field is optional, but give at least one of a search term, an item type or an author.

FieldTypeDefaultDescription
searchQueriesarray—One search per entry
itemTypesarrayallstory, comment, ask-hn, show-hn, poll, front-page
authorstring—Only items by this HN username
minPoints / minCommentsinteger—Score and discussion thresholds
createdAfterTimestamp / createdBeforeTimestampinteger—Unix seconds
sortByDatebooleanfalseNewest first instead of most relevant
maxItemsPerQueryinteger200Capped by the index at ~1,000

Searching by filters alone works: leave searchQueries empty and ask for every Show HN above 100 points.

Output

One row shape for both stories and comments.

{
"_input": "rust",
"_source": "S1-hn-algolia",
"_scrapedAt": "2026-09-09T14:02:31Z",
"objectId": "22238335",
"type": "story", // story | comment | ask_hn | show_hn | poll
"hnUrl": "https://news.ycombinator.com/item?id=22238335",
"title": "Why Discord is switching from Go to Rust",
"isOwnTitle": true, // false on a comment — see below
"url": "https://blog.discordapp.com/why-discord-is-switching-from-go-to-rust…",
"text": null, // comment body, plain text
"author": "Sikul",
"authorUrl": "https://news.ycombinator.com/user?id=Sikul",
"points": 1582,
"numComments": 642,
"childCount": 40,
"storyId": 22238335, "parentId": null,
"createdAt": "2020-02-04T17:30:40Z",
"createdAtTimestamp": 1580837440,
"updatedAt": "2023-09-06T20:31:44Z",
"tags": ["story", "author_Sikul", "story_22238335"]
}

Three things worth knowing

On a comment, title is the parent story's — isOwnTitle tells you which. Comments come back with story_title and story_url rather than their own, so a naive merge silently attributes a story's headline to a comment. Both are merged into title/url for a single usable row shape, and isOwnTitle is false whenever the title came from the parent. points and numComments are empty on comments because HN does not score them.

Only about 1,000 results per query are reachable. nbHits reports the true match count — 60,019 for one test — but nbPages × hitsPerPage always works out to roughly 1,000 whatever page size is requested. Paging past the end returns an empty hits list with nbPages: 0, which is honest as these things go. Slice by createdAfterTimestamp / createdBeforeTimestamp to walk a large query in windows.

Item type comes from _tags, not from which fields are missing. A comment can be spotted by its lack of a title, but that is fragile, and it cannot distinguish an Ask HN or Show HN post from a plain story. _tags states the kind outright, so that is what type is derived from.

Errors

_errorMeaning
no_resultsThe search ran and matched nothing
unexpected_shapeA 200 without a hits list, or a hit without an objectID
blockedEvery TLS profile was refused
network_errorThe ladder never reached the server

If every search fails, the run itself fails rather than reporting success over an empty dataset.