# Hacker News Scraper: Stories, Comments & Mentions (`hydrocore/hacker-news-search-monitor`) Actor

Search Hacker News stories and comments by keyword, domain or author with the official HN Algolia API. Points, comments, links, clean text, date window, min points, sort before the cap and a new-mentions monitor. One flat row per item.

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

## Pricing

from $0.20 / 1,000 hacker news items

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

Search **Hacker News stories and comments** by keyword, site or author, or list the **front page**, **Show HN**, **Ask HN** and **jobs**. One flat row per item: title, **points**, **comment count**, author, date, HN link and outside link, domain, story context for comments, age, front-page flag and text. Sort by **newest, points or comments** before the limit, filter by date, points and comments, and turn on **monitor mode** to get only new mentions on a schedule. Uses the official public HN search API by Algolia. No login, no API keys.

### ✅ What you get

- Stories, comments or both; Show HN, Ask HN, jobs and the current front page
- Points, comment count, author, ISO date, age in hours
- HN link plus the outside link and its domain
- Story title and ID for comments
- Filters: days, minimum points and comments, domains, authors
- Sort by newest, points, comments or relevance
- Monitor mode for new mentions only

### 🏆 Why this Actor

- **Real top lists:** sorting happens before the limit on up to 1,000 matches per keyword, so "top 25 by points" is really the top 25.
- **Brand monitoring built in:** onlyNew remembers delivered items, so a daily schedule returns only new mentions, and already-seen items are free.
- **Comments with context:** each comment row carries the story title and ID it belongs to.
- **Search by site:** find every story linking to github.com or your own domain, even without keywords.
- **Fair billing:** one charge per saved item; duplicates, filtered items and status rows are free.

### 💡 Use cases

**Apify Store use cases:** Brand monitoring · Monitor news & content · Market research

- Brand and competitor monitoring: get every new HN mention of your product in Slack every morning
- Launch tracking: follow your Show HN post, its points and comment count
- Developer marketing research: find the most discussed stories about a topic this week
- Content and trend research: top stories by points for any keyword
- AI agents: answer "what is Hacker News saying about X?" with sourced rows

### 🚀 How to use

1. Enter **keywords** (one per line) and pick an **item type** (stories by default).
2. Optional: limit by days, points, comments, domain or author, and pick a sort order.
3. Turn on **Only new items** with a monitor name for scheduled runs, then run and open **Overview**, **Mentions & text** or **Links & type**.

### ⚙️ Input

| Field | What it does |
|---|---|
| `queries` | Keywords or phrases, one search each (default example: AI agents). Can be empty when you set domains or authors, or pick Front page now. |
| `itemType` | stories (default), comments, storiesAndComments, showHn, askHn, frontPage, jobs. |
| `domains` | Keep only items linking to these sites. |
| `authors` | Only items by these HN usernames. |
| `postedWithinDays` | Last N days, default 7; 0 = any date. |
| `minPoints / minComments` | Minimum points and comments (stories). |
| `sortBy` | newest (default), points, comments, relevance. |
| `maxResults` | Most items to save, default 50. |
| `maxTextChars` | Cut text after N characters, default 2,000. |
| `onlyNew / monitorKey` | Monitor mode: return only items not delivered before under this name. |

Example input:

```json
{
  "queries": [
    "\"your product\"",
    "yourcompany.com"
  ],
  "itemType": "storiesAndComments",
  "postedWithinDays": 2,
  "onlyNew": true,
  "monitorKey": "brand-mentions"
}
```

### ⬆️ Output

One row per story or comment. Empty results and API errors get a free row with `recordType` = `status` and the reason in `summaryText`. Every row has the same 21 keys in the same order; missing values are `null`. The example is a real row from a test run of the current build.

Overview fields:

| Field | Type | Example | Description |
|---|---|---|---|
| `recordType` | string | "story" | story or comment; status for a source error or an empty result (free; reason in summaryText). |
| `title` | string | "Show HN: atl, a Rust CLI for Jira, Confluence and Bitbucket… | Story title. Null for comments (see storyTitle). |
| `points` | integer | 1 | Story points (upvotes). Null for comments, which have no public points. |
| `commentCount` | integer | 0 | Number of comments on the story. Null for comments. |
| `author` | string | "racetozero" | HN username of the poster. |
| `createdAt` | string | "2026-11-15T19:06:04.000Z" | When the item was posted (ISO 8601 UTC). |
| `url` | string | "https://news.ycombinator.com/item?id=50509662" | Discussion page on news.ycombinator.com. |
| `linkDomain` | string | "github.com" | Domain of linkUrl without www. |
| `matchedQuery` | string | "AI agents" | The keyword (or domain) search that found the item. |

All 21 fields (in order): `recordType`, `title`, `points`, `commentCount`, `author`, `createdAt`, `url`, `linkUrl`, `linkDomain`, `storyType`, `itemId`, `storyId`, `storyTitle`, `parentId`, `ageHours`, `isOnFrontPage`, `text`, `textLength`, `matchedQuery`, `summaryText`, `scrapedAt`.

Real row from a test run of the current build:

```json
{
  "recordType": "story",
  "title": "Show HN: atl, a Rust CLI for Jira, Confluence and Bitbucket with ~15ms overhead",
  "points": 1,
  "commentCount": 0,
  "author": "racetozero",
  "createdAt": "2026-11-15T19:06:04.000Z",
  "url": "https://news.ycombinator.com/item?id=50509662",
  "linkUrl": "https://github.com/racetozero/atlassian-toolkit",
  "linkDomain": "github.com",
  "storyType": "show_hn",
  "itemId": "50509662",
  "storyId": "50509662",
  "storyTitle": "Show HN: atl, a Rust CLI for Jira, Confluence and Bitbucket with ~15ms overhead",
  "parentId": null,
  "ageHours": 2,
  "isOnFrontPage": false,
  "text": "Hello HN,\n\nI built `atl`, a Rust CLI for Jira, Confluence, Bitbucket, Jira Service Management, Trello and Atlassian Admin. The same commands work on Cloud and Data Center (on-prem).\n\nIt's built for both people and AI agents: an --agent mode that outputs JSON and never prompts, a built-in MCP server ",
  "textLength": 542,
  "matchedQuery": "AI agents",
  "summaryText": "\"Show HN: atl, a Rust CLI for Jira, Confluence and Bitbucket with ~15ms overhead\" by racetozero: 1 points, 0 comments, 2026-11-15 19:06 UTC, links to github.com.",
  "scrapedAt": "2026-11-15T21:07:49.617Z"
}
```

Views: **Overview**, **Mentions & text**, **Links & type**, **Detailed (all fields)**. Export as JSON, CSV, Excel, XML or HTML from the Storage tab or the API (`/datasets/{id}/items?format=csv&view=overview`). The run summary (`OUTPUT` record in the key-value store) counts requests, items read, duplicates, filtered, already-seen (monitor), over the cap and saved, plus the item type, sort and date window.

### 💰 Pricing

Competitive pricing, pay per result: **$0.00026 per item** on the Free plan, less on higher plans, plus the $0.0005 Actor start. The default run (50 stories) costs about $0.0135; a daily brand monitor with 5 new mentions costs about $0.054 a month. Duplicates, filtered, already-seen items and status rows are never charged.

| Event | What it is | Free | Bronze | Silver | Gold+ |
|---|---|---|---|---|---|
| Hacker News item | One Hacker News story or comment saved (title or text, points, comments, author, date, links). Duplicates, filtered, already-seen (monitor) items and status rows are free. | $0.00026 | $0.00024 | $0.00022 | $0.0002 |
| Actor start | Once per run (Apify standard start event, per GB of memory; the default 256 MB = one fee) | $0.0005 | $0.0005 | $0.0005 | $0.0005 |

### 🔁 Integrations

Works with the Apify API, MCP (AI agents), Make, n8n, Zapier, Google Sheets and webhooks. Field names are stable camelCase, so mappings do not break between runs.

### ❓ FAQ

**Where does the data come from?**

From the official public Hacker News search API run by Algolia (hn.algolia.com), which indexes every HN story and comment. No login is needed and nothing is scraped from news.ycombinator.com pages.

**How fresh is it?**

New items usually appear within minutes. Points and comment counts are the values at the time of the run.

**Can I search comments?**

Yes. Pick comments or storiesAndComments. Comment rows include storyTitle and storyId so you know where the mention was made.

**How does monitor mode work?**

With Only new items on, the Actor remembers the IDs it delivered under your monitor name and skips them next time, before the limit and without charge. Use a different monitor name for each watch.

**Why do comments have no points?**

Hacker News does not publish comment scores, so points is null for comments.

**Can I find stories that link to my site?**

Yes. Put the domain in Domains. With no keywords, the domain itself is searched in story links, then filtered exactly (subdomains count).

**What does Front page now return?**

The stories on the HN front page at the time of the run, with isOnFrontPage set to true. Keyword, points and comment filters still apply; the date filter is ignored.

**How many items can I get?**

Each keyword reads up to 1,000 matches. Set maxResults for the total you want saved and charged.

**Is it legal to use?**

The Actor reads the public HN search API, which is offered for this purpose, and returns public posts. Follow HN guidelines and privacy law when you use usernames or text.

**Is it good for AI agents and automations?**

Yes. Inputs are small, rows are flat with a summaryText sentence, and monitor mode suits Make, n8n, Zapier and MCP agents on a schedule.

### Ready-made examples

- [Top Hacker News stories about AI agents this week](https://apify.com/hydrocore/hacker-news-search-monitor/examples/top-hacker-news-stories-about-ai-agents-this-week)

### 🛟 Support

Found a problem or need a field? Open an issue on the Issues tab; we read every issue.

### Changelog

- 1.0 (2026-11-15): first release.

# Actor input Schema

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

Words or phrases to search in titles, links and text (one search per line), e.g. your product, a competitor or a topic. Leave empty to list items by domain or author only, or pick Front page now.

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

What to return. Default stories.

## `domains` (type: `array`):

Keep only items that link to these sites, e.g. github.com or yourcompany.com (subdomains count). With no keywords, the domain itself is searched in story links: a quick way to see every HN post about your site.

## `authors` (type: `array`):

Only items posted by these HN usernames (exact, case-sensitive).

## `postedWithinDays` (type: `integer`):

Only items from the last N days. Default 7. 0 = any date. Ignored for Front page now.

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

Only stories with at least this many points (comments have no public points). Default 0.

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

Only stories with at least this many comments. Default 0.

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

Sorting happens before the limit, so "top 25 by points" really is the top 25 of up to 1,000 matches per keyword. Default newest.

## `maxResults` (type: `integer`):

Most items to save (and charge) in one run, across all keywords. Default 50.

## `maxTextChars` (type: `integer`):

Cut story and comment text after this many characters (textLength keeps the full length). Default 2,000. 0 = no text.

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

Remember delivered items under the monitor name and return only new ones next time. Already-seen items are skipped before the limit and never charged. Default false.

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

Name of this watch, e.g. brand-mentions. Use different names for different searches. Default "default".

## Actor input object example

```json
{
  "queries": [
    "AI agents"
  ],
  "itemType": "stories",
  "postedWithinDays": 7,
  "minPoints": 0,
  "minComments": 0,
  "sortBy": "newest",
  "maxResults": 50,
  "maxTextChars": 2000,
  "onlyNew": false
}
```

# Actor output Schema

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

Title, points, comments, author, date and links.

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

What was said: text of comments and posts with the story they belong to.

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

Linked URLs, domains, story type and front-page status.

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

Every field for each row.

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

Run summary: requests, hits returned, matches available, duplicates, filtered, already seen (monitor), over the cap, stories and comments saved, source errors and status rows.

# 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": [
        "AI agents"
    ]
};

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

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

```

## MCP server setup

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

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/o0Ledky6mcydDCeMr/builds/dhjYXj8vgWlUOlEhF/openapi.json
