Hacker News Stories & Comments Scraper ($1/1K) avatar

Hacker News Stories & Comments Scraper ($1/1K)

Pricing

from $0.70 / 1,000 items

Go to Apify Store
Hacker News Stories & Comments Scraper ($1/1K)

Hacker News Stories & Comments Scraper ($1/1K)

Hacker News stories and comments scraper: title, URL, domain, points, comment count, author, date and text, also for Show HN, Ask HN, jobs and the front page. Takes keywords with filters for points, comments, dates, author or domain. Use it to track mentions of a product on HN.

Pricing

from $0.70 / 1,000 items

Rating

0.0

(0)

Developer

Tam Ng.

Tam Ng.

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

20 hours ago

Last modified

Features

Limited permissions

Share

Hacker News Stories & Comments Scraper

Search Hacker News stories, comments, Show HN, Ask HN, job posts, polls or the current front page with no login and no API key, for $1 per 1,000 items on the Free plan, down to $0.70 on higher plans.

Filter by keyword, minimum points, minimum comments, date range, author or the domain of the linked site. Data comes from the public Hacker News search API (Algolia), so runs are fast and cheap.

What you can do with it

  • Track mentions. Search your product, company, competitors or a technology and see every story and comment that mentions it.
  • Collect launch feedback. Pull Show HN posts for a keyword and read what the community said about similar launches.
  • Research a topic. Export Ask HN discussions or high-scoring stories (minPoints) for a research project or a newsletter.
  • Follow a domain. Enter a site such as github.com or your own blog in Domain and see which of its articles reached Hacker News, with points and comment counts.
  • Monitor with a schedule. Run the same queries every day, newest first, and send new items to Slack, Google Sheets or a webhook.
  • Feed an AI agent or a database. Get clean JSON with plain text instead of HTML, ready for analysis or embeddings.

Output fields

Each story or comment is one record in the dataset. Example values below come from a real run with the query "web scraping".

Stories (also Show HN, Ask HN, jobs, polls and front page items):

FieldExample
id / hnUrl50472805 / https://news.ycombinator.com/item?id=50472805
typestory (also show_hn, ask_hn, job, poll)
titlePuppeteer vs. Selenium for Web Scraping, Tested on the Same Chrome
url / domainhttps://scrapfly.io/blog/posts/puppeteer-vs-selenium / scrapfly.io
points / numComments2 / 3
author / createdAtHacker News user name / 2026-11-12T19:25:49Z
storyTexttext of Ask HN and Show HN posts as plain text, null for link stories
isFrontPage / tagsfalse / ["story"] (another item in the same run: ["story", "ask_hn"])
query / scrapedAtweb scraping / 2026-11-13T05:38:04.542Z

Comments (type = comment) have these fields: id, type, hnUrl, author, createdAt, points, text, storyId, storyTitle, storyUrl, parentId, tags, query and scrapedAt.

Download results as JSON, CSV, Excel or XML, or read them through the Apify API.

Example output

One real story record from a run with the query "web scraping" (the author's user name is replaced with "..."):

{
"id": 50472805,
"type": "story",
"hnUrl": "https://news.ycombinator.com/item?id=50472805",
"author": "...",
"createdAt": "2026-11-12T19:25:49Z",
"points": 2,
"title": "Puppeteer vs. Selenium for Web Scraping, Tested on the Same Chrome",
"url": "https://scrapfly.io/blog/posts/puppeteer-vs-selenium",
"domain": "scrapfly.io",
"numComments": 3,
"storyText": null,
"isFrontPage": false,
"tags": ["story"],
"query": "web scraping",
"scrapedAt": "2026-11-13T05:38:04.542Z"
}

How to use

  1. Enter Search queries, one per line. You can leave them empty if you set an Author or a Domain, or choose the current front page.
  2. Pick an Item type (stories, comments, Show HN, Ask HN, jobs, polls or current front page) and Sort by relevance or newest first. Optionally add Minimum points, Minimum comments, Date from, Date to, Author or Domain, and set Max items per query (up to 1,000).
  3. Click Start. Results appear in the dataset as pages are read. Export them or read them through the API.

Example input

{
"queries": ["web scraping", "LLM agents"],
"itemType": "story",
"sortBy": "date",
"minPoints": 20,
"minComments": 0,
"dateFrom": "2026-01-01",
"dateTo": "2026-06-30",
"maxItemsPerQuery": 200,
"proxyConfiguration": { "useApifyProxy": true }
}

Tips:

  • Use Newest first for monitoring runs, so the latest items come first.
  • Enter dates as YYYY-MM-DD (UTC). Date from 2026-01-01 starts at the beginning of that day and Date to 2026-06-30 includes the whole of June 30. You can also give an exact time such as 2026-06-30T18:00:00Z. An invalid date stops the run with an error before any request.
  • Minimum comments applies to stories, Show HN, Ask HN, jobs and polls. With Item type Comments it is ignored (a note is written to the log), because comments have no comment count.
  • The default datacenter proxy is fine. The search API is public and does not block it.

Pricing and cost examples

You pay per item saved to the dataset ("Item" event). Platform usage and proxy traffic are included in the per-item price. Each run also has a one-time start charge of $0.00005.

Apify planPrice per 1,000 items
Free (default price)$1.00
Bronze$0.90
Silver$0.80
Gold, Platinum, Diamond$0.70

Cost examples on the Free plan:

  • 100 items ≈ $0.10
  • 1,000 items ≈ $1.00
  • 10,000 items ≈ $10.00 (≈ $7.00 on Gold and higher plans)

The Apify Free plan includes $5 of platform credit every month. If you spend it only on this Actor, that covers about 5,000 items per month.

You are charged only for items saved to the dataset. A search request that still fails after 4 attempts saves nothing for the rest of that query, and a query with no results saves nothing, so neither adds to the bill. Items filtered out by the Domain filter and duplicates inside one query are skipped before saving, so they are not charged. If no query, author or domain is given and the item type is not the front page, the run searches the example query "web scraping" and says so in the log. If you send only an author or a domain, only that is searched. To set a hard cap, enter a maximum total charge per run in the run options. The Actor stops as soon as that limit is reached.

Use it via API, on a schedule, or from an AI agent

JavaScript (npm install apify-client):

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });
const run = await client.actor('tamnt67/hacker-news-scraper').call({
queries: ['web scraping'],
itemType: 'story',
sortBy: 'date',
maxItemsPerQuery: 100,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

Python (pip install apify-client):

from apify_client import ApifyClient
client = ApifyClient("YOUR_API_TOKEN")
run = client.actor("tamnt67/hacker-news-scraper").call(run_input={
"queries": ["web scraping"],
"itemType": "story",
"sortBy": "date",
"maxItemsPerQuery": 100,
})
items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)

cURL (runs the Actor and returns the items in one call):

curl -X POST "https://api.apify.com/v2/acts/tamnt67~hacker-news-scraper/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"queries": ["web scraping"], "itemType": "story", "sortBy": "date", "maxItemsPerQuery": 100}'

The sync endpoint waits for the run to finish, so use it for small runs and the client libraries for large ones.

Schedules: create an Apify Schedule for this Actor or a saved task to run the same queries daily or hourly and build a mention monitor.

AI agents: the Apify MCP server at https://mcp.apify.com lets AI assistants such as Claude or Cursor run this Actor and read its results.

FAQ

How much does Hacker News Scraper cost?

Hacker News Scraper costs $1 per 1,000 items on the Free plan and $0.90, $0.80 or $0.70 per 1,000 on higher Apify plans. 100 items cost about $0.10 on the Free plan. The Free plan's $5 monthly credit covers about 5,000 items.

How many results do I get per query?

Hacker News Scraper returns up to maxItemsPerQuery items for each query, from 1 to 1,000. The default is 100. The Hacker News search API itself returns at most 1,000 results for one query and filter combination.

How can I get more results?

Add more queries, or split a long period into several runs of Hacker News Scraper with Date from and Date to. Each date range is a new filter combination, so each can return up to 1,000 items. Lowering Minimum points or Minimum comments also widens the results.

Can I run it on a schedule or through the API?

Yes. Hacker News Scraper works with Apify Schedules for hourly, daily or weekly runs, and with the Apify API through the JavaScript and Python clients or a single cURL call. See the API section above for working examples.

How fresh is the data?

Hacker News Scraper reads the Hacker News search index live at the time of each run. Nothing is cached by the Actor. Points and comment counts come from the search index and can lag the live site by a few minutes. Every record has a scrapedAt timestamp.

Hacker News Scraper collects only publicly visible stories and comments through the public Hacker News search API, without logging in. You are responsible for how you use the data, including complying with the Hacker News terms and with data protection laws such as GDPR, since records include user names. This is not legal advice. If you are unsure, ask a lawyer.

Limitations

  • The search API returns at most 1,000 results per query and filter combination, and the Actor stops at 1,000 items per query. Split long periods with Date from and Date to to get more.
  • Points and comment counts are refreshed by the search index and can lag the live site by a few minutes.
  • The Domain filter matches the linked site of stories (for comments, the site of the parent story). With a query, results are first searched by the query and then kept only if they link to that domain, so a query plus a domain can return fewer items than maxItemsPerQuery.
  • Deleted and dead items are not returned by the search API.
  • Minimum comments works on stories, Show HN, Ask HN, jobs and polls. It is ignored for comments, which have no comment count.
  • points is usually null for comments, and storyText is null for link stories.
  • Dates are in UTC. Date to without a time includes that whole day, up to 23:59:59 UTC.
  • Duplicates are removed within each query, not across queries. An item found by two queries is saved and charged once for each.
  • The filters (item type, sort, points, comments, dates, author, domain) apply to every query in the same run.
  • If a search request still fails after 4 attempts, the Actor logs an error and moves on to the next query.

Changelog

  • 1.0 (2026-11-19): Date to without a time now includes the whole day; an invalid date stops the run with a clear error; Minimum comments is ignored for comments with a log note instead of silently doing nothing; sending only an author or domain no longer also searches the example query "web scraping".

Integrations

Works with every Apify integration: API, webhooks, Zapier, Make, Google Sheets, Slack, n8n, LangChain and the Apify MCP server.

Support

Found a problem or missing field? Report problems in the Issues tab of this Actor.