# Hacker News Scraper & Search - Keyword Alerts, Front Page (`sophisticated_occasion/hacker-news-search-monitor`) Actor

Search Hacker News stories by keyword or export the top, new, best, Ask HN, Show HN and job lists via the official HN API and Algolia HN Search. Filter by points and date; only-new mode for keyword alerts. $0.0002 per story.

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

## Pricing

$0.19 / 1,000 hacker news story delivereds

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 & Search - Keyword Alerts, Front Page

**Keyword alerts and list exports for Hacker News**, using the official Hacker News API and the public Algolia HN Search API. Get stories mentioning your **brand, product, competitors or topics**, or export the **front page, new, best, Ask HN, Show HN and job** lists.

**$0.0002 per story**, no start fee. Failed sources are free.

### Quick start: example input, output and cost

Hacker News search and front-page export from the official APIs: points, comments, dates, Show/Ask HN, keyword alerts with only-new mode. Pay per story.

**Example input**

```json
{
  "queries": [
    "apify"
  ]
}
```

**Cost example:** A daily keyword alert returning ~30 stories = 900 stories x $0.0002 = **$0.18/month**.

### Monitoring (alerts)

Switch on `onlyNewStories`, schedule the actor (e.g. every hour) and connect the dataset to Slack, email or a webhook: each run returns, and charges, **only stories it has not delivered before**. Use `monitorName` to keep several monitors apart.

### Features

- Keyword search (newest first or by relevance), in all stories, Show HN, Ask HN or the current front page.
- Lists: top, new, best, ask, show, job, fetched in batches (a 1,000-story run needs only about a dozen API requests).
- Filters: minimum points, minimum comments, from-date. Stories found by several keywords/lists appear once, with `matchedBy`.

### Output

`id, title, url, domain, points, comments, createdAt, type (story/ask/show/job/poll), hnUrl, text (Ask/Show HN), matchedBy, fetchedAt`.

### Limits

- Hacker News stories only, from the public HN and Algolia APIs. Comment threads are not exported, only the comment count.
- Points and comment counts are a snapshot at run time.

### Privacy and fair use

No usernames and no comments are collected. Emails and phone numbers in story texts are redacted by default. We use only the official, publicly documented APIs, at about one request per second, and stay far below Algolia's documented limit. Hacker News content belongs to its authors; link back via `hnUrl` when you republish.

| Event | Price |
|---|---|
| Story delivered | $0.0002 |

*Not affiliated with Y Combinator or Algolia. Maintained by DigiVibeTech. Questions or bugs: use the Issues tab; we reply within 2–5 business days.*

### Use it in n8n, Make or Zapier (no code)

This actor works with Apify's official integrations, so you can send results to Google Sheets, Slack, Notion, a CRM or any of thousands of other apps.

**n8n**: [n8n.io](https://n8n.io)

1. In the Nodes panel, search **Apify** and install the verified node. Add your Apify API token.
2. Choose **Actors > Run actor and get dataset**, Actor source **Apify Store**, Actor URL `https://apify.com/sophisticated_occasion/hacker-news-search-monitor`.
3. Paste the input below into **Input JSON**. Each result item becomes an n8n item.

**Make**: [make.com](https://www.make.com/en/register)

1. Add the **Apify > Run an Actor** module, select this actor, turn on *Run synchronously*.
2. Add **Apify > Get Dataset Items** and map the `defaultDatasetId` from step 1.
3. Connect any app (Google Sheets > Add a Row, Slack > Create a Message, ...).

**Zapier:** use the **Apify** app, action **Run Actor** (pick this actor, paste the input), then **Fetch Dataset Items**.

**Example input**

```json
{
  "queries": [
    "apify"
  ],
  "maxItemsPerSource": 100,
  "searchType": "story",
  "sortByDate": true
}
```

**API (any language):** `POST https://api.apify.com/v2/acts/sophisticated_occasion~hacker-news-search-monitor/run-sync-get-dataset-items` with header `Authorization: Bearer <APIFY_TOKEN>` and the input above as the JSON body.

# Actor input Schema

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

Full-text search terms (your brand, product, competitor or topic). Up to 100.

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

Hacker News story lists to export.

## `maxItemsPerSource` (type: `integer`):

Hard limit per keyword and per list.

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

Which stories keyword search covers.

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

On: newest matching stories first (best for alerts). Off: most relevant first.

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

Skip stories with fewer points.

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

Skip stories with fewer comments.

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

Optional, e.g. 2026-01-31.

## `onlyNewStories` (type: `boolean`):

Remembers delivered stories in a named store; scheduled runs return and charge only new ones.

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

Separate memory per monitor (letters, digits, '-').

## `redactContactDetails` (type: `boolean`):

Ask/Show HN texts sometimes contain contact details; they are replaced by \[redacted].

## Actor input object example

```json
{
  "queries": [
    "apify"
  ],
  "lists": [],
  "maxItemsPerSource": 100,
  "searchType": "story",
  "sortByDate": true,
  "minPoints": 0,
  "minComments": 0,
  "onlyNewStories": false,
  "monitorName": "default",
  "redactContactDetails": true
}
```

# Actor output Schema

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

All result items (overview view)

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

Inputs that could not be processed, with the reason

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

Counts of processed, billed and failed items

# 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("sophisticated_occasion/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": ["apify"] }

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

```

## MCP server setup

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