# Hacker News Comment Search | Lightweight Public API (`micro-tool-factory/hacker-news-comments`) Actor

Search public Hacker News comments by keyword; export text, dates and discussion links. Public-only data, no login, no proxy.

- **URL**: https://apify.com/micro-tool-factory/hacker-news-comments.md
- **Developed by:** [Micro Tool Factory](https://apify.com/micro-tool-factory) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.19 / 1,000 result extracteds

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 Comment Search — JSON / API / MCP

**Search public Hacker News comments by keyword; export text, dates and discussion links.**

**For:** Developer-research and community-listening automation.

### Quick start

Enter a public search keyword, choose a result cap and select Start. Each query returns structured public records without a headless browser, residential proxy, private authentication or paid upstream service. Results can be downloaded from the Apify dataset as JSON, CSV or Excel; Apify Tasks and schedules make repeated searches possible. The output includes a source input field so users can merge the results from multiple queries.

#### Example input

```json
{
  "sources": [
    "python"
  ],
  "maxTotalItems": 30,
  "maxItemsPerSource": 30
}
```

#### Example output shape (illustrative, not actual live data)

```json
{
  "status": "ok",
  "text": "Illustrative discussion comment",
  "published": "2026-10-01",
  "url": "https://news.ycombinator.com/item?id=123",
  "storyId": "2"
}
```

### Output format

status, text, published, url, storyId, parentId, input. Successful records have status=ok. A malformed or unavailable input may yield a status=error diagnostic row, which is not charged as a result item. The Actor does not fabricate content.

### Scope and limits

Search uses the public Algolia comment index; this is not a complete thread walker or guaranteed historical archive. Results may lag. We do not export author identity.

The Actor accepts at most 10 public search queries per run (5 through the App Store Input tab), with a hard cap of 250 successful records, 40 upstream requests, 2MB upstream response size, and a bounded 256MB memory configuration. Individual upstream responses or requests may fail. A success result never implies complete coverage of all content at the upstream provider.

### Pricing and usage

The Apify Pricing tab is the source of truth for the active Pay Per Event prices. The intended charge is one successful output row per result-item event, with a small start event. Upstream errors do not get a result-item event. Set a maximum run charge and begin with 3 records. Do not assume a low result limit guarantees a positive unit margin for this publisher.

### Problems and support

Check input spelling, avoid private queries, then try a single broad term with 3 results. Public search provider APIs can be temporarily rate-limited, return zero matches or change their schema. Never bypass access restrictions. Contact the publisher via the Apify Actor Issues tab with public reproduction steps, not access tokens, credentials or personal data.

This independently published utility is not affiliated with Apple, Algolia or Hacker News. Follow the upstream provider's applicable terms, attribution and permitted data uses. No uptime, paying-customer or dataset completeness claims are made.

# Actor input Schema

## `sources` (type: `array`):

Search keywords, not credentials or private URLs.

## `maxTotalItems` (type: `integer`):

Successful rows across all queries.

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

Up to 100 HN comments or 200 App Store results.

## Actor input object example

```json
{
  "sources": [
    "python"
  ],
  "maxTotalItems": 100,
  "maxItemsPerSource": 30
}
```

# Actor output Schema

## `results` (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 = {
    "sources": [
        "python"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("micro-tool-factory/hacker-news-comments").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 = { "sources": ["python"] }

# Run the Actor and wait for it to finish
run = client.actor("micro-tool-factory/hacker-news-comments").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 '{
  "sources": [
    "python"
  ]
}' |
apify call micro-tool-factory/hacker-news-comments --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,micro-tool-factory/hacker-news-comments"
        }
    }
}
```

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/oUk2I5AVq4RIL6L5f/builds/SxZycetFNaNSv9Vuu/openapi.json
