# Hacker News Scraper - Stories, Comments, Who is Hiring (`extas_corp/hackernews-scraper`) Actor

Scrape Hacker News stories, comments, keyword search, jobs, user profiles and monthly Who is hiring threads through the official Firebase and Algolia APIs. No login. Pay per result.

- **URL**: https://apify.com/extas_corp/hackernews-scraper.md
- **Developed by:** [Extas Corp](https://apify.com/extas_corp) (community)
- **Categories:** News, Developer tools, Lead generation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.30 / 1,000 results

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, Who is Hiring

Collect **Hacker News data** through the two official free APIs (HN Firebase API and Algolia HN Search). No login, no cookies, no browser, no proxies. Clean flat JSON.

- **Story lists**: front page, top, new, best, Ask HN, Show HN, jobs
- **Search** stories and/or comments by keyword, with date range, minimum points / comments, sort by relevance or newest
- **Full comment trees** for story IDs or `news.ycombinator.com/item?id=...` URLs (flattened, with `parent_id` and `story_id`)
- **User profiles** (karma, about, created) and their stories and comments
- **Who is hiring**: every posting of the monthly thread (also "Who wants to be hired?" and "Freelancer?"), any month
- `maxItems` per entry, automatic retries with backoff
- **$0.30 per 1,000 results.** Failed lookups are never charged.

### How to use

1. Pick **What to collect**.
2. Fill the matching field: *List* (lists), *Search keywords* (search), *Story IDs or URLs* (thread), *Usernames* (user), or just a month (hiring).
3. Set **Max results per entry** and click **Start**. Export as JSON, CSV or Excel, or use the API.

### Input examples

```json
{ "mode": "list", "lists": ["front", "show"], "maxItems": 30 }
```

```json
{ "mode": "search", "queries": ["web scraping"], "searchIn": "both", "sort": "date", "since": "2026-01-01", "minPoints": 10, "maxItems": 500 }
```

```json
{ "mode": "thread", "storyIds": ["8863", "https://news.ycombinator.com/item?id=39667625"], "maxItems": 1000 }
```

```json
{ "mode": "user", "usernames": ["pg"], "maxItems": 100 }
```

```json
{ "mode": "hiring", "hiringMonth": "2026-10", "maxItems": 1000 }
```

### Output

Every item: `type` (`story`, `comment`, `job`, `poll`, `user` or `error`), `id`, `title`, `url`, `domain`, `author`, `points`, `num_comments`, `created_at` (ISO 8601), `text` (plain text, HTML removed), `parent_id`, `story_id`, `hn_url`, `source` (the list / keyword / ID that produced it).

Users add `karma` and `submitted_count`. In *hiring* mode each item is one posting and `num_comments` counts the replies to it. Items with `type: error` are free.

### Notes

- *Top* returns up to 500 stories, *front page* about 30 (the real front page).
- Relevance search is capped by Algolia at 1,000 hits per keyword; use "Newest first" to go further back.
- Comment items found by search carry the parent story's `title` and `url`.

### Pricing

| Event | Price |
| --- | --- |
| Result (story, comment, posting or profile) | $0.0003 |

Data comes from public APIs. Please respect applicable privacy law when using personal data.

### More tools

Need to turn PDFs, Word, Excel or images into Markdown for LLMs and RAG? See the [Document to Markdown API](https://rapidapi.com/ExtasCorporation/api/document-to-markdown) on RapidAPI and the free browser tools at [hackthehydra.com](https://hackthehydra.com).

### Example output

```json
{
  "type": "comment",
  "id": 50338732,
  "author": "AdriaanvRossum",
  "num_comments": 4,
  "created_at": "2026-11-02T16:01:43.000Z",
  "text": "Simple Analytics | DevOps Engineer | REMOTE ...",
  "source": "hiring 2026-11"
}
```

### Use cases

- **Research**: pull all discussion of a technology or company, filtered by points and date.
- **Recruiting and SEO**: parse every posting of the monthly Who is hiring thread.
- **LLM datasets**: export comment trees for summarisation.

### Integrations

Python (Apify client):

```python
from apify_client import ApifyClient

client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("extas_corp/hackernews-scraper").call(run_input={"mode": "list", "list": "top", "maxItems": 20})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["type"], item.get("title"))
```

**Make, Zapier, n8n**: add the Apify app, choose *Run Actor* (or *Run Actor and get dataset items*), set the Actor to `extas_corp/hackernews-scraper` and map the JSON input. The same Actor can be started on a schedule from Apify itself, with a webhook to your own endpoint when the run finishes.

### FAQ

**Where does the data come from?** The official HN Firebase API and Algolia HN Search. No scraping of the website.

**Do I need to pay to try it?** New Apify accounts include free monthly platform credit (about $5 on the free plan at the time of writing), so you can run the example input above and many more items before paying anything. You only pay the per-event price listed under Pricing; runs that return nothing or fail are not charged for the failed items.

# Actor input Schema

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

Story lists (front page, top, new...), keyword search, a story's full comment tree, user profiles with submissions, or the monthly 'Who is hiring' thread.

## `list` (type: `string`):

Mode 'list'. 'Front page' is the real front page (about 30 stories); 'Top' is the top 500.

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

Mode 'list'. Overrides 'List': any of front, top, new, best, ask, show, jobs. Each gets its own max results.

## `queries` (type: `array`):

Mode 'search'. One search per entry. Leave empty to match only on the filters below.

## `searchIn` (type: `string`):

Mode 'search'. Stories, comments, or both.

## `sort` (type: `string`):

Mode 'search'. Relevance returns at most 1,000 hits per keyword; newest first can go further back.

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

Mode 'search'. Only items created on or after this date, e.g. 2026-01-31 or 2026-01-31T00:00:00Z.

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

Mode 'search'. Only items created before this date.

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

Mode 'search'. Only items with at least this many points.

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

Mode 'search'. Only stories with at least this many comments.

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

Mode 'thread'. Item IDs or news.ycombinator.com/item?id=... URLs. Returns the story and all its comments, flattened.

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

Mode 'user'. HN usernames, e.g. pg.

## `includeSubmissions` (type: `boolean`):

Mode 'user'. Also return the user's stories and comments, newest first.

## `hiringThread` (type: `string`):

Mode 'hiring'. Which monthly thread by 'whoishiring'.

## `hiringMonth` (type: `string`):

Mode 'hiring'. Month like 2026-11. Empty = the latest thread.

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

Maximum results for each list / keyword / story / user / thread. You are charged per result.

## Actor input object example

```json
{
  "mode": "list",
  "list": "top",
  "searchIn": "story",
  "sort": "relevance",
  "includeSubmissions": true,
  "hiringThread": "hiring",
  "maxItems": 20
}
```

# Actor output Schema

## `results` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("extas_corp/hackernews-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("extas_corp/hackernews-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 '{}' |
apify call extas_corp/hackernews-scraper --silent --output-dataset

```

## MCP server setup

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