# Hacker News Scraper: Stories, Comments, Hiring Jobs (`zhtech/hacker-news-scraper`) Actor

Hacker News front page and all lists, keyword search with date, points and comment filters, full comment trees, user profiles, and Who is hiring threads as structured job rows (salary, remote, apply link). Official APIs, no login.

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

## Pricing

from $0.25 / 1,000 stories

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Hacker News Scraper: stories, comments, search, users and Who is hiring jobs

Scrape **Hacker News** (news.ycombinator.com) through its two official public APIs: the front page and every list, keyword search with date, points and comment filters, full comment trees, user profiles, and the monthly **"Ask HN: Who is hiring?"** thread turned into clean, structured job rows with company, role, location, remote, salary and apply link.

No login, no API key, no proxy, no HTML scraping. Fast (the default run takes about 4 seconds) and you only pay for rows you get.

### What can this Hacker News scraper do?

| Mode | What you get |
|---|---|
| **Lists** | Front page (top), new, best, Ask HN, Show HN and jobs, in ranked order. A story on several lists comes back once, with every list and rank it holds. |
| **Keyword search** | Stories, comments, Ask HN, Show HN, Launch HN, job posts, polls or everything, through the official Algolia HN search. Filter by date range, minimum points, minimum comments, author and domain. Sort by relevance or newest first. Newest first has **no 1,000 result limit**. |
| **Comment trees** | Every comment of any story (or the replies under any comment), in the same reading order as the site, with depth, parent, rank, reply counts and thread path. No depth or count limit unless you set one. |
| **User profiles** | Karma, join date, account age, about text with its links, number of submissions, and optionally each user's latest stories and comments. |
| **Who is hiring** | The monthly hiring thread parsed into one row per job post (or per role): company, roles, locations, remote yes or no, remote region, hybrid or onsite, employment type, seniority, salary range with currency and period plus a yearly USD value, equity, visa sponsorship, relocation, tech stack, apply URL, ATS platform, company website, emails, YC batch and more. Filter by keywords, remote, location and minimum salary. |

You can also add the comments of every story found in Lists or Search mode, and run any mode as a **monitor** that only returns items you have not received before.

### Why this actor

- **Five tools in one.** Most Hacker News actors do either lists and search or hiring threads. This one does both, with one consistent output format.
- **Who is hiring done properly.** Salaries like `$182k-$275k`, `70k - 100k EUR`, `up to £90k`, `€5,000/month` or `$55 - $75/hr` are parsed into numbers, currency and period, then converted to a comparable yearly USD range. Posts listing several roles keep every role. Posts edited to say "position filled" are skipped (and not charged). Obfuscated emails such as `jobs [at] acme [dot] com` are decoded. Apply links on Greenhouse, Lever, Ashby, Workable and more than 25 other hiring platforms are recognized.
- **Past the 1,000 result ceiling.** Algolia returns at most 1,000 hits per query. In newest first order this actor moves a time cursor and keeps going (tested with 1,500 comments in 2 requests).
- **Official data sources only.** The Firebase API gives live points, comment counts and the ranked order of lists and top level comments. The Algolia HN Search API gives search and a whole comment tree in a single request. Nothing gets blocked, no proxy needed.
- **Fair billing.** Separate prices for stories, comments, users and hiring jobs. Filtered, duplicate and already delivered items are never charged. Invalid input fails before the start fee is charged.

### Use cases

- **Tech news monitoring and newsletters:** the front page every hour, with points, comment counts and rank.
- **Brand and competitor monitoring:** search your product, domain or competitor names in stories and comments every day, only new mentions are returned.
- **Sentiment and AI research:** full comment trees for LLM summarization, RAG datasets or opinion mining.
- **Job search, recruiting and lead generation:** every company hiring on HN this month, with remote and salary filters, apply links and contact emails. Track hiring trends month over month.
- **Startup research:** Show HN and Launch HN posts with traction (points, comments), YC batches from hiring posts.
- **Community analytics:** user karma, account age and posting activity.

### How to use

1. Pick **What to scrape** (the mode).
2. Fill in the section for that mode. Other sections are ignored.
3. Optional: turn on **Only new items** for scheduled runs, set **Max results** as a cost cap.
4. Run, then open the **Output** tab. Each record type has its own view (Stories, Comments, Who is hiring jobs, Users). Export to JSON, CSV, Excel, XML or HTML, or read it through the API.

### Input examples

Front page, top 30 (the default):

```json
{ "mode": "lists", "lists": ["top"], "maxItemsPerList": 30 }
```

Best and Show HN stories with at least 100 points, plus their top comments:

```json
{
    "mode": "lists",
    "lists": ["best", "show"],
    "maxItemsPerList": 100,
    "minPoints": 100,
    "includeComments": true,
    "maxCommentsPerStory": 20,
    "maxCommentDepth": 1
}
```

Every story about Postgres in 2025 with at least 50 points:

```json
{
    "mode": "search",
    "searchQueries": ["postgres", "postgresql"],
    "searchType": "story",
    "dateFrom": "2025-01-01",
    "dateTo": "2025-12-31",
    "minPoints": 50,
    "searchSort": "date",
    "maxResultsPerQuery": 5000
}
```

Daily brand monitor over comments and stories, only new mentions:

```json
{
    "mode": "search",
    "searchQueries": ["\"your product\""],
    "searchType": "all",
    "searchSort": "date",
    "dateFrom": "2 days",
    "onlyNew": true,
    "stateKey": "brand-monitor"
}
```

All stories from one site:

```json
{ "mode": "search", "searchQueries": [""], "domain": "github.com", "minPoints": 300 }
```

Full comment tree of a story:

```json
{ "mode": "comments", "storyIds": ["https://news.ycombinator.com/item?id=8863"], "maxCommentsPerStory": 0 }
```

User profiles with their 10 newest posts:

```json
{ "mode": "users", "usernames": ["pg", "dang"], "userSubmissionsLimit": 10 }
```

Remote Rust or Go jobs paying at least $150k a year, last 3 months, one row per role:

```json
{
    "mode": "whoIsHiring",
    "hiringMonths": 3,
    "hiringKeywords": ["rust", "golang"],
    "hiringRemoteOnly": true,
    "hiringMinSalaryUsd": 150000,
    "hiringOnePerRole": true
}
```

### Input reference

| Field | Mode | Description |
|---|---|---|
| `mode` | all | `lists`, `search`, `comments`, `users` or `whoIsHiring`. |
| `lists` | lists | Any of `top`, `new`, `best`, `ask`, `show`, `job`. |
| `maxItemsPerList` | lists | Stories per list, 1 to 500 (top and new hold 500, others 200). |
| `searchQueries` | search | One query per line. Quotes for exact phrases. |
| `searchType` | search | `story`, `comment`, `ask_hn`, `show_hn`, `launch_hn`, `job`, `poll`, `front_page`, `all`. |
| `searchSort` | search | `relevance` (top 1,000) or `date` (newest first, unlimited). |
| `dateFrom`, `dateTo` | search | `2026-01-31`, an ISO date time, or relative: `7 days`, `24 hours`, `3 months`. |
| `minPoints`, `minComments` | lists, search | Story filters. |
| `author` | search | HN username (case sensitive). |
| `domain` | search | Only stories linking to this site. |
| `maxResultsPerQuery` | search | 1 to 50,000. |
| `storyIds` | comments | Item IDs or HN links. A comment ID returns that comment's replies. |
| `includeComments` | lists, search | Add each story's comments. |
| `maxCommentsPerStory` | comments, lists, search | 0 means all. |
| `maxCommentDepth` | comments, lists, search | 1 keeps top level only. 0 means unlimited. |
| `includeStoryRow` | comments | Save the story row before its comments. |
| `usernames` | users | Usernames or profile links. |
| `userSubmissionsLimit` | users | Newest stories and comments per user, 0 to 1,000. |
| `hiringMonths` | whoIsHiring | Latest monthly threads to parse, 1 to 120. |
| `hiringThreadIds` | whoIsHiring | Specific threads instead of the latest months. |
| `hiringKeywords`, `hiringExcludeKeywords` | whoIsHiring | Whole word, case insensitive, matched in the full post. |
| `hiringRemoteOnly` | whoIsHiring | Only posts offering remote work. |
| `hiringLocations` | whoIsHiring | Match location, remote region or headline, for example `NYC`, `London`, `Europe`. |
| `hiringMinSalaryUsd` | whoIsHiring | Minimum yearly USD (top of range). Posts without salary are dropped when set. |
| `hiringSkipClosed` | whoIsHiring | Skip posts marked filled or closed (default on). |
| `hiringOnePerRole` | whoIsHiring | One row per role instead of per post. |
| `onlyNew`, `stateKey` | all but users | Monitor mode memory. |
| `includeHtml` | all | Add original HTML next to plain text. |
| `maxItems` | all | Hard cap on rows for the whole run. |

### Output

Every row has a `type`: `story`, `comment`, `user` or `hiringJob`, plus `scrapedAt`. Timestamps are ISO 8601 UTC, with the unix value next to them.

#### Story

```json
{
    "type": "story",
    "id": 8863,
    "storyType": "story",
    "title": "My YC app: Dropbox - Throw away your USB drive",
    "url": "http://www.getdropbox.com/u/2/screencast.html",
    "domain": "getdropbox.com",
    "author": "dhouston",
    "points": 104,
    "commentsCount": 71,
    "createdAt": "2007-04-04T19:16:40.000Z",
    "createdAtUnix": 1175714200,
    "hnUrl": "https://news.ycombinator.com/item?id=8863",
    "authorUrl": "https://news.ycombinator.com/user?id=dhouston",
    "text": null,
    "lists": ["top"],
    "ranks": { "top": 1 },
    "rank": 1,
    "scrapedAt": "2026-11-18T04:39:00.676Z"
}
```

`storyType` is `story`, `ask_hn`, `show_hn`, `launch_hn`, `tell_hn`, `job` or `poll`. `lists`, `ranks` and `rank` appear in Lists mode, `searchQuery` and `wasOnFrontPage` in Search mode.

#### Comment

```json
{
    "type": "comment",
    "id": 9272,
    "storyId": 8863,
    "storyTitle": "My YC app: Dropbox - Throw away your USB drive",
    "parentId": 9224,
    "isTopLevel": false,
    "depth": 2,
    "rank": 1,
    "path": [9224],
    "author": "dhouston",
    "text": "1. re: the first part, many people want something plug and play...",
    "createdAt": "2007-04-05T16:47:01.000Z",
    "createdAtUnix": 1175791621,
    "replyCount": 1,
    "descendantCount": 1,
    "hnUrl": "https://news.ycombinator.com/item?id=9272",
    "storyHnUrl": "https://news.ycombinator.com/item?id=8863"
}
```

Comments come in reading order. Rebuild the tree with `id` and `parentId`, or use `depth` and `path` (the ancestor comment IDs). Hacker News does not publish comment scores, so comments have no points.

#### Who is hiring job

```json
{
    "type": "hiringJob",
    "jobId": "50339001",
    "commentId": 50339001,
    "threadId": 50338728,
    "threadMonth": "2026-11",
    "threadTitle": "Ask HN: Who is hiring? (November 2026)",
    "company": "Acme Robotics",
    "roles": ["Senior Backend Engineer", "Staff ML Engineer"],
    "role": "Senior Backend Engineer; Staff ML Engineer",
    "locations": ["San Francisco, CA"],
    "location": "San Francisco, CA",
    "remote": true,
    "workplaceTypes": ["remote", "onsite"],
    "remoteScope": "US",
    "employmentTypes": ["full-time"],
    "seniority": "staff+",
    "salaryText": "$180K-$220K",
    "salaryMin": 180000,
    "salaryMax": 220000,
    "salaryCurrency": "USD",
    "salaryPeriod": "year",
    "salaryUsdYearlyMin": 180000,
    "salaryUsdYearlyMax": 220000,
    "equity": true,
    "visaSponsorship": true,
    "relocation": null,
    "techStack": ["Python", "Go", "PostgreSQL", "Kubernetes"],
    "applyUrl": "https://jobs.ashbyhq.com/acme",
    "atsPlatform": "Ashby",
    "companyUrl": "https://acme.ai",
    "emails": ["jobs@acme.ai"],
    "links": ["https://jobs.ashbyhq.com/acme", "https://acme.ai"],
    "ycBatch": "W24",
    "fundingStage": null,
    "headline": "Acme Robotics (YC W24) | Senior Backend Engineer, Staff ML Engineer | San Francisco, CA | REMOTE (US) or ONSITE | Full-time | $180K-$220K + equity",
    "headlineExtras": [],
    "isClosed": false,
    "parseConfidence": "high",
    "text": "Acme Robotics (YC W24) | Senior Backend Engineer, ...",
    "author": "acme_founder",
    "postedAt": "2026-11-02T16:20:11.000Z",
    "replyCount": 2,
    "hnUrl": "https://news.ycombinator.com/item?id=50339001",
    "threadUrl": "https://news.ycombinator.com/item?id=50338728"
}
```

(Example values are illustrative. Real sample output is produced from live threads.)

Field notes:

- `remote` is true when remote work is offered at all. `workplaceTypes` lists every arrangement named (`remote`, `hybrid`, `onsite`). `remoteScope` is where remote hires may live, as written ("US", "Europe", "worldwide, any timezone").
- `salaryUsdYearlyMin` and `salaryUsdYearlyMax` use fixed approximate exchange rates (November 2026) and 2,080 hours, 260 days, 52 weeks or 12 months per year. The original numbers and currency are always kept.
- `visaSponsorship` is `true` when sponsorship is offered, `false` when the post rules it out (including "US citizens only" or "work authorization required"), `null` when not mentioned.
- `seniority` is one of `intern`, `junior`, `mid`, `senior`, `lead`, `staff+`, `founding`, `executive` or `null`.
- `parseConfidence` is `high` when the post has the usual pipe headline with a company, a role and a place or workplace, `medium` when one is missing, `low` for free text posts. `text` always holds the full post.
- `headlineExtras` keeps headline parts that are not a known field (for example "Seed", "No agencies", "DUTCH REQUIRED").

#### User

```json
{
    "type": "user",
    "username": "pg",
    "karma": 157316,
    "createdAt": "2006-10-09T18:21:32.000Z",
    "accountAgeDays": 7344,
    "about": "Bug fixer.",
    "aboutLinks": [],
    "aboutEmails": [],
    "submissionsCount": 15565,
    "latestSubmissionIds": [39667625, 37278578],
    "profileUrl": "https://news.ycombinator.com/user?id=pg"
}
```

A `RUN_SUMMARY` record in the default key-value store lists rows saved per type, items filtered (and why), errors, and request statistics.

### Pricing

Pay per event, you only pay for what is delivered:

- **Actor start**: a small flat fee once per run.
- **Story**: per story row.
- **Comment**: per comment row (cheaper than a story).
- **User**: per user profile row.
- **Hiring job**: per Who is hiring row.

The current prices per event are shown on the Pricing tab. Never charged: items removed by your filters, stories already returned from another list or query in the same run, items already delivered in monitor mode, posts marked as filled, and anything after your max total charge or Max results is reached. Input errors (bad date, invalid username, missing story IDs) stop the run before the start fee.

Typical runs: the front page (30 stories) is 1 start plus 30 story events. One month of Who is hiring is roughly 250 job rows. A story with 300 comments is 1 story plus 300 comment events.

### Use with the API, integrations and AI agents

- **API**: run with `POST https://api.apify.com/v2/acts/zhtech~hacker-news-scraper/run-sync-get-dataset-items?token=YOUR_TOKEN` and the JSON input as the body to get rows back in one call. Add `&view=hiringJobs` (or `comments`, `users`) to get a specific view.
- **Clients**: `apify-client` for JavaScript and Python. Example (JavaScript): `await client.actor('zhtech/hacker-news-scraper').call({ mode: 'whoIsHiring', hiringRemoteOnly: true })`.
- **Schedules and monitoring**: schedule any input with `onlyNew: true` and a `stateKey` per schedule. Connect a webhook, Slack, Google Sheets, Zapier, Make or n8n integration to receive only new stories, mentions or jobs.
- **LLMs and MCP**: the actor works as a tool through the Apify MCP server (mcp.apify.com), so Claude, ChatGPT, Cursor and other agents can fetch the HN front page, search discussions or pull hiring data on demand. Comment rows are plain text in reading order, ready for summarization or retrieval.

### FAQ

**Is it legal to scrape Hacker News?**
The actor reads the official public Hacker News API (published by Y Combinator on Firebase) and the public Algolia HN Search API, which exist for programmatic access. It collects only public data and needs no login. You are responsible for how you use the data, including any personal data such as usernames or emails written in posts.

**Do I need a proxy?**
No. Both APIs are public and the actor is polite. The proxy field exists only for special network setups.

**Why do I get fewer search results than the match count?**
Relevance order is limited to the top 1,000 hits per query by Algolia. Use `searchSort: "date"` to page through every match. Also check `minPoints`, `minComments`, `domain` and the date range.

**Are comments in the same order as on the site?**
Top level comments are ranked exactly like the site (from the Firebase API). Replies under each comment are ordered oldest first, which can differ from the vote based order on the site for busy threads.

**How accurate is the Who is hiring parsing?**
Measured on the October and November 2026 threads (495 posts): company found for 97 percent of posts, at least one role for 86 percent, remote, hybrid or onsite for 87 percent, an apply or company link for 83 percent, a salary range for 36 percent (many posts do not state one), and 82 percent parsed with high confidence. Posts are free text, so check `parseConfidence` and `text` when a field matters.

**Can I get "Who wants to be hired" or other threads?**
Put any thread ID in `hiringThreadIds`. Top level comments are parsed with the same job parser, which works best on hiring posts.

**What happens with deleted or dead items?**
They are skipped and counted in `RUN_SUMMARY`, never charged.

**How fresh is the data?**
Lists, story points and comment counts are live (Firebase). Search and comment trees come from Algolia, usually a few seconds to minutes behind. Items too new for Algolia are read from Firebase automatically.

### Limitations

- Hacker News does not expose comment scores, flags or votes, and does not expose user emails. Only what a user wrote in their about text or a post is returned.
- Relevance sorted search is capped at 1,000 results per query by Algolia (newest first is not).
- Salary and location parsing is heuristic. Unusual formats may be missed; the full text is always included.
- Exchange rates for the yearly USD fields are fixed approximations, not live rates.
- Users are not covered by monitor mode (profiles change, so every run returns them).

### Support

Found a post the parser gets wrong, or need another field? Open an issue on the Issues tab with the HN link and it will be looked at quickly.

# Actor input Schema

## `mode` (type: `string`):

Lists: front page (top), new, best, Ask HN, Show HN and jobs. Search: keyword search with date, points and comments filters. Comments: full comment trees of stories you give. Users: profiles. Who is hiring: the monthly "Ask HN: Who is hiring?" thread parsed into structured job rows. Only the section for the chosen mode is used.

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

Which Hacker News lists to read. Top is the front page in ranked order. A story on several lists is returned once, with every list and rank it holds.

## `maxItemsPerList` (type: `integer`):

How many stories to read from each list, in rank order. 30 is one front page. Top and new hold up to 500, the others up to 200.

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

One search per line, run through the official Algolia Hacker News search. Use quotes for an exact phrase, for example "rust compiler". Leave empty and set an author, domain or date range to list everything that matches those filters.

## `searchType` (type: `string`):

Stories (default), comments, a story type, or everything (stories, comments, polls and jobs).

## `searchSort` (type: `string`):

Relevance (Algolia ranking, at most 1,000 results per query) or newest first (no limit, pages through every match).

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

Only items created on or after this date. Absolute (2026-01-31 or an ISO date time) or relative (7 days, 24 hours, 3 months, 1 year).

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

Only items created on or before this date (a plain date includes the whole day). Same formats as Date from.

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

Only stories with at least this many points. Works in Lists and Search mode. Filtered stories are not charged.

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

Only stories with at least this many comments. Works in Lists and Search mode.

## `author` (type: `string`):

Only items posted by this Hacker News username (case sensitive), for example pg.

## `domain` (type: `string`):

Only stories linking to this site, for example github.com or nytimes.com. With an empty query this lists every story from the site.

## `maxResultsPerQuery` (type: `integer`):

Upper limit of stories or comments per search query. Above 1,000 the run switches to newest first automatically.

## `storyIds` (type: `array`):

Stories whose full comment tree you want: item IDs (8863) or links (https://news.ycombinator.com/item?id=8863). A comment ID returns that comment and its replies.

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

Adds the comment tree of every story found in Lists or Search mode. Each comment is a separate dataset row and charged as a comment.

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

Upper limit of comments saved per story, in the order they appear on Hacker News (top level ranked like the site, replies under their parent). 0 means all.

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

1 keeps only top level comments, 2 adds their direct replies, and so on. 0 means unlimited.

## `includeStoryRow` (type: `boolean`):

Save one story row (title, points, comment count) before its comments.

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

Hacker News usernames (case sensitive) or profile links such as https://news.ycombinator.com/user?id=pg.

## `userSubmissionsLimit` (type: `integer`):

Also save this many of each user's newest stories and comments (charged as stories and comments). 0 saves only the profile.

## `hiringMonths` (type: `integer`):

How many of the latest monthly "Ask HN: Who is hiring?" threads to parse. 1 is the current month. Each thread has roughly 250 to 1,000 job posts.

## `hiringThreadIds` (type: `array`):

Parse these threads instead of the latest months, for example an older Who is hiring thread.

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

Keep job posts that mention at least one of these anywhere (whole word, case insensitive), for example rust, react, kubernetes.

## `hiringExcludeKeywords` (type: `array`):

Drop job posts that mention any of these, for example crypto, onsite only.

## `hiringRemoteOnly` (type: `boolean`):

Keep only posts that offer remote work (fully remote or remote as an option).

## `hiringLocations` (type: `array`):

Keep posts whose location, remote region or headline mentions one of these, for example NYC, London, Europe, US.

## `hiringMinSalaryUsd` (type: `integer`):

Keep only posts that state a salary whose top of range, converted to yearly USD, is at least this. Posts without a stated salary are dropped when this is set.

## `hiringSkipClosed` (type: `boolean`):

Many companies edit their post to say the role is filled. Those are skipped (and not charged) by default.

## `hiringOnePerRole` (type: `boolean`):

When a post lists several roles, save one row per role instead of one row per post. Each row is charged as a hiring job.

## `onlyNew` (type: `boolean`):

Remembers delivered stories, comments and job posts under the state key and skips them on later runs, so a scheduled run returns and charges only new items.

## `stateKey` (type: `string`):

Name of the memory used by monitor mode. Use a different key for each scheduled task.

## `includeHtml` (type: `boolean`):

Adds the original HTML of texts next to the plain text version.

## `maxItems` (type: `integer`):

Hard cap on dataset rows for the whole run, a safety limit on cost. 0 means no cap besides your max charge.

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

Not needed: both sources are official public APIs. Leave off.

## Actor input object example

```json
{
  "mode": "lists",
  "lists": [
    "top"
  ],
  "maxItemsPerList": 30,
  "searchType": "story",
  "searchSort": "relevance",
  "minPoints": 0,
  "minComments": 0,
  "maxResultsPerQuery": 100,
  "storyIds": [
    "8863"
  ],
  "includeComments": false,
  "maxCommentsPerStory": 200,
  "maxCommentDepth": 0,
  "includeStoryRow": true,
  "usernames": [
    "pg"
  ],
  "userSubmissionsLimit": 0,
  "hiringMonths": 1,
  "hiringRemoteOnly": false,
  "hiringMinSalaryUsd": 0,
  "hiringSkipClosed": true,
  "hiringOnePerRole": false,
  "onlyNew": false,
  "stateKey": "default",
  "includeHtml": false,
  "maxItems": 0,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `stories` (type: `string`):

No description

## `comments` (type: `string`):

No description

## `hiringJobs` (type: `string`):

No description

## `users` (type: `string`):

No description

## `allResults` (type: `string`):

No description

## `runSummary` (type: `string`):

No description

# 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 = {
    "mode": "lists",
    "lists": [
        "top"
    ],
    "maxItemsPerList": 30,
    "storyIds": [
        "8863"
    ],
    "usernames": [
        "pg"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("zhtech/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 = {
    "mode": "lists",
    "lists": ["top"],
    "maxItemsPerList": 30,
    "storyIds": ["8863"],
    "usernames": ["pg"],
}

# Run the Actor and wait for it to finish
run = client.actor("zhtech/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 '{
  "mode": "lists",
  "lists": [
    "top"
  ],
  "maxItemsPerList": 30,
  "storyIds": [
    "8863"
  ],
  "usernames": [
    "pg"
  ]
}' |
apify call zhtech/hacker-news-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,zhtech/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/p1XynIdfjwCwX1eDM/builds/VQCmcebivs96DR35B/openapi.json
