# Hacker News Scraper: Mentions, Show HN, Ask HN & Jobs (`informed_almandine_vzb/hacker-news-search`) Actor

Track every mention of your brand, competitor, or keyword on Hacker News, filtered by date, type (story, comment, job), Show HN, and Ask HN, using the official HN Search API. A test query returned 200 stories.

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

## Pricing

$1.00 / 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, Show HN, Jobs

Search and monitor Hacker News stories, comments, Show HN, Ask HN, and jobs by keyword, points, and date. Official Algolia API, only-new mode for alerts.

### What it does

Queries the official HN Search API (hn.algolia.com) with keyword, type, points, comment and date filters. Export clean, deduplicated data as **JSON, CSV, Excel, XML, or RSS**, or connect directly via the **Apify REST API, Python/JavaScript SDKs, CLI, MCP Server, n8n, Make, or Zapier** — with **no login, cookies, or browser overhead**.

### Use cases

- **Developer Brand & Competitor Monitoring:** Track every Hacker News story and comment mentioning your product, competitors, or category keywords with `onlyNew: true`.
- **Show HN & Startup Scouting:** Filter `type: "show_hn"` with `minPoints` to discover high-traction developer tools and AI launches.
- **Developer Sentiment & Market Research:** Extract plain-text HN comments (`type: "comment"`) to analyze engineering pain points and tool comparisons.
- **YC Hiring & Job Tracking:** Pull `type: "job"` postings directly from Hacker News in structured JSON/CSV.

### Why use this scraper?

| Feature | This Actor | Generic Browser / HTML Scrapers |
|---|---|---|
| **Architecture** | Direct structured API / JSON / feed requests (`curl_cffi`) | Heavy headless browser automation |
| **Speed & reliability** | **2–25 seconds** for 50–200 items | Minutes of high compute burn |
| **Pricing model** | **Pay per result (`$0.00` actor-start fee)** | Monthly rental or high CU overhead |
| **Error handling** | Failed inputs logged in `ERRORS` key-value record and **never charged** | Bills compute time even on failures |

### Input parameters

- **Search queries** (`queries`, `array`): Keywords or brand names to monitor. Leave empty for the latest items of the chosen type.
- **Item type** (`type`, `string`): Which Hacker News items to return.
- **Min points** (`minPoints`, `integer`): Optional. Only items with at least this many points.
- **Min comments** (`minComments`, `integer`): Optional. Only stories with at least this many comments.
- **From date (YYYY-MM-DD)** (`dateFrom`, `string`): Optional. Only items created on or after this UTC date.
- **To date (YYYY-MM-DD)** (`dateTo`, `string`): Optional. Only items created before this UTC date.
- **Newest first** (`sortByDate`, `boolean`): On: newest first. Off: most relevant first.
- **Max items** (`maxItems`, `integer`): Stop after this many items (charged per item).
- **Only new items** (`onlyNew`, `boolean`): On scheduled runs, return only items not seen before. Ideal for brand monitoring.
- **Delay between requests** (`delaySeconds`, `number`): Polite pause between requests (default `0.5`).

#### Example input

```json
{
  "queries": [
    "apify"
  ],
  "type": "story",
  "maxItems": 200
}
```

### Output & example output

One dataset row per result. Default table view columns: `type, title, author, points, comments, createdAt, url, hnUrl`. Full structured JSON is stored in the run's default dataset.

#### Example output item

```json
{
  "id": "50152015",
  "type": "story",
  "title": "Doom Running on a Bedside Monitor",
  "url": "https://twitter.com/akifyanbak/status/2111853169105903678",
  "hnUrl": "https://news.ycombinator.com/item?id=50152015",
  "author": "karim79",
  "points": 1,
  "comments": 0,
  "createdAt": "2026-10-19T13:10:48Z",
  "text": null,
  "storyId": 50152015,
  "parentId": null,
  "isShowHN": false,
  "isAskHN": false,
  "query": "apify",
  "scrapedAt": "2026-10-25T04:23:49+00:00"
}
```

### Pricing (Pay-Per-Result)

This Actor uses transparent **Pay-Per-Event** pricing with a **`$0.00` actor-start fee**:

| Event | What is charged | Price |
|---|---|---|
| `item-result` | Item scraped (One Hacker News story, comment or job) | **$0.001 / result** (**$1.00 / 1,000 results**) |
| `apify-actor-start` | Actor start fee | **$0.00** |

#### Concrete pricing math

- **`item-result` (Item scraped):** `1,000 results = $1.00` (`50 results = $0.05`, `10,000 results = $10.00`). Apify's **$5.00/month Free Tier** covers up to **5,000 results/month** at **$0.00** out-of-pocket.
- **Empty runs (`0` results) & skipped duplicates (`onlyNew` / `onlyChanged`):** **$0.00**.

### Data and compliance

Official public API. Usernames are HN's public handles. Requests are rate-limited and routed through Apify Proxy. Per-input errors are recorded in the run's `ERRORS` key-value record and are never charged.

### FAQ

**Do I need an account, login, or API key?**\
No. This Actor queries public endpoints directly and requires zero credentials.

**What happens if I start a run with empty `{}` input via API or CLI?**\
Every required input defines both `prefill` and `default` values in `.actor/input_schema.json`, so an empty `{}` run automatically returns **50+ live records** out of the box.

# Actor input Schema

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

Keywords or brand names to monitor. Leave empty for the latest items of the chosen type.

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

Which Hacker News items to return.

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

Optional. Only items with at least this many points.

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

Optional. Only stories with at least this many comments.

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

Optional. Only items created on or after this UTC date.

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

Optional. Only items created before this UTC date.

## `sortByDate` (type: `boolean`):

On: newest first. Off: most relevant first.

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

Stop after this many items (charged per item).

## `onlyNew` (type: `boolean`):

On scheduled runs, return only items not seen before. Ideal for brand monitoring.

## `delaySeconds` (type: `number`):

Polite pause between requests.

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

Apify Proxy settings.

## Actor input object example

```json
{
  "queries": [
    "apify"
  ],
  "type": "story",
  "sortByDate": true,
  "maxItems": 200,
  "onlyNew": false,
  "delaySeconds": 0.5,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

## `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 = {
    "queries": [
        "apify"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("informed_almandine_vzb/hacker-news-search").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 = { "queries": ["apify"] }

# Run the Actor and wait for it to finish
run = client.actor("informed_almandine_vzb/hacker-news-search").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 '{
  "queries": [
    "apify"
  ]
}' |
apify call informed_almandine_vzb/hacker-news-search --silent --output-dataset

```

## MCP server setup

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

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/4loScjSDo02UjjU5u/builds/CAvGhpcw8sSKA9B71/openapi.json
