# Hacker News Search & Comment Threads Export (`ponderable_ironwork/hacker-news-search`) Actor

Search all of Hacker News - stories, comments, Show HN, Ask HN, jobs - by keyword, author, domain, date range and points via the official Algolia HN API. No 1,000-result cap, full comment threads with depth.

- **URL**: https://apify.com/ponderable_ironwork/hacker-news-search.md
- **Developed by:** [Zac Vincent](https://apify.com/ponderable_ironwork) (community)
- **Categories:** 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.40 / 1,000 results

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: Search Stories, Comments, Show HN & Ask HN

**Search all of Hacker News (stories, comments, Show HN, Ask HN, jobs and polls) by keyword, author, linked domain, date range, points and comment count.** Export clean JSON, CSV or Excel, with **full comment threads**. It's built on the official Algolia HN Search API, so it's fast and stable and needs no proxies. **$0.60 per 1,000 results.**

- ✅ **Every content type**: stories, comments, Show HN, Ask HN, jobs, polls, the current front page, or everything
- ✅ **No 1,000-result cap**: *Newest first* pages through time windows, so you can export **every** mention of a keyword since 2007
- ✅ **Full comment threads** for each story, with `depth`, `parentId` and `storyId`, ready for sentiment analysis or an LLM
- ✅ **Domain monitoring**: match only the linked URL (e.g. `github.com/yourorg` or `yourcompany.com`)
- ✅ **Filters**: since/until ("7 days", "2026-01-01"), minimum points, minimum comments, author
- ✅ Multiple queries per run, deduplicated, with clean plain text (HTML and entities decoded)
- 💲 **$0.60 per 1,000 results**

### What data does the Hacker News scraper return?

| Field | Meaning |
|---|---|
| `id`, `type` | HN item ID; `story`, `comment`, `job` or `poll` |
| `title`, `url`, `domain` | Story title and the linked page |
| `author`, `points`, `numComments`, `createdAt` | Engagement and timing |
| `text` | Story or comment body as plain text |
| `storyId`, `storyTitle`, `parentId`, `depth` | Thread structure (depth 1 = top-level reply) |
| `isShowHN`, `isAskHN`, `hnUrl`, `query` | Flags, permalink and the query that matched |

### How to search Hacker News and export results

1. Add **Search queries**: product names, competitors, technologies or domains (`apify`, `vector database`, `stripe.com`).
2. Pick a **Content type** (stories, comments, Show HN…) and where to **match the query** (everywhere, title only or linked URL only).
3. Set **Posted since** (`30 days`, `2026-01-01`), **Minimum points** and **Max results per query**.
4. Turn on **Include full comment threads** to also get every comment on the stories found.
5. Click **Start**, or schedule a daily run for brand monitoring.

#### Input example

```json
{
  "queries": ["apify", "web scraping", "playwright"],
  "type": "story",
  "since": "30 days",
  "minPoints": 10,
  "maxResults": 500,
  "includeComments": true,
  "maxCommentsPerStory": 100
}
```

To monitor launches that link to your site: `{"queries": ["yourcompany.com"], "searchIn": "url", "type": "all", "since": "7 days"}`

#### Output example (real run)

```json
{
  "id": 50441350,
  "type": "story",
  "title": "Show HN: Aircad – Professional drafting and 3D modeling in the browser",
  "url": "https://aircad.com",
  "domain": "aircad.com",
  "author": "peetle",
  "points": 96,
  "numComments": 48,
  "createdAt": "2026-11-10T15:01:19Z",
  "text": "Aircad is a professional CAD system running in the browser with deep AI integration. It includes professional grade drafting and documentati…",
  "storyId": 50441350,
  "storyTitle": "Show HN: Aircad – Professional drafting and 3D modeling in the browser",
  "parentId": null,
  "depth": 0,
  "isShowHN": true,
  "isAskHN": false,
  "hnUrl": "https://news.ycombinator.com/item?id=50441350",
  "query": "web scraping"
}
```

Comment rows have the same fields, with `type: "comment"`, the comment `text`, `storyId`/`storyTitle`, `parentId` and `depth`.

### Use cases

- **Brand and competitor monitoring**: daily runs that send new mentions to Slack, email or Google Sheets
- **Launch analytics**: see how your Show HN did and export every comment for analysis
- **Market and trend research**: track how often a technology is discussed over months or years
- **Sentiment analysis and AI datasets**: threaded developer discussions as clean text
- **Hiring and lead research**: Ask HN threads and job posts filtered by keyword

### Why use this Actor?

| | This Actor | Front-page scrapers | HN website search |
|---|---|---|---|
| Full history, no 1,000 cap | ✅ (newest-first paging) | ❌ front page only | Capped |
| Full comment threads with depth | ✅ | Rarely | ❌ |
| Linked-domain monitoring | ✅ | ❌ | Manual |
| Output | JSON, CSV, Excel, API | Varies | Web page |

### Use it from AI agents (MCP) and code

**MCP (Claude, Cursor, VS Code, ChatGPT and other MCP clients).** Add this Actor as a single tool through Apify's hosted MCP server. You sign in with your Apify account on first use:

```json
{
  "mcpServers": {
    "apify-hacker-news-search": {
      "url": "https://mcp.apify.com?tools=ponderable_ironwork/hacker-news-search"
    }
  }
}
```

The tool appears as `ponderable_ironwork--hacker-news-search`. Try a prompt like: *"Find every Hacker News story and comment that mentioned our product in the last 30 days and summarize the sentiment."*

**API (one call, results back as JSON).** Replace `<APIFY_TOKEN>` with your token from Apify Console → Settings → API & Integrations:

```bash
curl -X POST "https://api.apify.com/v2/acts/ponderable_ironwork~hacker-news-search/run-sync-get-dataset-items?token=<APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"queries": ["apify"], "type": "all", "since": "30 days", "maxResults": 200}'
```

The Apify [JavaScript](https://docs.apify.com/api/client/js/) and [Python](https://docs.apify.com/api/client/python/) clients, **schedules**, **webhooks** and the **Make, n8n and Zapier** integrations work too. Every run's dataset downloads as JSON, CSV, Excel or XML.

### Pricing

**$0.60 per 1,000 results** (stories and comments each count as one result; lower on higher Apify plans). A per-query `SUMMARY` (matches, saved, comments) is saved in the key-value store.

### FAQ

**Where does the data come from?** From the public [HN Search API by Algolia](https://hn.algolia.com/api), which indexes every public Hacker News item. No login is needed and nothing private is collected.

**Why is the relevance sort capped?** Algolia returns at most 1,000 hits per query when sorting by relevance. Use *Newest first* for complete exports.

### More data tools from this developer

- [Career Page Jobs API](https://apify.com/ponderable_ironwork/ats-jobs-feed): every open job from Greenhouse, Lever, Ashby, Workable, Recruitee & Workday boards, $1.50 per 1,000 jobs
- [Bulk PageSpeed Insights & Core Web Vitals](https://apify.com/ponderable_ironwork/pagespeed-bulk-audit): Lighthouse scores and real-user LCP/INP/CLS for hundreds of URLs, $3.00 per 1,000 audits
- [Sitemap URL Extractor](https://apify.com/ponderable_ironwork/sitemap-urls-extractor): every URL from a site's XML sitemaps with lastmod and hreflang, $0.50 per 1,000 URLs
- [Wayback Machine Snapshots & Archived URLs](https://apify.com/ponderable_ironwork/wayback-machine-snapshots): capture history and every archived URL of a domain, $1.00 per 1,000 results
- [Bulk Domain Availability, RDAP WHOIS & DNS](https://apify.com/ponderable_ironwork/domain-rdap-dns-checker): availability, registrar, expiry, MX/SPF/DMARC, $1.00 per 1,000 domains
- [OpenAlex Academic Papers Search](https://apify.com/ponderable_ironwork/openalex-papers-search): 250M+ papers with citations, abstracts and BibTeX, $1.00 per 1,000 papers
- [RSS, Atom & Podcast Feed Reader](https://apify.com/ponderable_ironwork/rss-feed-reader): any feed to clean JSON with auto-discovery, $0.80 per 1,000 items

Found a bug or need a field? Open an issue on the **Issues** tab. Fixes usually ship within days.

# Actor input Schema

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

Keywords, product names, competitors or domains (e.g. "apify", "vector database", "stripe.com"). Each query runs separately. Leave empty for the newest items.

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

What to search.

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

Everywhere (title, text, URL, author), only titles, or only the linked URL (domain monitoring).

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

A date (2026-01-31) or a window like '24 hours', '7 days', '6 months'. Empty = all time.

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

Optional end date (2026-06-30) or window ('1 year' = older than a year).

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

Newest first has no result cap. Relevance is limited to the top 1,000 per query.

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

Only items by this HN user, e.g. "dang".

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

Only stories with at least this many points.

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

Only stories with at least this many comments.

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

0 = everything that matches.

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

For every story found, also save its comments (with depth and parent ID). Each comment counts as a result.

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

Cap when 'Include full comment threads' is on. 0 = all.

## Actor input object example

```json
{
  "queries": [
    "web scraping"
  ],
  "type": "story",
  "searchIn": "all",
  "since": "30 days",
  "sort": "date",
  "minPoints": 0,
  "minComments": 0,
  "maxResults": 20,
  "includeComments": false,
  "maxCommentsPerStory": 200
}
```

# Actor output Schema

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

All items produced by the run.

## `summary` (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": [
        "web scraping"
    ],
    "since": "30 days",
    "maxResults": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("ponderable_ironwork/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": ["web scraping"],
    "since": "30 days",
    "maxResults": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("ponderable_ironwork/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": [
    "web scraping"
  ],
  "since": "30 days",
  "maxResults": 20
}' |
apify call ponderable_ironwork/hacker-news-search --silent --output-dataset

```

## MCP server setup

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