Hacker News Search Scraper | Stories & Comments avatar

Hacker News Search Scraper | Stories & Comments

Pricing

from $0.38 / 1,000 hacker news items

Go to Apify Store
Hacker News Search Scraper | Stories & Comments

Hacker News Search Scraper | Stories & Comments

Search Hacker News by keyword, author, points and date. Returns title, link, author, points, comment count, text and publish date for stories, comments, Ask/Show HN, polls and jobs. Many queries per run, no login or proxy.

Pricing

from $0.38 / 1,000 hacker news items

Rating

0.0

(0)

Developer

Flowo

Flowo

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a day ago

Last modified

Features

Limited permissions

Share

Hacker News Search Scraper | Stories & Comments

This actor searches Hacker News and returns one row per matching story, comment, Ask HN, Show HN, poll or job ad. Each row has the title, link, author, points, comment count, text and publish date. You can filter by keyword, author, minimum points, minimum comments, date range and item type, and run many search terms in one run.

What does Hacker News Search Scraper do?

It takes search terms and filters, queries the public Hacker News search index (hn.algolia.com, the engine behind HN's own search box) and saves clean rows to a dataset. Every row records which search term found it (query) and its rank (position).

It is built for developer-relations and marketing teams tracking mentions, researchers who need discussion datasets, recruiters who collect job ads, and AI agents that need a cheap, well-defined search call.

How to scrape Hacker News stories and comments

How Hacker News Search Scraper works: Sends each search term to the public HN search index (hn.algolia.com); Applies type, author, points, comments and date filters in the request; Pages through resul

  1. Open the actor in Apify Console and go to the Input tab.
  2. Enter one or more Search terms (one per line), or leave them empty and set an author, a date range or a type.
  3. Choose the Item type (stories, comments, Ask HN, Show HN, jobs and so on) and Sort by.
  4. Add filters such as minimum points or a date range, and set Max results per search term.
  5. Click Start and download the results as JSON, CSV or Excel from the Output tab.

How much does it cost to scrape Hacker News?

Price per event by Apify plan:

EventFreeBronzeSilverGold and above
Hacker News item$0.45 per 1,000$0.405 per 1,000$0.36 per 1,000$0.315 per 1,000
Actor start$0.00005$0.00005$0.00005$0.00005

A test run with the API example input below returned 200 rows in 2 s.

The actor uses pay-per-event pricing. One result event is charged for each item saved to the dataset: $0.45 per 1,000 items. A small start event ($0.00005 per GB of memory) is charged once per run. Searches with no matches are free. Apify proxy is not needed.

Examples on the Free plan, start fee included:

ScenarioItemsCost
Top 30 stories for two terms (rust, postgres)60about $0.027
One term, 1,000 results by relevance1,000about $0.45
All llm stories since 2023, by date5,000about $2.25
A very large history export100,000about $45

Input

Hacker News Search Scraper input example: Search terms, Item type, Sort by, Max results per search term, Search in, Exact words only (no typo matching), Only new since the last run

The main fields:

  • Search terms (queries): supports "exact phrases" and -exclude.
  • Item type (type): story, comment, all, ask_hn, show_hn, front_page, poll, job.
  • Sort by (sort): relevance (max 1000 per term) or date (newest first, no 1000 limit).
  • Max results per search term (maxItemsPerQuery): 1 to 100000, default 100.
  • Filters: author, minPoints, minComments, dateFrom, dateTo (YYYY-MM-DD, UTC).
  • Search options: searchIn (all, title, url, text), exactMatch (no typo matching), onlyNew (only items not returned in earlier runs).
  • Max results in total (maxItems) and an optional proxy.
{
"queries": ["rust", "postgres"],
"type": "story",
"minPoints": 100,
"maxItemsPerQuery": 30
}

What data can you extract from Hacker News?

Hacker News Search Scraper output example: Title, Type, Author, Points, Comments, Posted

FieldMeaning
id, type, urlItem id, type and its Hacker News page
title, text, textHtmlTitle, plain text and HTML text (text posts and comments)
externalUrl, domainLinked page and its domain
author, authorUrlHN username and profile link
points, commentsCountPoints and comment count (empty for comments and jobs)
storyId, storyTitle, storyUrl, storyExternalUrlThe story a comment belongs to
isAskHn, isShowHn, isFrontPageFlags
publishedAt, updatedAtISO timestamps
query, position, scrapedAtSearch term, rank, scrape time

Example row (shortened):

{
"id": "22238335",
"type": "story",
"title": "Why Discord is switching from Go to Rust",
"url": "https://news.ycombinator.com/item?id=22238335",
"externalUrl": "https://blog.discordapp.com/why-discord-is-switching-from-go-to-rust-a190bbca2b1f",
"domain": "blog.discordapp.com",
"author": "Sikul",
"points": 1582,
"commentsCount": 642,
"publishedAt": "2020-02-04T17:30:40.000Z",
"query": "rust",
"position": 1
}

Use cases

  • Brand and technology monitoring: schedule a date-sorted comment search with "Only new since the last run" to see fresh mentions of a product or competitor.
  • Topic research: collect the best-voted stories for several terms in one run.
  • Historical datasets: export every story or comment on a topic over years, past the 1000-result cap, using date sort.
  • Hiring and launches: pull job ads, "Ask HN" hiring threads, or Show HN posts that link to GitHub.
  • Author analysis: list everything a given user posted.

Limitations

  • With Sort by Relevance, Hacker News search returns at most 1000 results per term; use Sort by Date for more.
  • Comment trees (replies), author karma and GitHub star enrichment are not provided. Use type Comments to get the comments of a topic.
  • Comments and jobs have no points or comment count, so those fields are empty and the minimum points/comments filters are rejected for those types.
  • Title and URL search do not work with comments. Jobs match only in title and URL.
  • Usernames are case-sensitive; a wrong case returns no results.
  • Without search terms you must set an author, date range, points/comments filter or a type such as Front page, otherwise the run stops with an input error.

Tips and troubleshooting

  • Zero rows? Check the author's capitalisation, the date range, and whether the type fits the filter.
  • Terms like rust also match "just" and "trust" by default; turn on Exact words only for cleaner results.
  • For monitoring, combine Sort by Date, "Only new since the last run" and a schedule.
  • Use "quotes" for exact phrases and -word to exclude a word.
  • Set Max results in total to cap the whole run when you search many terms.
  • No proxy is needed; enable it only if runs get blocked.

API, MCP and integrations

Run the actor from your code with the same JSON input as in Console. Your API token is in Console → Settings → API & Integrations.

Python (pip install apify-client):

from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("genial_candlestand/hacker-news-search-scraper").call(run_input={
"queries": ["rust", "postgres"],
"type": "story",
"sort": "relevance",
"maxItemsPerQuery": 100,
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item)

Node.js (npm install apify-client):

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });
const run = await client.actor('genial_candlestand/hacker-news-search-scraper').call({
"queries": ["rust", "postgres"],
"type": "story",
"sort": "relevance",
"maxItemsPerQuery": 100,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

HTTP — one request runs the actor and returns the results (runs up to 5 minutes; longer ones: run asynchronously):

curl -X POST "https://api.apify.com/v2/acts/genial_candlestand~hacker-news-search-scraper/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"queries":["rust","postgres"],"type":"story","sort":"relevance","maxItemsPerQuery":100}'

AI agents (MCP). Add the actor as a tool of the Apify MCP server. Claude Code:

$claude mcp add --transport http apify "https://mcp.apify.com?tools=genial_candlestand/hacker-news-search-scraper"

Claude Desktop, Cursor or VS Code: {"mcpServers": {"apify": {"url": "https://mcp.apify.com?tools=genial_candlestand/hacker-news-search-scraper"}}}. Then ask, for example:

  • "Find the 30 most upvoted Hacker News stories about rust with at least 100 points"
  • "Get the latest 200 Hacker News comments mentioning postgres, newest first"
  • "List 20 recent Hacker News posts and comments by user pg"

Integrations. Run it on a schedule with Apify Schedules and send the results to Google Sheets, Slack, Zapier, Make, n8n or your webhook — see Apify integrations.

FAQ

Is it legal to scrape Hacker News?
The actor reads public data that Hacker News shows to everyone, including usernames of posters. You are responsible for how you use it and for complying with applicable law and privacy rules.

Where does the data come from?
From the public Hacker News search index at hn.algolia.com, the same one HN's search box uses. No login or API key is needed.

How is it different from other Hacker News actors?
It accepts several search terms per run and labels each row with its term, supports author, points, comments and date-range filters, goes past 1000 results per term with date sort, and returns plain text and HTML. It costs $0.45 per 1,000 items, against $5 per 1,000 for the leading Hacker News search actor.

Can I get comments?
Yes, set Item type to Comments. Each comment row includes the parent story's title and link.

Also useful