# Hacker News Scraper: Stories, Comments, Search & Users (`inimi/hacker-news-scraper`) Actor

Scrape Hacker News: keyword search (no 1,000 result cap), front page and top/new/best/Ask/Show/job lists, full comment threads (e.g. Who is hiring), and user profiles with their posts. Points, comments, authors, dates, URLs.

- **URL**: https://apify.com/inimi/hacker-news-scraper.md
- **Developed by:** [Inimi](https://apify.com/inimi) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 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

## Hacker News Scraper: Stories, Comments, Search & Users

Scrape **Hacker News** fast through its official open APIs: search stories and comments by keyword, pull the front page and the top, new, best, Ask HN, Show HN and job lists, download full comment threads, and get user profiles with everything they posted.

No login, no API key and no browser: the Actor reads the data directly, which makes it **fast and cheap**. Proxies are included in the price.

### What can you use it for?

- **Hiring & lead generation**: turn the monthly "Who is hiring?" thread into rows of job posts.
- **Brand & topic monitoring**: track every mention of your product, competitors or keywords.
- **Trend research**: see which domains, launches and topics get the most points.
- **Launch analysis**: study Show HN posts and their comments.
- **AI datasets**: collect high-quality technical discussions.

### Features

| | |
|---|---|
| Inputs | Keyword searches, front page / top / new / best / Ask / Show / job lists, story URLs, usernames |
| Per story | ID, type (story, Ask HN, Show HN, job, poll), title, URL, domain, author, points, comment count, date, text, HN link, rank |
| Per comment | ID, story ID and title, parent ID, depth in the thread, author, text, date, link |
| Per user | Karma, about, created date, submission count |
| Filters | Min points, only newer than a date, stories / comments / Show HN / Ask HN / jobs |
| No result cap | Date-sorted searches page past the 1,000 hit limit of HN search |

### How to use

1. Fill in the input (the form explains every field).
2. Click **Start**.
3. Download the results as JSON, CSV or Excel, or use them through the API, webhooks, Zapier, Make or n8n.

### Input example

```json
{
    "searchQueries": [
        "apify",
        "web scraping"
    ],
    "searchType": "all",
    "onlyNewerThan": "2026-01-01",
    "storyUrls": [
        "https://news.ycombinator.com/item?id=1"
    ],
    "maxItemsPerSource": 0
}
```

### Output example

```json
{
    "type": "story",
    "id": 50298884,
    "storyType": "ask_hn",
    "title": "\"Decentralization\" doesn't look decentralized",
    "url": null,
    "domain": null,
    "author": "DeveloperOne",
    "points": 1,
    "numComments": 0,
    "createdAt": "2026-10-30T01:45:53Z",
    "text": "Billions in assets frozen within minutes, or at most a few hours.\n\nSo, what’s the difference between having a bank account where your funds can be frozen and...",
    "hnUrl": "https://news.ycombinator.com/item?id=50298884",
    "source": "search: rust",
    "rank": 1,
    "status": "ok"
}
```

Inputs that cannot be scraped (wrong URL, not found, blocked) get a free row with `status` and `error`, so you always know what happened. A run summary is saved to the key-value store as `SUMMARY`.

### Pricing

You pay **per item** saved. Proxies and compute are included. Set a maximum cost per run and the Actor stops cleanly when it is reached.

### FAQ

**Do I need proxies?**
No. The Actor uses the open Hacker News APIs, so it is fast and cheap. Proxies are off by default.

**How do I scrape "Who is hiring?"**
Paste the thread URL into Story URLs and set Max comments per story to 0. Each top-level comment (depth 0) is one job post.

**How far back can I search?**
All the way to 2006.

**Can I call it from code or an AI agent?**
Yes, via the Apify API, the official JS/Python clients, or Apify's MCP server.

# Actor input Schema

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

Keywords to search for, one per line.

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

Optional: top, new, best, ask, show, job. Current stories from those Hacker News pages.

## `storyUrls` (type: `array`):

Hacker News item URLs or IDs. Saves the story and its full comment thread, e.g. the monthly "Who is hiring?" post.

## `users` (type: `array`):

Usernames or profile URLs. Saves the profile and the user's stories and comments.

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

What the search queries look for.

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

Newest first goes past the 1,000 result limit of the HN search.

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

Only stories with at least this many points. 0 = no filter.

## `onlyNewerThan` (type: `string`):

Optional date, e.g. 2026-01-01.

## `maxItemsPerSource` (type: `integer`):

Per search query, list or user. 0 = no limit.

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

Also save the comment thread of every story from searches and lists.

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

0 = all comments.

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

How many items to process at the same time.

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

Not needed: Hacker News APIs are open. Turn on only if you see errors.

## Actor input object example

```json
{
  "searchQueries": [
    "open source"
  ],
  "searchType": "story",
  "sortBy": "date",
  "minPoints": 0,
  "maxItemsPerSource": 100,
  "includeComments": false,
  "maxCommentsPerStory": 200,
  "maxConcurrency": 10,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

No description

## `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 = {
    "searchQueries": [
        "open source"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("inimi/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 = {
    "searchQueries": ["open source"],
    "proxyConfiguration": { "useApifyProxy": False },
}

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

```

## MCP server setup

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