# Hacker News Scraper: Stories, Search & Comment Analysis (`physealabs/hackernews-intelligence-scraper`) Actor

Scrape Hacker News top, new, best, Ask, Show and job stories, or search all of HN history. Each story comes with its comment thread analyzed: top commenters, key terms, most-replied comments. No login, no API key. Built by Physea Labs · Liminal.

- **URL**: https://apify.com/physealabs/hackernews-intelligence-scraper.md
- **Developed by:** [jay casey](https://apify.com/physealabs) (community)
- **Categories:** Social media, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 story 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, Search & Comment Analysis

Get the Hacker News front page, any HN list, or a search across all of HN history, with every story's comment thread already read and summarized: who is talking, which terms keep coming up, and which comments drew the most replies.

> **Launch Sale: 90% OFF for the first week!** Every price below is cut by 90% during launch week, and you still pay only for results that come back.

### Quick start

Press **Start**. The sample pulls the current top 10 front-page stories and reads up to 50 comments on each. It finishes in about 10 seconds. Switch *What to scrape* to *Search all of HN* and type a topic to track it.

### What you get

- One row per story: rank, title, link, domain, author, points, comment count, posted time, type (story, Ask HN, Show HN, job)
- Thread analysis on every story: comments read, unique commenters, deepest reply level, top 5 commenters, top 10 terms, the 5 most-replied top-level comments with links
- Optional: every comment as its own row (author, text, depth, reply count, parent, link)
- Search mode: Algolia full-text search over all HN stories or comments, by relevance or newest first, with point and date filters
- A `RUN_SUMMARY.json` record with counts and any skipped items

### Good for

- Tracking mentions of your product, competitors or a technology on HN
- Daily front-page digests for a newsletter or Slack
- Launch-day monitoring of your Show HN post and its discussion
- Building datasets of developer opinion for research or LLM evaluation

### Pricing

**Launch Sale: 90% OFF for the first week!**

- $0.002 per story (thread analysis included) — $2 per 1,000
- $0.0003 per comment row, only if you turn comment rows on
- The sample run (10 stories) costs $0.02

You pay only for results that come back. Status rows (not found, errors, skipped) are free. Set a max cost per run in
the run options and the run stops cleanly when it hits it. Normal Apify platform usage applies.

### Input

| Field | What it does |
|---|---|
| `mode` | Pick a live Hacker News list, or 'search' to query all of HN history through Algolia. |
| `searchQuery` | Used when 'What to scrape' is 'search'. Example: LLM agents, Rust, Series A, your brand name. |
| `maxItems` | How many stories to return. |
| `analyzeComments` | Read each story's full thread and add top commenters, key terms and the most-replied comments. Included in the story price. |
| `maxCommentsPerStory` | Comments are read top-down (most visible first). |
| `outputCommentRows` | Adds one dataset row per comment (charged per comment). Leave off if the per-story analysis is enough. |
| `minPoints` | Skip stories below this score. 0 keeps everything. |
| `sinceDays` | Keep stories posted in the last N days. 0 means no date limit. |
| `searchTags` | What kind of item the search matches (search mode only). |
| `sortBy` | Relevance (Algolia ranking, favours popular items) or newest first. |

### Output

Results go to the default dataset (table view in the Console, or JSON/CSV/Excel export).
A `RUN_SUMMARY.json` record in the key-value store has counts, failures and the prices used.

### Limits

- Uses the official Hacker News Firebase API and Algolia HN Search. Both are public; no login needed.
- Algolia returns at most 1,000 hits per search. Narrow by date for more.
- Deleted and dead items are skipped. Scores and comment counts are as of the run.
- All collection is done by this actor directly against public sources. It never calls other paid actors.

### Run it from code

Same input as the Console sample:

```json
{
  "mode": "top",
  "searchQuery": "AI agents",
  "maxItems": 10,
  "maxCommentsPerStory": 50
}
```

```sh
curl -X POST "https://api.apify.com/v2/acts/physealabs~hackernews-intelligence-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" -d @input.json
```

```python
from apify_client import ApifyClient
items = ApifyClient("YOUR_APIFY_TOKEN").actor("physealabs/hackernews-intelligence-scraper").call(run_input={"mode": "top", "searchQuery": "AI agents", "maxItems": 10, "maxCommentsPerStory": 50})
```

It also works from Zapier, Make, n8n and Apify schedules.

### About

Built by **Physea Labs · Liminal**, the team behind Liminal, a router that turns hard questions into grounded, checkable answers.
Questions or a source you want added? Open an issue on the actor page.

# Actor input Schema

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

Pick a live Hacker News list, or 'search' to query all of HN history through Algolia.

## `searchQuery` (type: `string`):

Used when 'What to scrape' is 'search'. Example: LLM agents, Rust, Series A, your brand name.

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

How many stories to return.

## `analyzeComments` (type: `boolean`):

Read each story's full thread and add top commenters, key terms and the most-replied comments. Included in the story price.

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

Comments are read top-down (most visible first).

## `outputCommentRows` (type: `boolean`):

Adds one dataset row per comment (charged per comment). Leave off if the per-story analysis is enough.

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

Skip stories below this score. 0 keeps everything.

## `sinceDays` (type: `integer`):

Keep stories posted in the last N days. 0 means no date limit.

## `searchTags` (type: `string`):

What kind of item the search matches (search mode only).

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

Relevance (Algolia ranking, favours popular items) or newest first.

## Actor input object example

```json
{
  "mode": "top",
  "searchQuery": "AI agents",
  "maxItems": 10,
  "analyzeComments": true,
  "maxCommentsPerStory": 50,
  "outputCommentRows": false,
  "minPoints": 0,
  "sinceDays": 0,
  "searchTags": "story",
  "sortBy": "relevance"
}
```

# Actor output Schema

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

One row per story with points, comment count and thread analysis. Optional comment rows.

## `summary` (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": "top",
    "searchQuery": "AI agents",
    "maxItems": 10,
    "maxCommentsPerStory": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("physealabs/hackernews-intelligence-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": "top",
    "searchQuery": "AI agents",
    "maxItems": 10,
    "maxCommentsPerStory": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("physealabs/hackernews-intelligence-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": "top",
  "searchQuery": "AI agents",
  "maxItems": 10,
  "maxCommentsPerStory": 50
}' |
apify call physealabs/hackernews-intelligence-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,physealabs/hackernews-intelligence-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/r93VrnyDKThmMbasG/builds/0LleMlXLVRhO7QmE8/openapi.json
