# Hacker News Scraper — Stories, Comments & Search (`highbrow_fame/hacker-news-stories`) Actor

Hacker News stories from the front page, new, best, Ask HN, Show HN and jobs, or from a search over all of HN: title, link, points, comments, date, and the comment threads.

- **URL**: https://apify.com/highbrow\_fame/hacker-news-stories.md
- **Developed by:** [yestrue](https://apify.com/highbrow_fame) (community)
- **Categories:** News, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.30 / 1,000 story delivereds

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 & Search

Get Hacker News stories — from the front page, New, Best, Ask HN, Show HN and Jobs, or from a search over all of Hacker News — with title, link, points, comment count, date and kind, and, if you want, their comment threads.

**Why this one**

- 📋 **Every list, in site order.** The front page (up to 500 stories), New, Best, Ask HN, Show HN and Jobs, each story with its position.
- 🔎 **Search past the 1,000 limit.** Hacker News search stops at 1,000 results per query. Set dates and the Actor reads the period week by week: a live test run returned 1,500 "rust" stories from July to September.
- 💬 **Comment threads.** Every story's comments in reading order, with depth and parent, as plain text.
- ⚡ **Fast and light.** 2,187 stories — 1,162 of them with comments — in under four minutes, using Hacker News' own public APIs.
- 🔒 **No usernames.** Stories and comments are delivered without their authors' handles.

### What you get

For every story:

| Field | What it is |
|---|---|
| `title`, `url`, `domain` | the story and where it links |
| `points`, `commentCount` | score and discussion size |
| `createdAt` | when it was posted, ISO 8601 |
| `kind` | story, ask, show, launch, job or poll |
| `text` | the text of Ask HN / Show HN posts |
| `hnUrl`, `storyId` | the discussion on Hacker News |
| `comments` | with **Comments** on: `commentId`, `parentId`, `depth`, `createdAt`, `text` |
| `input`, `source`, `position`, `scrapedAt`, `status`, `error` | which list or search it came from, and its place there |

#### Example

A real record from a live run — the front page, 24 September 2026 (two comments shown, shortened):

```json
{
  "source": "top",
  "position": 1,
  "title": "F-Droid 2.0: A New Chapter for Android Freedom",
  "url": "https://f-droid.org/2026/09/24/f-droid-2.0-a-new-chapter-for-android-freedom.html",
  "domain": "f-droid.org",
  "points": 127,
  "commentCount": 36,
  "createdAt": "2026-09-24T15:26:12.000Z",
  "kind": "story",
  "hnUrl": "https://news.ycombinator.com/item?id=49831968",
  "comments": [
    { "commentId": 49832234, "parentId": 49831968, "depth": 0, "createdAt": "2026-09-24T15:40:10.000Z", "text": "This is very good to see. Classic F-Droid always seemed to fail at updating repos at least…" },
    { "commentId": 49832418, "parentId": 49832234, "depth": 1, "createdAt": "2026-09-24T15:51:04.000Z", "text": "Repo timestamp expected blah blah... toast coming out of nowhere is such a bad design. Rea…" }
  ],
  "status": "OK"
}
```

### How to use it

1. Pick **Lists** and/or add **Search queries**.
2. For searches, choose the **Search order** and optionally a date range.
3. Set **Max stories per list or query**, and switch on **Comments** if you need them.
4. Press **Start**, and download the results from the **Output** tab as JSON, CSV or Excel.

To follow what Hacker News says about your product or your field, save a search as a task and schedule it daily.

You can also call it from the Apify API, from Make, Zapier or n8n, or from an AI agent through the Apify MCP server.

### Pricing

You are charged **per story delivered** — see the price on this page. Comments come with their story at no extra charge.

### FAQ

**Why no usernames?** Handles identify people. Most uses — trend tracking, sentiment, product mentions — do not need them.

**Is this affiliated with Hacker News or Y Combinator?** No. This is an independent tool that uses Hacker News' public APIs (the official Firebase API and the Algolia search API).

**Like it?** A short review on the Store page helps other people find this Actor. Something missing or broken? Tell us on the Issues tab — we read every one.

# Actor input Schema

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

Hacker News lists to read, in their order on the site.

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

Search all of Hacker News for stories, one query per line (claude code, rust, postgres).

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

Most relevant (points and match) or newest first.

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

Optional, YYYY-MM-DD. With dates set, the period is read week by week, so a search can return more than 1,000 stories.

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

Optional, YYYY-MM-DD.

## `maxStoriesPerSource` (type: `integer`):

The front page list holds up to 500 stories.

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

Add each story's comments, in reading order with their depth (one extra request per story).

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

Stops each story's comments after this many.

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

Used only when a request is turned down: the first try goes out directly.

## Actor input object example

```json
{
  "lists": [
    "top"
  ],
  "searchSort": "relevance",
  "maxStoriesPerSource": 30,
  "includeComments": false,
  "maxCommentsPerStory": 50,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

Every result as a JSON record, with a status for each input.

## `resultsCsv` (type: `string`):

The same records as CSV, for a spreadsheet.

# 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"
    ],
    "maxStoriesPerSource": 30,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("highbrow_fame/hacker-news-stories").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"],
    "maxStoriesPerSource": 30,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("highbrow_fame/hacker-news-stories").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"
  ],
  "maxStoriesPerSource": 30,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call highbrow_fame/hacker-news-stories --silent --output-dataset

```

## MCP server setup

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

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/fcpChe5kErKh3QH0F/builds/EduSeRRSJ17o0ANad/openapi.json
