Hacker News Scraper - Stories, Jobs & Nested Comments avatar

Hacker News Scraper - Stories, Jobs & Nested Comments

Pricing

$5.00 / 1,000 posts scraped

Go to Apify Store
Hacker News Scraper - Stories, Jobs & Nested Comments

Hacker News Scraper - Stories, Jobs & Nested Comments

Scrape Hacker News front page, newest, best, Ask HN, Show HN or Jobs, with title, score, author, URL and up to 100 top-level comments per post in the same item. No login or API key needed. $0.005 per post scraped, free plan included.

Pricing

$5.00 / 1,000 posts scraped

Rating

0.0

(0)

Developer

Gio

Gio

Maintained by Community

Actor stats

0

Bookmarked

5

Total users

0

Monthly active users

11 days ago

Last modified

Categories

Features

Limited permissions

Share

Hacker News Scraper

Why use this scraper

Hacker News has an official API, but it is designed for building your own front end, not for pulling a clean dataset. To get 30 stories with their top comments, you have to fetch the section list, then fetch each item one at a time, then fetch each comment ID one at a time, and stitch it all back together yourself. Most people who need HN data for research, trend tracking or content curation end up writing that glue code once and never wanting to touch it again.

This Actor does that work for you in a single run. Pick a section, how many posts you want, and whether you want comments attached, and you get back structured JSON with everything nested: no separate calls, no ID-chasing, no rate-limit juggling on your end.

Overview

The Actor pulls posts from any of the six official Hacker News sections and returns each one as a dataset item: title, author, score, comment count, destination URL, HN discussion URL and creation time. When includeComments is on, every post also carries its own comments array with up to maxComments top-level comments, each with author, text and timestamp, already attached to the post they belong to. There is no authentication, no API key and no login: everything comes from Hacker News's own public data.

Supported inputs

  • section - which part of Hacker News to pull from: news (front page), newest, best, ask (Ask HN), show (Show HN), or jobs.
  • maxItems - how many posts to return, from 1 to 500.
  • includeComments - set to true to attach each post's top-level comments in the same dataset item.
  • maxComments - how many top-level comments to fetch per post (1 to 100) when includeComments is on.

There is no keyword search in this version: the Actor reads a section as Hacker News ranks it right now, not a historical search across all of HN.

Use cases

  • Tech trend monitoring: pull the front page daily to track which tools, launches and companies are getting attention in the developer community.
  • Content curation and newsletters: grab the top stories from best or news with comment counts and scores to pick what is worth summarizing.
  • Community sentiment research: attach comments to Ask HN or Show HN posts to see how the community actually reacted, not just the headline score.
  • Startup and product research: scrape show regularly to see what builders are shipping and launching.
  • Academic or journalistic analysis: export structured posts and comments for text analysis without hand-rolling calls to the HN API.

How it works

The Actor reads Hacker News's own public item feed for the section you choose, in the same ranked order the site itself shows, then resolves each post's record and, when requested, its top-level comments. Everything is plain structured data, there is no browser involved and no page rendering, so a run of a few hundred posts with comments finishes in seconds rather than minutes.

Input configuration

Front page, no comments:

{
"section": "news",
"maxItems": 30
}

Show HN with comments attached:

{
"section": "show",
"maxItems": 20,
"includeComments": true,
"maxComments": 10
}

Newest posts, large batch:

{
"section": "newest",
"maxItems": 200
}

Output sample

Two real posts returned by the Actor from the front page, with comments:

{
"id": 50607261,
"title": "XNU Linux: Full OS X GUI Userspace on Linux",
"author": "mmastrac",
"score": 274,
"numComments": 124,
"type": "story",
"url": "https://github.com/AFK-surf/xnulinux",
"hnUrl": "https://news.ycombinator.com/item?id=50607261",
"text": null,
"createdAt": "2026-11-23T03:49:24.000Z",
"scrapedAt": "2026-11-23T09:22:07.185Z",
"comments": [
{
"id": 50608794,
"author": "gen2brain",
"text": "Nice, I like this, though, it still needs Apple hardware...",
"createdAt": "2026-11-23T08:06:30.000Z"
}
]
}
{
"id": 50606192,
"title": "Free alternative TV network built from the Internet Archive's forgotten videos",
"author": "SockThief",
"score": 500,
"numComments": 78,
"type": "story",
"url": "https://spelunkr.tv",
"hnUrl": "https://news.ycombinator.com/item?id=50606192",
"text": null,
"createdAt": "2026-11-23T01:13:51.000Z",
"scrapedAt": "2026-11-23T09:22:08.271Z",
"comments": [
{
"id": 50608252,
"author": "pluto_modadic",
"text": "I think I'd want the original air date of everything, on the website.",
"createdAt": "2026-11-23T06:39:38.000Z"
}
]
}

Key output fields

FieldTypeDescription
idintegerHacker News item ID
titlestringPost title
authorstringSubmitter's HN username
scoreintegerCurrent point score
numCommentsintegerTotal comment count on HN (including nested replies)
typestringstory or job, depending on the section
urlstringExternal link the post points to, when there is one
hnUrlstringLink to the discussion thread on news.ycombinator.com
textstringPost body text for text posts (Ask HN, Show HN descriptions); null for link posts
createdAtstringISO timestamp the post was submitted
scrapedAtstringISO timestamp of the request
comments[].authorstringCommenter's HN username
comments[].textstringComment body (raw HN HTML formatting preserved, e.g. <p>, links)
comments[].createdAtstringISO timestamp the comment was posted

Pricing

Pay per event, no subscription:

EventPrice
Post scraped$0.005

Comments attached to a post do not add a separate charge: you pay once per post regardless of includeComments. Free Apify accounts are limited to 15 posts per run.

What makes this richer than the competition

  • hacker-news-scraper by gentle_cloud (66 users/30d) covers the same sections plus Algolia keyword search, at a lower per-result price ($0.0002 on Free/Bronze). It is the right pick if you need full-text search across all of HN history. This Actor is the simpler pick when you just want "the current front page (or Show HN, or Ask HN) with comments already attached", since comments come nested in the same item instead of a separate lookup.
  • hackernews-search by ryanclinton (33 users/30d) is also Algolia-search-based, built for filtering by author, date range, minimum points and comment count. This Actor does not do keyword search; it reads live HN sections exactly as ranked right now, which is the right fit for "what's on the front page today" rather than "find every post mentioning X since 2020."

Notes & limitations

  • There is no keyword search. The Actor reads the six official sections (news, newest, best, ask, show, jobs) as Hacker News ranks them at run time, not a historical full-text search.
  • comments only includes top-level comments, not nested replies to those comments. numComments on the post reflects HN's total including nested replies, so it will usually be higher than comments.length.
  • text is null for ordinary link posts; it is only populated for text-based posts like Ask HN questions or Show HN descriptions.
  • Comment text keeps Hacker News's own HTML formatting (e.g. <p>, <i>, links as <a href="...">), since that is how HN itself stores it; strip tags on your side if you need plain text.
  • Rankings change constantly on Hacker News. Running the same section twice within a few minutes can return a different order or a different set of posts, that is Hacker News changing, not the Actor.

FAQ

Can I search Hacker News by keyword with this Actor? No, this version reads live sections only. For keyword search across HN history, see the competitors listed above, which use HN's search index.

Does includeComments cost extra? No. You pay once per post scraped ($0.005), with or without comments attached.

Why is comments.length smaller than numComments? numComments is Hacker News's own total, including nested replies. This Actor only fetches the top-level comments you asked for with maxComments.

Can I get more than 500 posts in one run? Not in a single run; maxItems caps at 500. Run it again with a different section, or run it on a schedule to build up history over time.

Does this need an API key or login? No. Hacker News's item data is fully public; the Actor needs no credentials.

Can I run this on a schedule to track the front page over time? Yes. Since each run is a snapshot of the section at that moment, scheduling it hourly or daily on Apify builds you a time series of what made the front page, with scores and comment counts captured at each point, which a single live lookup on the HN site cannot give you.

What's the difference between a story and a job item? type reflects how Hacker News itself classifies the post. Stories come from news, newest, best, ask and show; job posts only come from the jobs section and usually have no score or numComments.

For AI Agents & LLM Apps

This Actor works with the Apify MCP server (mcp.apify.com), so an LLM agent can call it as a tool to pull current Hacker News content mid-conversation, and with direct API calls for scripted use.

Example via API (run-sync-get-dataset-items):

curl -X POST "https://api.apify.com/v2/acts/gio21~hackernews-scraper/run-sync-get-dataset-items?token=<YOUR_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"section": "show", "maxItems": 20, "includeComments": true, "maxComments": 10}'

Disclaimer

This Actor reads publicly available posts and comments from Hacker News. It is not affiliated with, endorsed by, or sponsored by Hacker News or Y Combinator.

SEO Keywords

Hacker News scraper, HN API scraper, Hacker News comments scraper, Show HN scraper, Ask HN scraper, tech news scraper