# Hacker News Search and Mention Monitor (`gubidonius/hn-search`) Actor

Search every Hacker News story and comment, or watch for new mentions of your company on a schedule. Gets past the 1,000 result ceiling by splitting the date range. No key and no login.

- **URL**: https://apify.com/gubidonius/hn-search.md
- **Developed by:** [Gregory Bolshakov](https://apify.com/gubidonius) (community)
- **Categories:** Social media, MCP servers, Agents
- **Stats:** 1 total users, 0 monthly users, 0.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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Hacker News Search and Mention Monitor

Search every Hacker News story and comment, or watch for new mentions of your company and
get only what appeared since last time.

### The 1,000 result ceiling, and how this gets past it

A Hacker News search returns at most 1,000 results. Measured 2026-08-30: `hitsPerPage`
times `nbPages` is always exactly 1000, and asking for page ten at a hundred per page
returns an empty list rather than an error. Anything built on plain paging stops at a
thousand and looks like it finished.

When a window comes back full, this Actor halves the date range and searches both halves,
repeating until the windows fit. The run summary reports `windowsUsed` per query so you can
see when that happened.

### The match count is an estimate, not a count

This one is worth knowing before you build anything on it. The same query returns a
different total depending only on the page size:

```
hitsPerPage=20    6,689
hitsPerPage=50    5,942
hitsPerPage=100   6,455
```

Counting the same query exhaustively year by year gives 6,046, which matches none of them.
It is stable for an identical request, so it looks trustworthy until you change something
unrelated.

The field is called `estimatedMatches` here and carries `matchCountIsApproximate`, and the
Actor never uses it to decide when to stop.

### Watching for mentions

Turn on **Only new since the last run** and each run returns only what was not there
before. The first run on a query records a baseline and returns everything with `isNew`
empty, because nothing is new the first time you look. A query whose request fails keeps
its previous list, so an outage cannot look like a change.

Nothing is ever reported as closed. An item leaving your date window is not an item being
deleted, and pretending otherwise would put false disappearances in your history.

### Output

`title`, `author`, `points`, `comments`, `createdAt`, `url` and `discussionUrl`.

`url` is the submitted link and is null on an Ask HN or a text post, which genuinely have
none. `discussionUrl` is the thread itself and is always there, which is usually the one
people actually want.

Comments come back with the title of the story they sit on, so a row is readable on its own.

### Access

Free, no key, no login, and no rate limit found at eight requests in a row with no pacing.

# Actor input Schema

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

What to search for. A company name, a product, a person, a phrase.

## `tags` (type: `array`):

Stories are submissions, comments are replies. show\_hn and ask\_hn are the two special submission kinds, job is the hiring posts.

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

Narrowing the range is how you reach past the 1,000 result ceiling on a busy query.

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

Used with the start date to bound the search.

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

Drops everything below this score. Useful for cutting a broad query down to what people actually read.

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

Off, results come back by relevance. On, strictly newest first, which is what you want for monitoring.

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

A single query can never reach past 1,000 in one window. Above that this Actor splits the date range and keeps going.

## `onlyNewSinceLastRun` (type: `boolean`):

Returns only results that were not there last time, marked isNew. The first run on a query records a baseline and returns everything with isNew empty. A query whose request fails is carried forward untouched.

## Actor input object example

```json
{
  "queries": [
    "anthropic"
  ],
  "tags": [
    "story"
  ],
  "sortByDate": false,
  "maxResultsPerQuery": 200,
  "onlyNewSinceLastRun": false
}
```

# Actor output Schema

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

Stories and comments with points, author and both links.

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

Per query counts, the approximate match estimate, and whether the range had to be split.

# 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": [
        "anthropic"
    ],
    "tags": [
        "story"
    ]
};

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

# Run the Actor and wait for it to finish
run = client.actor("gubidonius/hn-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": [
    "anthropic"
  ],
  "tags": [
    "story"
  ]
}' |
apify call gubidonius/hn-search --silent --output-dataset

```

## MCP server setup

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