# Hacker News Search & Mention Monitor (Stories, Comments) (`squarish_altruism/hn-monitor`) Actor

Search Hacker News stories, comments, Ask HN, Show HN and jobs by keyword, site or author, with filters for points, comments and date. Schedule it to get only new mentions of your product, competitors or topics. Uses the official HN Search API.

- **URL**: https://apify.com/squarish_altruism/hn-monitor.md
- **Developed by:** [John Joseph Wheatley](https://apify.com/squarish_altruism) (community)
- **Categories:** News, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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 Search & Mention Monitor (Stories, Comments)

> **At a glance:** search Hacker News and track new mentions of any keyword. **You get** clean rows of stories and comments. **Cost:** $0.001 per item, and items already seen are free.

Search **Hacker News** stories, comments, Ask HN, Show HN and job posts, and get the results as clean structured data. Put it on a schedule and it returns **only the new mentions** of your product, your competitors or the topics you follow.

It uses the **official Hacker News Search API**, so there is no scraping of pages, no login and no proxy.

### What you can do with it

- **Track mentions:** find every story and comment that names your product, company or domain.
- **Follow a topic:** get new stories about a technology, filtered by points so you only see what got traction.
- **See who links to a site:** list every submission of pages from a domain.
- **Collect discussions:** pull a story together with its top comments for analysis or summarising.
- **Watch the front page, Show HN, Ask HN or job posts.**

### Input

```json
{
  "queries": ["apify", "\"web scraping\""],
  "type": "stories",
  "sort": "date",
  "daysBack": 7,
  "minPoints": 10,
  "includeComments": true,
  "maxCommentsPerStory": 10,
  "onlyNew": true,
  "monitorName": "brand-mentions"
}
```

- **Search words:** one search per line. Put a phrase in double quotes to match it exactly. Leave empty to get the latest items of the chosen type.
- **What to return:** stories, comments, Ask HN, Show HN, jobs, polls, or what is on the front page now.
- **Order:** newest first (best for monitoring) or most relevant.
- **Filters:** last N days, minimum points, minimum comments, a single author, or only stories that link to a given site.
- **Include each story's comments:** adds the top comments, in Hacker News order, with their depth in the thread.
- **Only items not returned before:** for scheduled runs. The Actor remembers what it has already returned under the *Monitor name* and skips it next time.

### Output

A story:

```json
{
  "id": "50486258",
  "type": "story",
  "title": "Example launch post",
  "url": "https://example.com/blog/launch",
  "domain": "example.com",
  "author": "someone",
  "points": 96,
  "numComments": 15,
  "createdAt": "2026-11-13T16:55:59Z",
  "text": null,
  "onFrontPage": false,
  "hnUrl": "https://news.ycombinator.com/item?id=50486258",
  "matchedQuery": "example",
  "comments": [
    { "id": "50487345", "author": "reader", "createdAt": "2026-11-13T17:20:11Z", "depth": 1, "text": "Plain-text comment…" }
  ]
}
```

A comment (when *What to return* is Comments):

```json
{
  "id": "50500156",
  "type": "comment",
  "author": "reader",
  "createdAt": "2026-11-14T19:50:01Z",
  "text": "Plain-text comment…",
  "storyId": "50496811",
  "storyTitle": "Title of the discussion",
  "storyUrl": "https://example.com/article",
  "storyHnUrl": "https://news.ycombinator.com/item?id=50496811",
  "parentId": "50499471",
  "hnUrl": "https://news.ycombinator.com/item?id=50500156",
  "matchedQuery": "\"web scraping\""
}
```

Text is converted from Hacker News's HTML to plain text, with links kept as URLs. A summary per search is saved as `OUTPUT` in the key-value store.

### Pricing

- **$0.001 per item returned** ($1 per 1,000 stories, comments or jobs). Comments included inside a story are not charged separately.
- **$0.0002 per run.** An hourly schedule adds about $0.15 a month.
- With *Only items not returned before*, items you already received are **free**.
- Searches that return nothing cost only the per-run charge.

### Getting alerts

1. Turn on **Only items not returned before** and give the monitor a name.
2. Create a **schedule** in Apify Console (for example every hour).
3. Add an **integration** (Slack, email, webhook, Zapier, Make, n8n) that runs when the Actor succeeds, and pass it the dataset.

### Use with AI agents (MCP)

This Actor works as a tool for AI assistants such as Claude, ChatGPT and Cursor, through [Apify's MCP server](https://mcp.apify.com).

1. Add the server to your MCP client, with this Actor selected:

```json
{
  "mcpServers": {
    "apify": { "url": "https://mcp.apify.com?tools=squarish_altruism/hn-monitor" }
  }
}
```

In Claude Code: `claude mcp add apify "https://mcp.apify.com?tools=squarish_altruism/hn-monitor" -t http`

2. Sign in with your Apify account when your client asks. If it can't use OAuth, send your Apify API token in an `Authorization: Bearer` header.
3. Ask in plain language, for example: *"Find Hacker News stories about vector databases from the last 30 days with at least 50 points, and summarise what commenters said."*

Runs started by an agent are billed to your Apify account at the same prices as above.

### Limitations

- **Search matches words, not meaning.** Use several search lines for different spellings of a name.
- **Points and comment counts** are as of the search index's last update, which trails the live site by a few minutes.
- **Deleted and flagged items** may be missing.
- **Comment trees** are returned up to three levels deep and up to the limit you set.

### Feedback

Missing a filter or a field? Open an issue on the Issues tab.

### Related tools

- [Website Change Monitor](https://apify.com/squarish_altruism/page-change-monitor)
- [Career Page Jobs](https://apify.com/squarish_altruism/ats-jobs)
- [Look-Alike Domain Finder](https://apify.com/squarish_altruism/lookalike-domains)

# Actor input Schema

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

One search per line, for example your product name, a competitor or a topic. Put a phrase in double quotes to match it exactly. Leave empty to get the latest items of the chosen type.

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

Stories are link and text posts. Comments searches inside discussions, which is where most mentions of a product happen.

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

Newest first suits monitoring. Most relevant ranks by match quality, points and comments.

## `daysBack` (type: `integer`):

0 means no limit.

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

Skip stories with fewer points. Not used for comments.

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

Skip stories with fewer comments. Not used for comments.

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

For example example.com. Finds every submission of a site's pages. When set, the search words are not used.

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

A Hacker News username.

## `maxResultsPerQuery` (type: `integer`):

Upper limit for each search line.

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

Adds the top comments of every story returned. Makes one extra request per story.

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

Used when comments are included.

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

For scheduled runs: return only stories or comments that earlier runs of this monitor have not returned. Items already seen are free.

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

Used with "Only items not returned before". Runs with the same name share their memory of what was already returned.

## Actor input object example

```json
{
  "queries": [
    "web scraping"
  ],
  "type": "stories",
  "sort": "date",
  "daysBack": 0,
  "minPoints": 0,
  "minComments": 0,
  "maxResultsPerQuery": 100,
  "includeComments": false,
  "maxCommentsPerStory": 20,
  "onlyNew": false,
  "monitorName": "default"
}
```

# Actor output Schema

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

One item per story, comment or job.

# 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": [
        "web scraping"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("squarish_altruism/hn-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": ["web scraping"] }

# Run the Actor and wait for it to finish
run = client.actor("squarish_altruism/hn-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": [
    "web scraping"
  ]
}' |
apify call squarish_altruism/hn-monitor --silent --output-dataset

```

## MCP server setup

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