# Hacker News Scraper: Stories, Comments & Who's Hiring (`lx112/hacker-news-scraper`) Actor

Hacker News stories, comments and job posts from the official HN API and HN Search, no login: front-page lists (top, new, best, Ask, Show, jobs), keyword search with date and points filters, full comment threads, and monthly Who is hiring? posts parsed into company, location and remote.

- **URL**: https://apify.com/lx112/hacker-news-scraper.md
- **Developed by:** [Jing Peng Xing](https://apify.com/lx112) (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.30 / 1,000 item scrapeds

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

## Hacker News Scraper: Stories, Comments & Who's Hiring

Get **Hacker News stories, comments and job posts** as clean JSON, CSV or Excel. Four things in one actor:

- **Front-page lists**: top, new, best, Ask HN, Show HN and jobs, in rank order.
- **Keyword search** over all of Hacker News, with date and points filters, for stories, comments or both.
- **Full comment threads** for any story, in thread order with depth and parent IDs.
- **"Who is hiring?"**: the monthly hiring threads turned into job posts with company, remote/onsite flags, salary and links.

It reads the official Hacker News API and HN Search (by Algolia). No login, no proxies, no browser, so runs are fast:
a front page takes a couple of seconds, a 500-post hiring thread about five.

### What you get

**Stories** (`type: "story"`, also `"job"` and `"poll"`):

```json
{
  "type": "story", "id": 50456631, "title": "AWS emulator", "url": "https://github.com/aws/aws-emulator",
  "domain": "github.com", "text": "https://www.aboutamazon.com/news/aws/how-autonomous-ai-agents-built-aws-emulator ...", "author": "super_linear", "points": 630, "commentCount": 209,
  "createdAt": "2026-11-11T18:21:38.000Z", "hnUrl": "https://news.ycombinator.com/item?id=50456631",
  "rank": 1, "source": "feed", "sourceValue": "top", "scrapedAt": "2026-11-12T00:43:57.334Z"
}
```

**Comments** (`type: "comment"`): `id`, `storyId`, `storyTitle`, `parentId`, `depth`, `text` (plain text, links written
out in full), `links`, `author`, `createdAt`, `hnUrl`.

**Hiring posts** (`type: "hiring"`):

```json
{
  "type": "hiring", "id": 50339013, "threadId": 50338728, "threadTitle": "Ask HN: Who is hiring? (November 2026)",
  "month": "2026-11", "company": "MixRank (YC S11)",
  "headline": "MixRank (YC S11) | Software Engineers | 100% Remote (Global) | Full-Time ...",
  "remote": true, "onsite": false, "hybrid": false, "visaSponsorship": false, "salary": null,
  "text": "...", "links": ["https://www.ycombinator.com/companies/mixrank/jobs/Fnwsojk-j"],
  "author": "Kiran_MixRank", "createdAt": "2026-11-02T16:15:14.000Z",
  "hnUrl": "https://news.ycombinator.com/item?id=50339013"
}
```

Every item says where it came from (`source`: `feed`, `search`, `story` or `hiring`, and `sourceValue`). The run's
**SUMMARY** record lists how many items each input returned and any errors.

### Input

| Field | What it does |
|---|---|
| Front-page lists | Any of `top`, `new`, `best`, `ask`, `show`, `jobs` |
| Search | Keywords; `"quotes"` for an exact phrase |
| Search in / order | Stories, comments or both; newest first or most popular |
| Posted after / before, Min points | Filters for search |
| Stories | Item IDs or links; returns the story and its comments |
| Include comments for lists and search | Adds the comment thread of every story found |
| Who is hiring: months | How many of the latest monthly threads to return (1 = this month) |
| Who is hiring: keywords | Only posts containing every word, e.g. `remote`, `rust` |

### Good for

- **Monitoring**: schedule a search for your company, product or competitors and get every new mention.
- **Market and developer research**: pull the discussion on a topic and feed it to an LLM.
- **Recruiting and job search**: the hiring threads as a filterable table.
- **Content ideas and trend tracking**: daily snapshots of the top or best list.

### Limits

- HN Search returns at most 1,000 results per query. Newest-first search gets past that by paging back through time;
  most-popular search stops at 1,000.
- The `remote`, `onsite`, `hybrid`, `visaSponsorship` and `salary` fields are read from the post's wording by simple
  rules. `company` is the text before the first `|` on the first line, which is the thread's convention; posts that
  ignore the convention have `company: null`.
- Deleted and dead items are skipped.

### Pricing

Pay per result: **$0.0003 per story, comment or hiring post** ($0.30 per 1,000).

# Actor input Schema

## `feeds` (type: `array`):

Any of: top, new, best, ask, show, jobs. Returns the stories on each list in rank order.

## `maxItemsPerFeed` (type: `integer`):

Upper limit of stories returned for each list (Hacker News lists hold up to 500; Ask, Show and jobs up to 200).

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

Keywords to search Hacker News for (HN Search by Algolia). Use "quotes" for an exact phrase. Leave empty to skip search.

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

What search returns.

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

Newest first pages back as far as the limit; most popular returns up to 1,000 results per query.

## `since` (type: `string`):

Only search results posted on or after this date (YYYY-MM-DD).

## `until` (type: `string`):

Only search results posted before this date (YYYY-MM-DD).

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

Only stories with at least this many points (search only).

## `maxItemsPerSearch` (type: `integer`):

Upper limit of stories or comments returned for each search query.

## `stories` (type: `array`):

Hacker News item IDs or links (https://news.ycombinator.com/item?id=...). Returns each story and its comment thread.

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

Also return the comment thread of every story found by a list or a search. Stories given under "Stories" always include their comments.

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

Upper limit of comments returned for each story, in thread order.

## `whoIsHiringMonths` (type: `integer`):

How many of the latest monthly "Ask HN: Who is hiring?" threads to return as job posts (0 = none, 1 = the current month).

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

Only job posts that contain every one of these words, e.g. "remote", "rust". Leave empty for all posts.

## Actor input object example

```json
{
  "feeds": [
    "top"
  ],
  "maxItemsPerFeed": 30,
  "searchQueries": [
    "apify"
  ],
  "searchType": "story",
  "sortBy": "date",
  "maxItemsPerSearch": 100,
  "includeComments": false,
  "maxCommentsPerStory": 200,
  "whoIsHiringMonths": 0
}
```

# Actor output Schema

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

One item per story (type "story"), comment ("comment") or Who is hiring post ("hiring"): title, URL, text, author, points, comment count, dates, HN link.

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

How many items each list, search, story or hiring thread returned, and any errors.

# 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 = {
    "feeds": [
        "top"
    ],
    "searchQueries": [
        "apify"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("lx112/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 = {
    "feeds": ["top"],
    "searchQueries": ["apify"],
}

# Run the Actor and wait for it to finish
run = client.actor("lx112/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 '{
  "feeds": [
    "top"
  ],
  "searchQueries": [
    "apify"
  ]
}' |
apify call lx112/hacker-news-scraper --silent --output-dataset

```

## MCP server setup

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