Hacker News Scraper - Search, Comments & Front Page
Pricing
from $0.16 / 1,000 item results
Hacker News Scraper - Search, Comments & Front Page
Search Hacker News stories and comments by keyword, author, points and date range with no 1000-result cap, pull the live top/new/best/Ask/Show/Jobs lists, or fetch items with their full comment trees. Clean plain-text fields. Official public APIs, no proxy.
Pricing
from $0.16 / 1,000 item results
Rating
0.0
(0)
Developer
the anh nguyen
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
2 days ago
Last modified
Categories
Features
Share
Hacker News Scraper - Search, Front Page, Comments & Ask/Show HN
Scrape Hacker News three ways: search every story and comment ever posted (by keyword, type, author, points and date range), pull a live list such as the front page, or fetch specific items with their full comment threads. One clean row per item: title, link, domain, author, points, comment count, post time and plain-text body.
Uses only the official public APIs (Algolia HN Search and the Hacker News Firebase API). No browser, no proxy, so runs finish in seconds.
Why this one
- No 1000-result cap. HN Search stops at 1000 hits per query. This Actor keeps going by walking back in time, so a search over two years returns every match, not the first 1000.
- Full comment trees. Turn on
includeCommentsand each story row carries its whole thread, flattened into a list withparentIdanddepth, so you can rebuild the tree or just read it top to bottom. Still one row and one charge per story. - Live lists. Top (front page), New, Best, Ask HN, Show HN and Jobs, in the site's own order, with live points and comment counts.
- Clean fields. Text is plain text: HTML stripped, entities decoded, links kept as full URLs. Times are ISO 8601 UTC. Comments carry the id and title of their story.
What you can use it for
- Monitoring HN for mentions of your product, company or competitors
- Collecting launches (Show HN, Launch HN) in a niche over a date range
- Reading the monthly "Who is hiring?" thread as data
- Snapshotting the front page on a schedule
- Building datasets of stories or discussions for research and analysis
Input
| Field | Type | Description |
|---|---|---|
mode | select | search (default), list or items. |
query | string | Search keywords. Leave empty to match everything (with a type, author or date range). Matching is prefix-based: llm also matches LLMs. |
type | select | story (default), comment, ask_hn, show_hn, launch_hn, poll, job or all. |
sortBy | select | relevance (default: text match and popularity) or date (newest first). |
author | string | Only items by this HN username. |
storyId | string | Only items inside this story (id or item URL). With type: comment, searches one thread. |
minPoints / minComments | integer | Only stories with at least this many points / comments. Ignored for comments. |
startDate / endDate | string | Post date range, YYYY-MM-DD, UTC, both inclusive. |
listType | select | For mode: list: topstories, newstories, beststories, askstories, showstories, jobstories. |
itemIds | array | For mode: items: ids (8863) or URLs (https://news.ycombinator.com/item?id=8863). |
includeComments | boolean | Add the full comment thread to each story row. Default false. |
maxItems | integer | Maximum rows in total. Default 100. 0 = no limit. |
Examples
Keyword monitoring, newest first (run it on a schedule):
{"mode": "search","query": "your-product","type": "all","sortBy": "date","maxItems": 100}
Every Show HN launch with 100+ points in October 2026, with comments:
{"mode": "search","type": "show_hn","startDate": "2026-10-01","endDate": "2026-10-31","minPoints": 100,"includeComments": true,"maxItems": 500}
A "Who is hiring?" thread as one row with all its comments:
{"mode": "items","itemIds": ["https://news.ycombinator.com/item?id=50338728"],"includeComments": true}
Only the job posts in that thread that mention "remote", one row per comment:
{"mode": "search","type": "comment","storyId": "50338728","query": "remote","sortBy": "date","maxItems": 1000}
The front page right now:
{"mode": "list","listType": "topstories","maxItems": 30}
Output
One row per item. Example story row with includeComments (shortened, placeholder data):
{"id": "40000001","type": "story","title": "Show HN: A tiny database written in a weekend","url": "https://example.com/tiny-db","hnUrl": "https://news.ycombinator.com/item?id=40000001","domain": "example.com","author": "example_user","points": 245,"numComments": 87,"createdAt": "2026-10-14T16:02:11Z","text": "I wanted to understand how B-trees work, so I wrote one.\n\nSource: https://github.com/example/tiny-db","storyId": null,"storyTitle": null,"parentId": null,"tags": ["story", "show_hn", "front_page"],"comments": [{"id": "40000102", "author": "another_user", "text": "How does it handle crashes mid-write?", "createdAt": "2026-10-14T16:20:45Z", "parentId": "40000001", "depth": 0},{"id": "40000150", "author": "example_user", "text": "A write-ahead log, fsynced before each commit.", "createdAt": "2026-10-14T16:31:02Z", "parentId": "40000102", "depth": 1}],"commentCount": 86,"scrapedAt": "2026-11-11T09:00:00Z"}
| Field | Notes |
|---|---|
id, hnUrl | Always present. hnUrl is the discussion page. |
type | story, comment, poll, pollopt or job. Ask HN, Show HN and Launch HN are stories; see tags. |
title, url, domain | Stories, polls and jobs. url is the external link, null for text posts such as Ask HN. |
author, points, numComments | points and numComments are null for comments (HN does not publish comment scores). |
createdAt | Post time, ISO 8601 UTC. |
text | Body as plain text: Ask HN and Show HN text, comment text, job descriptions. |
storyId, storyTitle, parentId | Comments only: the story the comment belongs to and the item it replies to. |
tags | story, comment, ask_hn, show_hn, launch_hn, front_page, poll, job. front_page appears in search results only. |
comments, commentCount | Only with includeComments. Depth-first: each reply follows its parent, siblings oldest first. depth 0 is a direct reply to the row's item. |
scrapedAt | When the row was scraped. |
Pricing
$0.0002 per item (one dataset row), so 1,000 rows cost $0.20. Comments embedded in a story row through includeComments are included in that row's price. With type: comment each comment is its own row and is charged as one item.
The run stops by itself when it reaches the maximum charge you set for it.
FAQ
How is this different from the HN search box? HN Search (hn.algolia.com) shows at most 1000 results per query. This Actor uses the same index but keeps paging back in time, so you get every match in your date range. With sortBy: relevance the first 1000 rows are in relevance order and the rest follow newest first.
Why is commentCount lower than numComments? numComments is HN's own count. Flagged and dead comments are counted there but are not public, so they are not in the thread. Deleted comments are left out unless they have replies, in which case they stay with author and text set to null so the tree stays intact.
Are comments in the order HN shows them? No. Replies to the same parent are oldest first. HN's ranking order is not part of the public data.
How fresh is the data? Live lists and items read the official API, so points and comment counts are current. Search reads HN's Algolia index, which picks up new items within a few minutes; its points and comment counts can be a little behind.
Can I get user profiles or karma? Not in this version.
Why did my run fail with "No Hacker News items matched"? The search returned nothing. A failed run is not charged for rows it did not produce; loosen the filters and run again.
Integration tips
- Schedules: run a
sortBy: datesearch every hour or day to monitor keywords, ormode: listwithtopstoriesto snapshot the front page. Deduplicate onidacross runs. - Webhooks: add a webhook on "Run succeeded" to send new rows to Slack, a database or your own endpoint.
- API: start runs and read results with the Apify API or client libraries, for example
GET https://api.apify.com/v2/datasets/{datasetId}/items?format=json(orformat=csv). Nestedcommentscome through as JSON arrays; for CSV, keepincludeCommentsoff or flatten on your side.
Limits
- Search is limited to what HN's Algolia index holds: all public stories, comments, polls and jobs since 2006. Dead and flagged items are not included.
includeCommentscosts one extra request per story, so big runs with comments take longer. The largest threads (several thousand comments) make rows of a few MB.- Tested on searches over 2-year ranges (several thousand rows), the live lists, and threads with 1,600+ comments.