# Hacker News Scraper - Stories, Comments, Users & Who Is Hiring (`topapi/hacker-news-scraper`) Actor

Scrape Hacker News: top / new / best / Ask / Show / job lists, a day's top stories, search with date, points and comment filters, full comment trees, user profiles, Who is hiring and Who wants to be hired posts parsed into rows, keyword trends. Monitor mode. $0.14 per 1,000 items.

- **URL**: https://apify.com/topapi/hacker-news-scraper.md
- **Developed by:** [Top Api](https://apify.com/topapi) (community)
- **Categories:** News, Developer tools, Jobs
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.14 / 1,000 items

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What does Hacker News Scraper do?

**Hacker News Scraper** extracts data from [Hacker News](https://news.ycombinator.com) through its two public APIs (the official Firebase API and HN Search by Algolia) and returns one clean row per story, comment, poll, job ad, user profile, hiring post or trend.

Hacker News API · HN scraper · Hacker News comments scraper · Who is hiring scraper · Hacker News search export

- **Every list HN ranks:** top (the front page), new, best, Ask HN, Show HN and jobs, with each story's rank, read live from the official API.
- **Search with real filters:** keywords, item type (stories, comments, Ask HN, Show HN, jobs, polls, on the front page now), date window, minimum points and comments, authors, domains, title-only or link-only matching. Filters run inside HN Search's own query, so a filter that keeps 1% of the matches reads 1% of the pages.
- **No 1,000-result cap:** HN Search answers 1,000 hits per query; the actor walks back through time and keeps going (5,000 rows in one run measured, more is fine).
- **Whole discussions:** every comment of a story in HN's own ranked order, with depth, parent, story title and replies, as rows or nested inside the story.
- **User profiles:** karma, about, account age, submissions, story and comment counts, last activity, plus their stories and comments.
- **Monthly hiring threads parsed into rows:** *Who is hiring?* (company, roles, locations, remote / onsite / hybrid, regions, salary, equity, visa, stack, emails, apply links, hiring system, YC batch), *Who wants to be hired?* (location, remote, relocation, technologies, email, résumé, GitHub, LinkedIn) and *Freelancer? Seeking freelancer?*
- **Trends:** a keyword's stories and comments in a window against the window before (growth, points, top stories, top domains, trend score), and the words and phrases rising fastest in story titles.
- **Monitor mode:** on a schedule, a run delivers only what earlier runs did not, optionally pushed to Slack, Discord or a webhook. A poll with nothing new costs about $0.00008.
- **No login, cookies or API key.** Pay only for delivered rows; filtered rows are never charged.

### What data can you get from Hacker News?

<table>
<tr>
<td>📰 Title, link, domain, text</td>
<td>🔺 Points, comment count, rank</td>
<td>👤 Author, author karma and account age</td>
</tr>
<tr>
<td>💬 Comments with depth, parent, story, rank</td>
<td>⚡ Points per hour, comments per hour, isTrending</td>
<td>🗳️ Poll options with votes</td>
</tr>
<tr>
<td>🧑‍💻 User karma, about, created, story / comment counts, last active</td>
<td>💼 Job posts: company, roles, salary, remote, visa, stack, apply links</td>
<td>🙋 Candidates: location, remote, relocation, technologies, email, résumé</td>
</tr>
<tr>
<td>📈 Keyword trends with growth and top stories</td>
<td>🚀 Rising terms in titles</td>
<td>🔗 Every link inside a text</td>
</tr>
</table>

### How to scrape Hacker News with Hacker News Scraper

1. Open the actor and pick what to read: a list (prefilled: **Top**), search queries, HN links, item ids, usernames, a day, hiring threads or trend keywords. Mix them freely in one run.
2. Optionally set filters (type, dates, points, comments, authors, domains) and extras (comments, author profiles, user submissions).
3. Set **Max rows per source** (prefilled 30) and click **Start**. Most runs finish in 1-5 seconds.
4. Download the rows as JSON, CSV, Excel or HTML, or read them through the API, a webhook or MCP.

### ⬇️ Input

| Field | Type | What it does | Default |
|---|---|---|---|
| `lists` | array | top, new, best, ask, show, job | top when nothing else is asked |
| `searchQueries` | array | One HN Search per line; `"exact phrase"` in quotes | - |
| `startUrls` | array | `item?id=`, `user?id=`, `submitted?id=`, `threads?id=`, `from?site=`, `news` / `newest` / `best` / `ask` / `show` / `jobs`, `front?day=` (see Limits), hn.algolia.com search links | - |
| `itemIds` | array | Story, comment, poll or job ids, e.g. 8863 | - |
| `usernames` | array | Profile rows, e.g. pg | - |
| `topStoriesDays` | array | 2026-11-01, today, yesterday: that day's stories ranked by points | - |
| `hiringThreads` | array | whoIsHiring, whoWantsToBeHired, freelancer | - |
| `hiringMonths` | array | latest, 2026-10, October 2026, last 3 | latest |
| `trendKeywords` | array | One trend row per keyword | - |
| `discoverRisingTerms` | boolean | Rising words and phrases in titles | false |
| `itemType` | string | story, comment, ask_hn, show_hn, job, poll, front_page, all | story |
| `sortBy` | string | relevance or date (newest first) | relevance |
| `searchIn` | string | all, title, url, text, author | all |
| `exactMatch` | boolean | No typo tolerance ("rust" will not match "trust") | false |
| `dateFrom` / `dateTo` | string | 2026-11-01, ISO, unix time, or "7 days" | - |
| `postedWithinHours` | integer | Only the last N hours | - |
| `minPoints` / `minComments` | integer | Stories with at least that many | - |
| `authors` / `domains` | array | Only these usernames / sites; alone they list everything they match | - |
| `filterKeywords` | array | Title or text must contain one of these (useful on lists) | - |
| `includeComments` | boolean | Each story's discussion | false |
| `maxCommentsPerStory` | integer | 0 = whole discussion | 100 |
| `maxCommentDepth` | integer | 1 = top level only, 0 = every level | 0 |
| `commentSort` | string | ranked (HN's order), newest, oldest | ranked |
| `commentsFormat` | string | rows (one per comment) or nested (inside the story) | rows |
| `includeAuthorProfile` | boolean | Author karma, created, account age, submissions on every row (free) | false |
| `includeUserSubmissions` / `submissionTypes` / `maxSubmissionsPerUser` | | A user's stories and/or comments, newest first | false / story / per source |
| `hiringKeywords`, `hiringKeywordsMatch`, `technologies`, `locations`, `remoteOnly`, `onsiteOnly`, `visaOnly`, `withSalaryOnly`, `withEmailOnly`, `willingToRelocateOnly`, `latamOnly` | | Hiring-row filters | off |
| `trendWindowHours` | integer | Window length; compared with the window before | 24 |
| `risingTermsMax`, `risingMinMentions`, `risingMinGrowthPercent` | integer | Rising-term limits | 25, 3, 100 |
| `monitorMode`, `monitorName`, `resetMonitor` | | Only rows new since the last run, one memory per name | off |
| `webhookUrl`, `slackWebhookUrl`, `discordWebhookUrl`, `alertMinPoints` | | Push each run's new rows | - |
| `maxResultsPerSource` | integer | Per list, search, day, user or hiring month | 100 (a hiring month: every post) |
| `maxResults` | integer | Cap for the whole run, comments included; 0 = none | 0 |
| `compactOutput` | boolean | Drop HTML, link lists and id lists | false |
| `includeDead`, `maxConcurrency`, `proxyConfiguration` | | Advanced | false, 32, no proxy |

Input names used by other Hacker News actors are accepted too (`mode`, `query`, `story_ids`, `username`, `max_results`, `include_comments`, `comment_limit`, `comment_depth`, `maxItems`, `tags`, `since`, `hiringMonth`, `trend_queries`, `hours`, `detectTrends`, `onlyNew` ...), so an API call can switch without a rewrite.

#### Input JSON

```json
{
  "searchQueries": ["\"vector database\"", "rust"],
  "itemType": "story",
  "postedWithinHours": 168,
  "minPoints": 50,
  "includeComments": true,
  "maxCommentsPerStory": 50,
  "maxResultsPerSource": 200
}
```

```json
{
  "hiringThreads": ["whoIsHiring"],
  "hiringMonths": ["last 3"],
  "remoteOnly": true,
  "technologies": ["Rust", "Go"]
}
```

#### Put filters in the query

Type, author, date window, points, comments and "search in" go into HN Search's own query, so they cost nothing extra. On lists (top, new ...) the filters are checked on each item read: the `new` list with `minPoints: 50` read all 500 items and kept 23 in 1.8 s.

### ⬆️ Output

Every row has a `recordType`: `item` (story, comment, poll, poll option, job), `user`, `job-post`, `candidate` or `trend`, and a `source` saying which input produced it. The dataset has six views: Stories, Comments, Users, Who is hiring, Who wants to be hired, Trends.

A story from the top list (real run, 2026-11-07):

```json
{
  "recordType": "item", "id": 50399657, "type": "story", "storyType": "story",
  "title": "CATL Sodium Battery Hits LFP Cost Parity in 2026: 15,000 Cycles, 30-Year Life",
  "url": "https://ievchina.com/energy-storage/catl-sodium-battery-cost-parity-lfp-2026-15000-cycles/",
  "domain": "ievchina.com", "author": "doener", "points": 86, "numComments": 34,
  "createdAt": "2026-11-06T23:00:46.000Z", "hnUrl": "https://news.ycombinator.com/item?id=50399657",
  "rank": 1, "kidsCount": 7, "ageHours": 1.4, "pointsPerHour": 60.26, "commentsPerHour": 23.82, "isTrending": true,
  "listName": "top", "source": "list:top"
}
```

A comment on it (same run):

```json
{
  "recordType": "item", "id": 50400039, "type": "comment", "author": "EwanToo",
  "text": "Alternative site which is still up\n\nhttps://www.pv-magazine.com/2026/11/06/sodium-ion-batteries-approach-cost-parity-with-lfp-with-70-gwh-covered-by-supply-agreements/",
  "createdAt": "2026-11-06T23:42:41.000Z", "parentId": 50399657, "storyId": 50399657, "depth": 0, "rank": 1,
  "storyTitle": "CATL Sodium Battery Hits LFP Cost Parity in 2026: 15,000 Cycles, 30-Year Life",
  "links": ["https://www.pv-magazine.com/2026/11/06/sodium-ion-batteries-approach-cost-parity-with-lfp-with-70-gwh-covered-by-supply-agreements/"]
}
```

A user profile:

```json
{
  "recordType": "user", "id": "pg", "karma": 157316, "about": "Bug fixer.", "createdAt": "2006-10-09T18:21:32.000Z",
  "accountAgeDays": 7333, "submittedCount": 15565, "storyCount": 699, "commentCount": 9985,
  "lastActiveAt": "2024-03-11T12:57:11.000Z", "lastStoryAt": "2023-08-27T00:51:13.000Z", "hnUrl": "https://news.ycombinator.com/user?id=pg"
}
```

A *Who is hiring?* post (fields shown are a subset; `text` and `textHtml` carry the whole post):

```json
{
  "recordType": "job-post", "id": 50338732, "threadTitle": "Ask HN: Who is hiring? (November 2026)", "month": "2026-11",
  "headerLine": "Simple Analytics | DevOps Engineer | REMOTE (worldwide, any timezone) | Full-time, 32h, 24h possible | €5,000/month (full-time) | https://www.simpleanalytics.com/jobs/devops",
  "company": "Simple Analytics", "domain": "simpleanalytics.com", "fundingStage": "Bootstrapped",
  "roles": ["DevOps Engineer"], "employmentTypes": ["full-time"], "locationPolicy": "remote", "remoteRegions": ["Worldwide"],
  "salaryMin": 5000, "salaryMax": 5000, "salaryCurrency": "EUR", "salaryPeriod": "month",
  "stack": ["Elasticsearch", "ClickHouse", "Ansible", "OpenTofu", "Docker", "Grafana", "GitHub Actions", "TypeScript"],
  "applyUrls": ["https://www.simpleanalytics.com/jobs/devops"]
}
```

A *Who wants to be hired?* post (subset):

```json
{
  "recordType": "candidate", "id": 50338729, "hnUser": "LoganDark", "threadMonth": "2026-11",
  "location": "US", "countries": ["United States"], "remote": true, "willingToRelocate": false, "yearsExperience": 10,
  "email": "logandark@logandark.net", "githubUrl": "https://github.com/LoganDark", "hasContact": true, "contactScore": 2
}
```

A keyword trend (72-hour window, subset):

```json
{
  "recordType": "trend", "kind": "keyword", "term": "AI", "windowHours": 72,
  "storyCount": 631, "previousStoryCount": 544, "storyGrowthPercent": 16, "commentCount": 3036, "previousCommentCount": 3013,
  "totalPoints": 10631, "avgPoints": 16.8, "maxPoints": 1292, "uniqueAuthors": 515, "trendScore": 88, "trendDirection": "steady",
  "topDomains": [{ "domain": "github.com", "count": 54 }, { "domain": "youtube.com", "count": 17 }],
  "topStories": [{ "id": 50364336, "title": "AI is forcing us to pay off 40 years of technical debt", "points": 1292, "numComments": 748 }]
}
```

#### How complete the parsed hiring fields are

Hiring posts are free text; each parsed field is a reading of the post and the full `text` always comes with it. Share of rows with the field filled, measured on 431 *Who is hiring?* posts (November 2026 plus the three months to November) and 520 candidate posts:

| Job posts | filled | Candidates | filled |
|---|---:|---|---:|
| company, headerLine | 100% | location | 99% |
| locationPolicy (remote / onsite / hybrid) | 95% | remote | 95% |
| domain | 86% | technologies | 92% |
| roles | 77% | email | 88% |
| employmentTypes | 75% | résumé link | 75% |
| stack | 67% | years of experience | 52% |
| applyUrls | 60% | website | 41% |
| remoteRegions | 48% | GitHub | 39% |
| contactEmails | 38% | LinkedIn | 32% |
| salary (min, max, currency, period) | 35% | time zones | 33% |
| equity | 24% | | |
| hiring system (Greenhouse, Lever, Ashby ...) | 21% | | |

Visa (5%), relocation (6%), funding stage (14%) and YC batch (2%) are filled only when a post says so.

### How can I use Hacker News data?

- **Brand and competitor monitoring:** schedule `searchQueries` with monitor mode and a Slack webhook; every new story or comment that names you arrives once.
- **Launch tracking:** `itemType: show_hn`, `postedWithinHours: 168`, `minPoints: 100` (17 Show HN stories in the week measured).
- **Recruiting and job-market research:** the monthly hiring threads as a table of companies, roles, salaries and stacks, or of candidates with contact links.
- **Trend research:** keyword trends against the previous window, and rising terms.
- **Datasets for analysis or AI:** whole discussions with structure (depth, parent, rank), user histories, past days' top stories.

### How much does it cost to scrape Hacker News?

Pay per event, no start fee:

| Event | Price | Per 1,000 |
|---|---:|---:|
| Item (story, comment, poll, poll option, job; a nested comment counts as one) | $0.00014 | $0.14 |
| User profile | $0.0009 | $0.90 |
| Job post (Who is hiring / SEEKING FREELANCER) | $0.0009 | $0.90 |
| Candidate post (Who wants to be hired / SEEKING WORK) | $0.0036 | $3.60 |
| Trend row (keyword or rising term) | $0.0045 | $4.50 |

Measured runs: the top 30 = $0.0042; a 1,000-row search = $0.14; two stories with their 1,675 comments nested inside (1,677 items) = $0.23; November 2026's *Who is hiring?* (205 posts) = $0.18 and *Who wants to be hired?* (504 posts) = $1.81. Author profiles, poll options and the dataset views are free. Rows removed by filters, users or items that do not exist, and rows a monitor delivered before are never charged. Set a maximum charge per run and the actor stops cleanly at it (a $0.003 limit on the top list returned 21 rows).

### Run it on a schedule

1. Save your input as a task, turn on **Only new since the last run** and give the watch a **Monitor name**.
2. Add a schedule (every hour, every day). Each run delivers only rows earlier runs did not; searches read newest first.
3. Optionally add a Slack, Discord or webhook URL to get each run's new rows pushed, and `alertMinPoints` to push only popular ones.
4. Or call it from the Apify API, Make, Zapier, n8n or an AI agent over MCP (`https://mcp.apify.com/?actors=TopApi/hacker-news-scraper`).

A monitor poll looks at the same rows a normal run would (the first N of each list or search); rows delivered before keep their place and are skipped. Measured: a poll with nothing new cost $0.000076-0.000078; a poll that found 3 new stories cost $0.0001.

### Coverage

- Lists: top 500, new 500, best 200, Ask HN, Show HN and jobs as HN publishes them (41, 186 and 31 on 2026-11-06).
- Search: every story, comment, poll and job in HN Search's index (stories since 2006); 1,000 hits per read, deeper by walking back in time.
- Comments: the whole tree of any story in one read (two discussions with 1,675 comments and author profiles in 7.4 s).
- Hiring threads: every month since the threads began; the *Freelancer* thread is found by its title.

### Limits & empty runs

- **HN's own past front page (`front?day=`) is not read:** news.ycombinator.com answers this actor's client with HTTP 419 on every route. A `front?day=` link or `frontPageDates` returns that day's stories ranked by points instead (`topStoriesDays`), which is not the same list: 15 of the 30 stories on HN's page for 2026-11-01 were on it.
- Points are published for stories and polls only; comments have none.
- HN Search's points and comment counts trail the live site by a point or so; lists and item ids are read live.
- A user's `storyCount` / `commentCount` come from HN Search; `submittedCount` is HN's own total (it also counts deleted items).
- The largest discussions with **Author profile on each row** mean one profile read per commenter: HN's three biggest threads (12,286 comments) took 249 s at the default 256 MB (634 s at 128 MB). Give such runs 1,024 MB to finish sooner; the price is the same.
- An input that matches nothing ends in about a second with a message saying so, and charges nothing.

### FAQ

#### Does Hacker News have a public API?

Yes: the official Firebase API (lists, items, users) and HN Search by Algolia (full-text search). This actor reads both and adds filters, depth past the 1,000-hit cap, parsing of the hiring threads, trends and monitoring.

#### Can I get the comments of a story?

Turn on **Comments** with item ids, links, lists or searches. Comments come in HN's ranked order (`rank` on top-level comments), with `depth` and `parentId`; `commentsFormat: nested` puts them inside the story row instead.

#### Can I get more than 1,000 search results?

Yes. Set `maxResultsPerSource` above 1,000; past the first 1,000 the rows are read newest first (5,000 rows of "google" in 7-50 s, $0.70 at the item price).

#### Why did my run return no rows?

The status message says which source matched nothing and which filters removed rows, with counts. Loosen the filters or widen the date window.

#### Do I need a Hacker News account or API key?

No.

#### Your feedback

Found a field you need or a post the hiring parser reads wrong? Open an issue on the actor's page.

# Actor input Schema

## `lists` (type: `array`):

HN's own ranked lists, read live from the official API: top (the front page, 500), new (500), best (200), ask, show, job. Empty with nothing else asked = top.

## `searchQueries` (type: `array`):

Full-text searches (HN Search), one per line, e.g. "rust", ""vector database"" (quotes = exact phrase), "apify". Use the filters below for type, dates, points and comments.

## `startUrls` (type: `array`):

news.ycombinator.com links: item?id= (a story or comment), user?id=, submitted?id=, threads?id=, from?site=, news / newest / best / ask / show / jobs, or an hn.algolia.com search link.

## `itemIds` (type: `array`):

HN item ids (the number in item?id=), e.g. 8863. Stories, comments, polls or jobs. Turn on comments below to get each story's discussion.

## `usernames` (type: `array`):

HN usernames, e.g. pg, dang. One profile row each: karma, about, created, submissions, story and comment counts, last activity.

## `topStoriesDays` (type: `array`):

Days (UTC) like 2026-11-01, today or yesterday: the stories created that day, ranked by points.

## `hiringThreads` (type: `array`):

Parse the monthly threads into rows: Who is hiring = one job post per row; Who wants to be hired = one candidate per row; Freelancer = SEEKING WORK (candidate) and SEEKING FREELANCER (job post).

## `hiringMonths` (type: `array`):

Which months to read: latest (default), 2026-10, October 2026, or last 3. A month is read whole unless Max rows per source is set.

## `trendKeywords` (type: `array`):

One trend row per keyword: stories and comments in the window vs the window before, points, comments, top stories, top domains, growth and a trend score. Exact matches only.

## `discoverRisingTerms` (type: `boolean`):

Words and two-word phrases in story titles that grew most against the previous window, one trend row each.

## `itemType` (type: `string`):

What a search returns. Default stories (Ask HN and Show HN included).

## `sortBy` (type: `string`):

Relevance (HN Search's ranking, points first) or newest first.

## `searchIn` (type: `string`):

Where the query must match: everywhere (title, url, text, author), only the title, only the link, only the text, or only the author name.

## `exactMatch` (type: `boolean`):

Turn off HN Search's typo tolerance, so "rust" does not also match "trust".

## `dateFrom` (type: `string`):

Created on or after: 2026-11-01, an ISO time, a unix time, or "7 days" (ago).

## `dateTo` (type: `string`):

Created on or before, e.g. 2026-11-06.

## `postedWithinHours` (type: `integer`):

Only items from the last N hours, e.g. 24.

## `minPoints` (type: `integer`):

Stories with at least this many points, e.g. 100. Comments have no public points and are not filtered by it.

## `minComments` (type: `integer`):

Stories with at least this many comments, e.g. 50.

## `authors` (type: `array`):

Only items by these usernames, e.g. pg. On its own (no query) it lists their items.

## `domains` (type: `array`):

Only stories linking to these sites, e.g. github.com. On its own (no query) it searches the domain like HN's from?site= page.

## `filterKeywords` (type: `array`):

Keep only rows whose title or text contains one of these words (any), e.g. llm. Useful on lists.

## `hiringKeywords` (type: `array`):

Keep hiring rows containing these words, e.g. backend, rust, "staff engineer".

## `hiringKeywordsMatch` (type: `string`):

Any or all of the hiring keywords.

## `technologies` (type: `array`):

Keep posts naming one of these technologies, e.g. Go, PostgreSQL, React.

## `locations` (type: `array`):

Keep posts naming one of these places or regions, e.g. Berlin, United Kingdom, Europe.

## `remoteOnly` (type: `boolean`):

Job posts that offer remote work; candidates who want remote.

## `onsiteOnly` (type: `boolean`):

Job posts with an office (onsite or hybrid).

## `visaOnly` (type: `boolean`):

Job posts that say they sponsor visas.

## `withSalaryOnly` (type: `boolean`):

Job posts that state pay.

## `withEmailOnly` (type: `boolean`):

Posts that publish an email address.

## `willingToRelocateOnly` (type: `boolean`):

Candidates who say they will relocate.

## `latamOnly` (type: `boolean`):

Job posts open to Latin America (LATAM, Americas or worldwide remote).

## `includeComments` (type: `boolean`):

Each story's discussion (one read per story), in HN's ranked order. Each comment is billed as one item.

## `maxCommentsPerStory` (type: `integer`):

0 = the whole discussion.

## `maxCommentDepth` (type: `integer`):

1 = top-level comments only, 2 = and their replies, ... 0 = every level.

## `commentSort` (type: `string`):

Order of top-level comments; replies follow their parent.

## `commentsFormat` (type: `string`):

Either way each comment is one item.

## `includeAuthorProfile` (type: `boolean`):

Adds the author's karma, account creation date, account age and submission count to every story and comment. Free.

## `includeUserSubmissions` (type: `boolean`):

With Usernames: also their stories (and comments, below), newest first, billed as items.

## `submissionTypes` (type: `array`):

Which submissions to read.

## `maxSubmissionsPerUser` (type: `integer`):

Per user and type. Empty = Max rows per source.

## `trendWindowHours` (type: `integer`):

Length of the current window; it is compared with the window just before it. 168 = a week.

## `risingTermsMax` (type: `integer`):

How many rising terms to return.

## `risingMinMentions` (type: `integer`):

A term must appear in at least this many titles in the window.

## `risingMinGrowthPercent` (type: `integer`):

Growth against the previous window (100 = doubled). New terms always qualify.

## `monitorMode` (type: `boolean`):

Pairs with a schedule: rows delivered by earlier runs are skipped (and not charged). Searches read newest first.

## `monitorName` (type: `string`):

One memory per name: use a different name for each watch, e.g. brand-mentions.

## `resetMonitor` (type: `boolean`):

Forget what this monitor delivered and start over.

## `webhookUrl` (type: `string`):

Receives the run's new stories and posts as one JSON POST.

## `slackWebhookUrl` (type: `string`):

Slack incoming-webhook URL for the same alert.

## `discordWebhookUrl` (type: `string`):

Discord webhook URL for the same alert.

## `alertMinPoints` (type: `integer`):

Only stories with at least this many points go into the alert (all rows still go to the dataset).

## `maxResultsPerSource` (type: `integer`):

Per list, search, day, user or hiring month. Empty = 100 (a hiring month: every post). Lists hold 500 at most; a search goes past HN Search's 1,000-hit cap by walking back in time.

## `maxResults` (type: `integer`):

A cap for the whole run, comments included. 0 = no cap besides the per-source one.

## `compactOutput` (type: `boolean`):

Drop the raw HTML, link lists and id lists: core fields only (for AI agents and spreadsheets).

## `includeDead` (type: `boolean`):

Keep items HN marks dead or deleted (they carry little or no text).

## `maxConcurrency` (type: `integer`):

Item reads in flight at once.

## `proxyConfiguration` (type: `object`):

Not needed: both HN APIs answer directly. If a request is refused the run moves to the Apify datacenter, then residential proxy by itself.

## Actor input object example

```json
{
  "lists": [
    "top"
  ],
  "discoverRisingTerms": false,
  "sortBy": "relevance",
  "searchIn": "all",
  "exactMatch": false,
  "hiringKeywordsMatch": "any",
  "remoteOnly": false,
  "onsiteOnly": false,
  "visaOnly": false,
  "withSalaryOnly": false,
  "withEmailOnly": false,
  "willingToRelocateOnly": false,
  "latamOnly": false,
  "includeComments": false,
  "maxCommentsPerStory": 100,
  "maxCommentDepth": 0,
  "commentSort": "ranked",
  "commentsFormat": "rows",
  "includeAuthorProfile": false,
  "includeUserSubmissions": false,
  "submissionTypes": [
    "story"
  ],
  "trendWindowHours": 24,
  "risingTermsMax": 25,
  "risingMinMentions": 3,
  "risingMinGrowthPercent": 100,
  "monitorMode": false,
  "monitorName": "default",
  "resetMonitor": false,
  "maxResultsPerSource": 30,
  "maxResults": 0,
  "compactOutput": false,
  "includeDead": false,
  "maxConcurrency": 32,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

One item per story, comment, poll or job; per user profile; per parsed hiring post (job post or candidate); per trend row.

## `summary` (type: `string`):

Per-source counts, filters, reads and egress (written for runs where a read failed).

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "lists": [
        "top"
    ],
    "maxResultsPerSource": 30
};

// Run the Actor and wait for it to finish
const run = await client.actor("topapi/hacker-news-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "lists": ["top"],
    "maxResultsPerSource": 30,
}

# Run the Actor and wait for it to finish
run = client.actor("topapi/hacker-news-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "lists": [
    "top"
  ],
  "maxResultsPerSource": 30
}' |
apify call topapi/hacker-news-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,topapi/hacker-news-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/qIQdvygHMVPo6nebH/builds/C7cSghlPaP0cjRd12/openapi.json
