Hacker News Scraper - Stories, Points & Comments
Pricing
from $6.80 / 1,000 results
Hacker News Scraper - Stories, Points & Comments
Scrape Hacker News stories by keyword with points, comment counts, author, URL, tags and timestamps. Sort by relevance or newest. Export to JSON, CSV or Excel.
Pricing
from $6.80 / 1,000 results
Rating
5.0
(2)
Developer
Scrapers Lat
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
13 hours ago
Last modified
Categories
Share
Hacker News Scraper - Stories, Points & Comments
Here is one real result, with every field the actor returns:
{"objectID": "18428497","title": "Google Kubernetes Engine's third consecutive day of service disruption","author": "rlancer","points": 779,"numComments": 407,"url": "https://status.cloud.google.com/incident/container-engine/18005","storyUrl": "https://news.ycombinator.com/item?id=18428497","domain": "status.cloud.google.com","text": null,"tags": ["story", "author_rlancer", "story_18428497"],"createdAt": "2018-11-11T20:47:57Z","topComments": [{"author": "rlancer","text": "Status page is inaccurate as issues doesn't only affect the web UI, the same operations are not functioning via the CLI.","points": null,"createdAt": "2018-11-11T20:53:35.000Z"},{"author": "base698","text": "What operations? Status just shows node pool creation.","points": null,"createdAt": "2018-11-11T21:17:17.000Z"}],"source": "Hacker News","observedAt": "2026-08-14T08:22:14.856Z","aiSummary": "Google Kubernetes Engine (GKE) is experiencing its third consecutive day of service disruptions, affecting users' ability to create new clusters and node pools across multiple regions. The overall sentiment is frustration, with discussions highlighting the lack of accurate status updates from Google.","aiTopics": ["Google", "Kubernetes", "GKE", "Cloud Services", "Service Disruption", "Infrastructure", "DevOps"]}
topCommentsholds the highest-voted comments (this story has 28 attached); it is trimmed to two above for readability. Every value shown is real, unedited run data.
The most complete Hacker News scraper available. It searches or lists stories, returns every field the story exposes (title, author, points, comment count, target URL, discussion URL, domain and tags), attaches the highest-voted comments with author and timestamp, and adds optional AI add-ons for a story-plus-discussion summary and topic tags, so you get the full conversation, not just the headline.
📥 Input · 📤 Output · 💰 Pricing · ▶️ Examples
Table of contents
- What it does
- Quickstart
- Input reference
- Output reference
- Example output record
- Run via API and CLI
- Fetch results
- Billing and limits
- FAQ and troubleshooting
What it does
The actor searches Hacker News for your keyword (or lists the latest stories when no keyword is set), orders results by relevance or date, and writes one normalized record per story to the run's dataset. Each record carries the title, author, points, comment count, the story's target URL, its discussion URL, the domain and tags. With includeComments on, it attaches each story's highest-voted comments with author, text and timestamp. Missing source values are returned as null, never invented.
Two optional AI add-ons run only on paid Apify plans and only charge when they produce output: aiSummary summarizes the story and the main points in its discussion (comments are fetched automatically when enabled), and aiTopics tags the story with concise topic keywords.
Quickstart
Open the actor, paste this into the input, and press Run. It searches Kubernetes stories with both AI add-ons.
{"searchQuery": "kubernetes","sortBy": "relevance","maxStories": 10,"withAiSummary": true,"withAiTopics": true}
Leave searchQuery empty for the latest stories, and set includeComments to true to attach the top discussion comments to every story.
Input reference
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
searchQuery | string | no | artificial intelligence | Keyword to search Hacker News stories, for example startup, rust. Leave empty for the latest stories. |
maxStories | integer | no | 10 | Maximum stories to collect. |
sortBy | enum | no | relevance | Order the stories. One of relevance, date (newest first). |
includeComments | boolean | no | false | Also attach each story's highest-voted comments (author, text, timestamp). |
withAiSummary | boolean | no | false | Paid add-on. AI summary of the story and its discussion. Comments are fetched automatically when on. Requires a paid plan. |
withAiTopics | boolean | no | false | Paid add-on. AI topic and technology keyword tags. Requires a paid plan. |
Output reference
One dataset item per story. Types: string, number, string[], object[], or null when the source value is absent.
| Field | Type | Description |
|---|---|---|
objectID | string | Hacker News story ID (unique per story). |
title | string | Story title. |
author | string | Username of the story submitter. |
points | number | Story score in points. |
numComments | number | Total number of comments on the story. |
url | string | Target URL the story links to, or null for text posts. |
storyUrl | string | Hacker News discussion URL for the story. |
domain | string | Domain of the target URL, or null. |
text | string | Body text for Ask HN or text posts, or null. |
tags | string[] | Hacker News tags, for example story, author_<name>. |
createdAt | string | ISO 8601 timestamp when the story was posted. |
topComments | object[] | Highest-voted comments (with includeComments or AI summary). Each has author, text, points, createdAt. Empty or absent otherwise. |
source | string | Always Hacker News. |
aiSummary | string | AI story-plus-discussion summary (add-on), else absent. |
aiTopics | string[] | AI topic and technology tags (add-on), else absent. |
observedAt | string | ISO 8601 timestamp of when the record was collected. |
error | string | null on success. On a failed run, a single item with a populated error field is written instead. |
Example output record
Real record from a live run (input {"searchQuery":"kubernetes","sortBy":"relevance","withAiSummary":true,"withAiTopics":true,"maxStories":3}). topComments trimmed to two entries:
{"objectID": "18428497","title": "Google Kubernetes Engine's third consecutive day of service disruption","author": "rlancer","points": 779,"numComments": 407,"url": "https://status.cloud.google.com/incident/container-engine/18005","storyUrl": "https://news.ycombinator.com/item?id=18428497","domain": "status.cloud.google.com","text": null,"tags": ["story", "author_rlancer", "story_18428497"],"createdAt": "2018-11-11T20:47:57Z","topComments": [{"author": "rlancer", "text": "Status page is inaccurate ...", "points": null, "createdAt": "2018-11-11T20:53:35.000Z"},{"author": "base698", "text": "What operations? Status just shows node pool creation.", "points": null, "createdAt": "2018-11-11T21:17:17.000Z"}],"source": "Hacker News","aiSummary": "Google Kubernetes Engine (GKE) is experiencing its third consecutive day of service disruptions ... the overall sentiment is frustration.","aiTopics": ["Google", "Kubernetes", "GKE", "Cloud Services", "Service Disruption", "DevOps"],"observedAt": "2026-08-14T08:22:14.856Z"}
Run via API and CLI
Start a run and wait for it to finish, then read the dataset. Replace <TOKEN> with your Apify API token.
Run synchronously and get dataset items in one call:
curl -X POST "https://api.apify.com/v2/acts/scrapers_lat~hacker-news-scraper/run-sync-get-dataset-items?token=<TOKEN>" \-H "Content-Type: application/json" \-d '{"searchQuery":"rust","sortBy":"date","maxStories":25,"includeComments":true}'
Start a run asynchronously:
curl -X POST "https://api.apify.com/v2/acts/scrapers_lat~hacker-news-scraper/runs?token=<TOKEN>" \-H "Content-Type: application/json" \-d '{"searchQuery":"artificial intelligence","maxStories":100}'
Apify CLI:
apify call scrapers_lat/hacker-news-scraper \--input '{"searchQuery":"kubernetes","maxStories":50,"includeComments":true}'
Fetch results
Every run writes to a dataset. Fetch items as JSON, CSV, or Excel by changing format:
# JSONcurl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=json"# CSVcurl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&clean=true&format=csv"# Paginate large datasetscurl "https://api.apify.com/v2/datasets/<DATASET_ID>/items?token=<TOKEN>&offset=1000&limit=1000"
<DATASET_ID> is returned as defaultDatasetId in the run object. Use offset and limit to page through large result sets. clean=true drops empty and internal fields.
Billing and limits
- Pay per result. You are charged per story returned (
resultevent). See the pricing tab for the current per-result price. - Add-ons. The AI summary and AI topics add-ons are priced separately and charge only when they produce output.
- No charge on failure. If a run errors, the actor writes a single item with a populated
errorfield and does not charge for it. Empty runs cost nothing. - Spend cap respected. Set
maxTotalChargeUsdon the run; once reached, the actor stops emitting and charging further billable results. - Free Apify plans are capped at 10 stories per run. Upgrade for higher
maxStories.
FAQ and troubleshooting
A run returned 0 stories. Why? The keyword matched nothing on Hacker News. Broaden the keyword or leave it empty for the latest stories. Zero-result runs are not charged.
How do I get the newest stories instead of the most relevant?
Set sortBy to date. Leave searchQuery empty to list the latest stories overall.
Why is topComments empty?
includeComments was off and no AI summary was requested. Turn on includeComments, or enable withAiSummary which fetches comments automatically.
Why is url null?
The story is a text post (for example Ask HN) with no external link. The body appears in text and the discussion is at storyUrl.
Why did the AI fields not appear?
The AI add-ons require a paid Apify plan and are off by default. Enable withAiSummary or withAiTopics on a paid plan. They charge only when output is produced.
Is this an official Hacker News tool? No. This actor is independent and not affiliated with Hacker News or Y Combinator. It reads only publicly available stories and comments.
Related scrapers
- Reddit Posts Scraper: Posts from any subreddit.
- Google News Scraper: Articles and headlines from Google News.
- Product Hunt Scraper: Product launches from Product Hunt.
- GitHub Repositories Scraper: Repositories and metadata from GitHub.
- Medium Scraper: Articles from Medium.
More scrapers at scrapers.lat
Built and maintained by scrapers.lat, where we publish scrapers for US and Latin American public platforms: company registries, government data, finance, e-commerce and more. Browse the catalog or request a custom scraper at scrapers.lat.
Independent tool, not affiliated with Hacker News or Y Combinator. Accesses only publicly available stories and comments.
