Hacker News Scraper: Stories and Comments by Query avatar

Hacker News Scraper: Stories and Comments by Query

Pricing

from $0.07 / 1,000 hn story / comment extracteds

Go to Apify Store
Hacker News Scraper: Stories and Comments by Query

Hacker News Scraper: Stories and Comments by Query

Search Hacker News via the public Algolia API. One row per hit: title, author, points, numComments, URL, tags, storyId. Filter by tags (`story`, `front_page`, `show_hn`, `ask_hn`, `author_xxx`, `story_xxx`) and a date window (default 30 days). For trend trackers and launch monitoring.

Pricing

from $0.07 / 1,000 hn story / comment extracteds

Rating

0.0

(0)

Developer

vøiddo

vøiddo

Maintained by Community

Actor stats

0

Bookmarked

4

Total users

0

Monthly active users

7 days ago

Last modified

Security

Limited permissions

Share

Hacker News Algolia Search by Query + Tags

Search Hacker News via the public Algolia API (the same data behind https://hn.algolia.com/). One row per hit, paginated, server-side date-filtered. Works for stories, comments, Ask HN, Show HN, polls, front page, by author, comments under a specific story.

What you get

{
"objectID": "37412345",
"storyId": "37412345",
"title": "Show HN: Notion-style outliner in 200 lines of JS",
"author": "example_user",
"url": "https://github.com/example_user/outliner",
"points": 842,
"numComments": 217,
"createdAt": "2026-05-30T14:23:01.000Z",
"createdAtUnix": 1780150981,
"tags": ["show_hn", "story", "author_example_user"],
"permalink": "https://news.ycombinator.com/item?id=37412345",
"query": "Show HN"
}

How to use

Input.

{
"queries": ["Show HN: Rust", "Ask HN: hiring"],
"tags": ["story"],
"sinceDays": 30,
"maxResultsPerQuery": 500,
"sortBy": "date"
}

Tag cheat sheet. Tags are AND-ed:

  • story: only stories
  • comment: only comments
  • front_page: currently on the front page
  • show_hn, ask_hn, poll: special story types
  • author_<username>: by author, e.g. author_example_user
  • story_<id>: all comments under a specific story

Common recipes. Every queries entry must be a non-empty string: empty strings are ignored, and an empty list runs the demo queries Show HN and Ask HN.

  • "Last 24h Show HN posts": queries=["Show HN"], tags=["show_hn"], sinceDays=1, sortBy=date.
  • "Front page right now, about a topic": queries=["Rust"], tags=["front_page"], sinceDays=1.
  • "Everyone talking about Anthropic this month": queries=["Anthropic"], tags=["story"], sinceDays=30. Run again with tags=["comment"] for comments.
  • "Comments under HN ID 37412345 that mention a keyword": queries=["pricing"], tags=["story_37412345"], sinceDays=0.

Pricing

Pay per event. Price per 1,000 events:

EventBase priceBronzeSilverGold
HN story / comment extracted$0.10$0.09$0.08$0.07

Bronze, Silver and Gold are the discounts Apify gives users of its paid plans. The Pricing tab always shows the current prices.

Buyer

  • Launch trackers (Show HN sentiment for week's biggest dev tools).
  • Brand monitoring (every mention of your company on HN this month).
  • Hiring-signal radar (Ask HN: Who is hiring? threads).
  • Researchers studying HN community trends.

Run it through the API

Python, with the apify-client package:

from apify_client import ApifyClient
client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("v0iddo/hn-algolia-search").call(run_input={"queries": ["Show HN: open source"], "maxResultsPerQuery": 20})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item)

JavaScript, with the apify-client package:

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('v0iddo/hn-algolia-search').call({"queries": ["Show HN: open source"], "maxResultsPerQuery": 20});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

One HTTP call that waits for the run and returns the rows (for runs that finish within 5 minutes):

curl -X POST "https://api.apify.com/v2/acts/v0iddo~hn-algolia-search/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>" \
-H "Content-Type: application/json" \
-d '{"queries": ["Show HN: open source"], "maxResultsPerQuery": 20}'

Use it from an agent (MCP)

Claude, Cursor, VS Code and other MCP clients can call this actor as a tool through the Apify MCP server. Add it to the client's MCP configuration:

{
"mcpServers": {
"apify": {
"url": "https://mcp.apify.com?tools=v0iddo/hn-algolia-search",
"headers": {
"Authorization": "Bearer <YOUR_APIFY_TOKEN>"
}
}
}
}

FAQ

Do I need an account, cookies or an API key?

No. The actor reads public data without logging in. You only need an Apify account to start it.

How many results can one run return?

Set Max results per query (up to 50,000) to the number you need. Large jobs can also be split into several runs or scheduled.

How am I charged?

Pay per event, at the prices on the Pricing tab for your Apify plan (the Pricing section of this page lists them). The platform usage of the run is included in those prices, and your spending limit for a run is always respected.

Why did my run return no results?

The status message and the log of the run say why: usually nothing matched the input, or the source did not answer for a moment. Check the input against the example above and run it again.

Can I run it on a schedule?

Yes. Save your input as a task and add a schedule in the Apify Console (daily, hourly or with a cron expression). Each run gets its own dataset, so you keep a history.

Which formats can I export?

JSON, CSV, Excel, XML, HTML table and RSS from the Output tab or the API. Integrations send the rows to Google Sheets, Slack, Make, Zapier, n8n or a webhook.

Is collecting this data allowed?

The actor collects data that the source publishes openly, without a login. Public data can still be personal data under laws such as the GDPR, and sources have their own terms: make sure your use of the data follows the rules that apply to you.

What happens when the source changes?

An automated test runs the actor every day on the example input and checks the rows, not only that the run finished. When a check fails, the actor is repaired and rebuilt; the build history on this page shows each update.

Something is missing or wrong. Where do I report it?

Open an issue on the Issues tab of this actor with the run link. Requests for a new field are welcome too.

Source

https://hn.algolia.com/api/v1/search and /search_by_date. Algolia serves the HN index through a public API. No auth, no rate limit documented; this actor still paces 0.2s between pages.