# Hacker News Search and Feed Scraper (`myagizm/hackernews-scraper`) Actor

Search public Hacker News stories, comments and feed sections by keyword. Returns authors, links, points, comment counts and timestamps.

- **URL**: https://apify.com/myagizm/hackernews-scraper.md
- **Developed by:** [MYM](https://apify.com/myagizm) (community)
- **Categories:** News, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.08 / 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.

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 and Public Feeds (No API Key, No Login)

<p align="center">Apify Actor · Public Hacker News data · No API key · No login · JSON / CSV export · Pay per result</p>

**Search Hacker News stories and discussions by keyword, read public feed sections, and export flat rows with titles, item links, authors, points, comment counts, timestamps, and available text.** This Actor is built for focused research rather than an unbounded crawl: set one or more queries, choose a public tag, and cap the number of result rows.

> Start with the prefilled OpenAI query, review the first result rows, then replace the query with the topic you need.

### Table of contents

- [What it does](#what-it-does)
- [Who uses it](#who-uses-it)
- [Data fields](#data-fields)
- [How to run it](#how-to-run-it)
- [Input example](#input-example)
- [Output example](#output-example)
- [Coverage and limits](#coverage-and-limits)
- [Pricing](#pricing)
- [Tips](#tips)
- [Other public data Actors](#other-public-data-actors)
- [MCP and API](#mcp-and-api)
- [Support](#support)
- [FAQ](#faq)
- [Related searches](#related-searches)
- [Disclaimer](#disclaimer)
- [Resources](#resources)
- [中文说明](#中文说明)

### What it does

- Search public Hacker News stories by one or more keywords.
- Filter by story, comment, front page, Ask HN, Show HN, or jobs tags.
- Choose relevance ordering or date ordering for keyword searches.
- Return story and comment identifiers, author names, title, URL, score, comment count, text, and source timestamp when the public response includes them.
- Keep result fields flat so the default dataset works in tables, CSV, spreadsheets, and downstream automation.
- Stop at maxItems across the entire run; each written dataset row is one result event.

The scraper uses the public Hacker News search/feed surface. It does not sign into user accounts, read private material, or promise a complete archive.

### Who uses it

- Developer-relations teams tracking technical discussions.
- Product teams checking how a launch or library is discussed.
- Researchers building a public discussion dataset.
- Newsletter writers finding story leads.
- Analysts monitoring Ask HN and Show HN topics.
- Automation builders feeding public links into a review queue.

### Data fields

Always populated for a valid returned row: `type`, `id`, and `sourceType`. Other values depend on the public item type and upstream response.

| Field | Type | Description |
|---|---|---|
| `type` | string | story or comment. |
| `id` | string | Public Hacker News item ID. |
| `title` | string or null | Story title when the item is a story. |
| `url` | string or null | External link, or the Hacker News item link when no external URL exists. |
| `author` | string or null | Public item author. |
| `points` | integer or null | Score in the public search response. |
| `numComments` | integer or null | Public comment count when supplied. |
| `text` | string | Story or comment text, when present. |
| `storyId` | string or null | Parent story ID for a comment. |
| `parentId` | string or null | Parent item ID for a comment. |
| `createdAt` | date-time | Creation timestamp from the public endpoint. |
| `hnUrl` | string or null | Consistent Hacker News item URL. |
| `sourceType` | string | Always hackernews. |

An empty `title` on a comment is expected. A self-post may have no external destination; in that case `url` points to the Hacker News item page. Counts are snapshots, not historical values.

### How to run it

1. Open the Input tab and keep the prefilled `OpenAI` query or enter your own search term.
2. Choose the appropriate tag. `story` is the default; `front_page`, `ask_hn`, `show_hn`, `job`, and `comment` are useful alternatives.
3. Set `byDate` if newest-first ordering is more useful than relevance ordering.
4. Set `maxItems` to the number of rows you want across all queries. The input schema caps one run at 100 rows.
5. Start the Actor and inspect the Overview, Stories, or Discussions dataset view.

The result cap is global to the run. If you submit several queries, earlier queries can consume the available rows. Run separate tasks when each query needs its own quota.

### Input example

```json
{
  "queries": ["OpenAI", "MCP server"],
  "tags": ["story"],
  "byDate": false,
  "maxItems": 20
}
```

`queries` accepts a list of search strings. `tags` selects the public item/feed type. `byDate` switches the search order. `maxItems` caps the combined result rows. Leave a meaningful feed tag when clearing the query.

### Output example

The following rows were captured from a live Hacker News search run. Counts and public discussions can change after collection.

```json
[
  {
    "id": "38309611",
    "url": "https://openai.com/blog/openai-announces-leadership-transition",
    "text": "",
    "type": "story",
    "hnUrl": "https://news.ycombinator.com/item?id=38309611",
    "title": "OpenAI's board has fired Sam Altman",
    "author": "davidbarker",
    "points": 5710,
    "storyId": 38309611,
    "parentId": null,
    "createdAt": "2023-11-17T20:28:50Z",
    "sourceType": "hackernews",
    "numComments": 2530
  }
]
```

`hnUrl` always points to the Hacker News item page. `url` can instead point to the linked story. This distinction is useful when exporting links or joining a story to its discussion page.

### Coverage and limits

This product reads public search/feed results. A keyword search is not a guarantee of every matching item ever posted. Search indexing, public visibility, result order, and available fields are controlled by the upstream service. Story text can be empty when an item is link-only. Comment results can omit fields that do not apply to comments.

The input schema allows at most 20 queries and 100 result rows per run. Free Apify accounts can request up to 40 result rows per Actor per UTC day; the daily counter counts requested rows. Paid Apify plans are unlimited under this rule. Input errors and searches with explicitly confirmed no matches finish SUCCEEDED with no results and no charge; see OUTPUT for the reason. Service and transport failures remain FAILED.

### Pricing

This Actor uses PAY_PER_EVENT pricing at **$0.08 per 1,000 stored results** ($0.00008 per row). One stored story or comment row is one `apify-default-dataset-item` event. There is no separate Actor-start fee. A request that writes no result row is not charged as a result. Apify platform usage charges, if any, are separate from the Actor’s result price.

### Tips

- Use `story` for articles and launches; use `comment` when you need discussion text.
- Use `ask_hn` to find questions and `show_hn` to find project launches.
- Keep the query specific. Broad terms can return unrelated discussions.
- Use `byDate: true` for current monitoring and `false` for relevance-oriented research.
- Store `id` as the upsert key when combining runs in your own database.
- Preserve the source `createdAt` timezone while converting timestamps.
- Request a small maxItems during exploration; raise it only when you need more rows.
- Inspect `hnUrl` before republishing a title or quote so readers can reach the original discussion.

### Other public data Actors

Want public developer discussion from another source? See [Reddit Scraper](https://apify.com/myagizm/reddit-scraper), [X Tweet Scraper](https://apify.com/myagizm/x-tweet-scraper), [LinkedIn Profile Scraper](https://apify.com/myagizm/linkedin-profile-scraper), and [Google News Scraper](https://apify.com/myagizm/google-news-scraper). Browse all tools by [myagizm](https://apify.com/myagizm).

### MCP and API

AI agents can use the Apify MCP integration to start an Actor run, inspect its status, and read dataset rows. Keep the input explicit: query, tags, ordering, and result cap should be chosen before a scheduled or agent-driven run.

Run synchronously and return dataset items:

```bash
curl -X POST "https://api.apify.com/v2/acts/myagizm~hackernews-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN&format=json" \
  -H 'content-type: application/json' \
  -d '{"queries":["OpenAI"],"tags":["story"],"maxItems":20}'
```

Start an asynchronous run:

```bash
curl -X POST "https://api.apify.com/v2/acts/myagizm~hackernews-scraper/runs?token=$APIFY_TOKEN&waitForFinish=300" \
  -H 'content-type: application/json' \
  -d '{"queries":["MCP server"],"tags":["story"],"byDate":true,"maxItems":20}'
```

Fetch dataset items after reading the run’s `defaultDatasetId`:

```bash
curl "https://api.apify.com/v2/datasets/$DATASET_ID/items?token=$APIFY_TOKEN&format=json&clean=true"
```

### Support

Use the Actor’s Issues tab and include the run ID, UTC start time, input fields, and the exact missing field or error. Do not post API tokens or private credentials in an issue.

### FAQ

#### Which Hacker News data can I request?

Search public stories or comments by query, or filter a feed such as the front page, Ask HN, Show HN, or jobs. The output is one row per returned item; it is not a private-account or user-session export.

#### Does an empty query mean the front page?

The form starts with a public search query and the story tag. To read a feed, clear the query and choose a feed tag such as front_page. Keep at least one target: a query or a useful feed tag.

#### How are several queries combined?

Queries are searched in order and their rows are combined up to maxItems. Duplicate item IDs are removed within each run, so overlapping queries do not return the same ID twice.

#### What does byDate change?

When enabled, the query uses the date-ordered public search endpoint. Otherwise, the query uses its relevance-ordered endpoint. Neither option changes the original creation time stored in createdAt.

#### Can I request comments?

Yes. Select the comment tag and a query, or use a feed that returns the item type you need. A comment row can have no title or points; storyId and parentId identify its place in the discussion when available.

#### Are points and comment counts live?

They reflect the public search result seen during that run. Hacker News can change the score and comment count after collection; this dataset is a timestamped snapshot, not a continuously updated record.

#### Does every story have an external URL?

Some stories link to an external page; others are self-posts. The url field falls back to the Hacker News item page when a separate external link is absent.

#### Why can text be empty?

Many Hacker News stories contain only a title and link. The text field is populated when the public item includes story or comment text; an empty value is not a parsing error by itself.

#### Does this collect the full archive?

No. The Actor returns the public search/feed rows selected for this run, capped by maxItems. It does not claim complete archive coverage or private moderation data.

#### How many rows can one run return?

The input schema permits up to 100 result rows per run and up to 20 queries. The free Apify plan has a shared per-Actor daily allowance of 40 requested rows; paid Apify plans are not subject to that daily limit.

#### How is pricing calculated?

Pricing is per result row stored in the default dataset. A returned story or comment is one event. No run-start fee is configured; zero-row outcomes are not billed as result rows.

#### Are retries billed?

A retry that stores a row is billed for that row. A failed request that stores no dataset rows creates no result event. Do not repeatedly submit the same blocked or malformed input.

#### Can I export JSON, CSV, or Excel?

Yes. The Apify dataset can be downloaded as JSON, JSONL, CSV, Excel, XML, or RSS where the platform supports the selected format. The API links in this page also expose the raw dataset.

#### Can I schedule searches?

Yes. Create an Apify schedule for this Actor and choose the query, tag, and result cap in the scheduled input. Keep the cap small for frequent schedules so recurring snapshots remain focused.

#### Does this require an API key or Hacker News login?

No Hacker News credentials are requested. The Actor reads public search/feed data. Apify still requires an Apify account and an Apify API token to start private or paid runs.

#### Can I send arbitrary API parameters?

Use the documented input fields. The Actor does not accept browser cookies, account credentials, custom proxy credentials, or arbitrary headers.

#### What timezone is createdAt?

The source timestamp is returned in the ISO form provided by the public search endpoint. Keep its timezone offset when converting it; do not assume a local timezone.

#### How do I avoid duplicate rows across scheduled runs?

Each run is an independent snapshot. Store item IDs in your own database and upsert on id if you want a current list; this Actor does not keep customer-specific history between runs.

#### What happens when a query finds no rows?

A search with explicitly confirmed no matches finishes SUCCEEDED with zero result rows and a reason in OUTPUT. Service and transport errors remain FAILED. Review spelling, tags, and the date filter. An empty result is not represented as a successful billable story.

#### Can I scrape Hacker News user profiles?

The current public input is built for stories, comments, and feed search. It does not promise a full user-profile product; user data appears only when present in the selected item response.

#### Why is hnUrl separate from url?

url can be an external story link or, for self-posts, the Hacker News item page. hnUrl consistently identifies the Hacker News item, which is useful for discussion and deduplication.

#### Can I use this for investment or legal decisions?

Treat results as public discussion signals, not verified statements or financial advice. Follow Hacker News terms and applicable law when storing, republishing, or contacting authors.

#### Is the Actor affiliated with Y Combinator?

No. Hacker News and Y Combinator are third-party services and trademarks. This independently built tool is not endorsed by or affiliated with them.

#### Can AI agents run this Actor?

Yes. Use Apify MCP or the Apify API to start a run and read its dataset. Keep the query, tag, and maxItems explicit so an agent does not request a broader crawl than intended.

#### What should I include in a support request?

Include the Actor run ID, input fields, approximate UTC start time, and whether the output is empty or missing a particular field. Do not include your Apify token or private account credentials.

### Related searches

Hacker News scraper · Hacker News API scraper · Hacker News search API · Hacker News story scraper · Hacker News comments scraper · Ask HN scraper · Show HN scraper · Hacker News front page scraper · Hacker News newest stories · Hacker News best stories · Hacker News jobs feed · OpenAI Hacker News search · MCP server Hacker News search · public developer discussions · Hacker News points and comments · Hacker News story links · Hacker News author data · Hacker News JSON export · Hacker News CSV export · Hacker News trend monitoring · technical topic research · public startup discussions · Hacker News scheduled scraper · Hacker News dataset API · Hacker News automation · Apify Hacker News Actor

### Disclaimer

This independent tool reads public Hacker News search/feed results. Hacker News and Y Combinator are third-party services and trademarks; this Actor is not affiliated with or endorsed by them. Users are responsible for complying with applicable laws, source terms, privacy rules, and quotation/copyright requirements. Public availability does not grant permission to republish content without limits.

### Resources

- [Apify API documentation](https://docs.apify.com/api/v2)
- [Apify MCP integration](https://docs.apify.com/platform/integrations/mcp)
- [Dataset export](https://docs.apify.com/platform/storage/dataset)
- [Schedules](https://docs.apify.com/platform/schedules)
- [Integrations](https://docs.apify.com/platform/integrations)
- [All my Actors](https://apify.com/myagizm)

### 中文说明

## Hacker News 抓取器：搜索、故事与公开 Feed（无需 API 密钥、无需登录）

<p align="center">Apify Actor · 公开 Hacker News 数据 · 无 API 密钥 · 无登录 · JSON / CSV 导出 · 按结果计费</p>

**按关键词搜索 Hacker News 公开故事和讨论，读取公开 Feed，并导出包含标题、链接、作者、points、评论数、时间戳及可用文本的扁平记录。** 本 Actor 适合有边界的研究：填写查询词，选择公开标签，并设置结果行上限；它不是无限制抓取器。

> 使用预填的 OpenAI 查询开始，查看首批结果，再换成你要研究的主题。

### 目录

- [功能](#功能)
- [适用对象](#适用对象)
- [数据字段](#数据字段)
- [运行步骤](#运行步骤)
- [输入示例](#输入示例)
- [输出示例](#输出示例)
- [覆盖范围与限制](#覆盖范围与限制)
- [价格](#价格)
- [使用建议](#使用建议)
- [其他公开数据 Actor](#其他公开数据-actor)
- [MCP 与 API](#mcp-与-api)
- [支持](#支持)
- [常见问题](#常见问题)
- [相关搜索](#相关搜索)
- [免责声明](#免责声明)
- [资源](#资源)

### 功能

- 按关键词搜索 Hacker News 公开故事。
- 按 story、comment、front page、Ask HN、Show HN 或 jobs 标签筛选。
- 关键词搜索可选择相关度排序或日期排序。
- 返回故事和评论的 ID、作者、标题、URL、分数、评论数、文本，以及来源提供的时间戳。
- 字段保持扁平，便于 Apify 表格、CSV、电子表格和后续自动化使用。
- maxItems 是整个运行的总行数上限；每写入一行数据集记录计一次结果事件。

工具使用 Hacker News 的公开搜索和 Feed 数据。不登录用户账户、不读取私密内容，也不承诺完整历史档案。

### 适用对象

- 跟踪技术讨论的开发者关系团队。
- 检查产品发布或开发库讨论的产品团队。
- 构建公开讨论数据集的研究人员。
- 寻找选题线索的 Newsletter 作者。
- 关注 Ask HN 和 Show HN 的分析人员。
- 将公开链接写入审核队列的自动化开发者。

### 数据字段

有效行始终提供：`type`、`id` 和 `sourceType`。其他字段取决于公开项目类型和上游响应。

| 字段 | 类型 | 说明 |
|---|---|---|
| `type` | string | story 或 comment。 |
| `id` | string | Hacker News 公开项目 ID。 |
| `title` | string 或 null | 故事标题；评论通常没有标题。 |
| `url` | string 或 null | 外部链接；没有外链时使用 Hacker News 项目页。 |
| `author` | string 或 null | 公开项目作者。 |
| `points` | integer 或 null | 本次公开搜索响应中的分数。 |
| `numComments` | integer 或 null | 上游提供的公开评论数。 |
| `text` | string | 可用时返回故事或评论文本。 |
| `storyId` | string 或 null | 评论关联的故事 ID。 |
| `parentId` | string 或 null | 评论的父项目 ID。 |
| `createdAt` | date-time | 公开端点提供的创建时间。 |
| `hnUrl` | string 或 null | Hacker News 项目页链接。 |
| `sourceType` | string | 固定为 hackernews。 |

评论的 title 为空属于预期行为。自发布故事可能没有外部目标，此时 url 指向 Hacker News 项目页。分数和评论数是收集时的快照，不是历史数据。

### 运行步骤

1. 打开 Input，保留预填的 `OpenAI` 查询，或输入自己的关键词。
2. 选择标签。默认 `story`；也可选择 `front_page`、`ask_hn`、`show_hn`、`job` 或 `comment`。
3. 若需要最新内容，将 `byDate` 打开；若需要相关度排序，则关闭。
4. 设置 `maxItems`，限制所有查询合计返回的行数。单次运行最多 100 行。
5. 启动 Actor，并查看 Overview、Stories 或 Discussions 数据视图。

maxItems 是整个运行的总上限。多个查询会按输入顺序执行，先执行的查询可能占满上限。需要每个查询独立配额时，请分别运行。

### 输入示例

```json
{
  "queries": ["OpenAI", "MCP server"],
  "tags": ["story"],
  "byDate": false,
  "maxItems": 20
}
```

`queries` 是搜索词列表。`tags` 选择公开项目类型或 Feed。`byDate` 切换搜索顺序。`maxItems` 限制合计结果行数。清空查询词时，请保留有意义的 Feed 标签。

### 输出示例

以下记录来自真实 Hacker News 搜索运行。收集后，分数和公开讨论可能继续变化。

```json
[
  {
    "id": "38309611",
    "url": "https://openai.com/blog/openai-announces-leadership-transition",
    "text": "",
    "type": "story",
    "hnUrl": "https://news.ycombinator.com/item?id=38309611",
    "title": "OpenAI's board has fired Sam Altman",
    "author": "davidbarker",
    "points": 5710,
    "storyId": 38309611,
    "parentId": null,
    "createdAt": "2023-11-17T20:28:50Z",
    "sourceType": "hackernews",
    "numComments": 2530
  }
]
```

`hnUrl` 始终指向 Hacker News 项目页；`url` 也可能指向外部故事。导出链接或将故事与讨论页关联时，请保留这两个字段的区别。

### 覆盖范围与限制

本产品读取公开搜索和 Feed 结果。关键词搜索不保证返回历史上所有匹配项目。索引、可见性、排序和字段由上游服务决定。链接型故事的 text 可能为空；评论记录也可能没有故事字段。

输入最多包含 20 个查询，每次最多返回 100 行。Apify 免费方案每个 Actor 每个 UTC 日最多请求 40 条结果；计数按请求行数计算。付费 Apify 方案不受此日限额约束。输入错误和明确确认无匹配的搜索以 SUCCEEDED 状态结束，不写入结果行且不收费；原因见 OUTPUT。服务和传输故障仍以 FAILED 状态结束。

### 价格

Actor 使用 PAY_PER_EVENT。默认数据集写入的每条故事或评论记录都计一个 `apify-default-dataset-item` 事件。没有单独启动费。没有写入结果行的请求不会按结果计费。Apify 平台使用费（如有）与 Actor 结果价格分开。

### 使用建议

- 文章或发布新闻使用 `story`；讨论文本使用 `comment`。
- `ask_hn` 适合问题，`show_hn` 适合项目发布。
- 查询越具体，结果越容易聚焦；宽泛关键词可能带来无关讨论。
- `byDate: true` 适合近期监控；`false` 适合相关度研究。
- 合并多次运行时，以 `id` 作为自己的 upsert 键。
- 转换时间时保留 createdAt 的来源时区。
- 探索阶段使用较小的 maxItems，需要更多行时再提高上限。
- 转发标题或引用前，先查看 hnUrl，方便读者访问原讨论。

### 其他公开数据 Actor

需要其他来源的公开开发者讨论？可查看 [Reddit Scraper](https://apify.com/myagizm/reddit-scraper)、[X Tweet Scraper](https://apify.com/myagizm/x-tweet-scraper)、[LinkedIn Profile Scraper](https://apify.com/myagizm/linkedin-profile-scraper) 和 [Google News Scraper](https://apify.com/myagizm/google-news-scraper)。更多工具见 [myagizm Actor 页面](https://apify.com/myagizm)。

### MCP 与 API

AI agent 可以通过 Apify MCP 启动 Actor、查看状态并读取数据集。请明确设置查询词、标签、排序方式和结果上限，避免定时任务或代理请求超出实际需要的数据。

同步运行并返回数据集行：

```bash
curl -X POST "https://api.apify.com/v2/acts/myagizm~hackernews-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN&format=json" \
  -H 'content-type: application/json' \
  -d '{"queries":["OpenAI"],"tags":["story"],"maxItems":20}'
```

异步启动运行：

```bash
curl -X POST "https://api.apify.com/v2/acts/myagizm~hackernews-scraper/runs?token=$APIFY_TOKEN&waitForFinish=300" \
  -H 'content-type: application/json' \
  -d '{"queries":["MCP server"],"tags":["story"],"byDate":true,"maxItems":20}'
```

读取运行返回的 `defaultDatasetId` 后下载数据集：

```bash
curl "https://api.apify.com/v2/datasets/$DATASET_ID/items?token=$APIFY_TOKEN&format=json&clean=true"
```

### 支持

请在 Actor 的 Issues 页面提交 run ID、UTC 开始时间、输入字段，以及缺失字段或错误。不要在 issue 中粘贴 API token 或私有凭据。

### 常见问题

#### 支持哪些 Hacker News 数据？

可按关键词搜索公开故事或评论，也可选择 front_page、Ask HN、Show HN、jobs 等公开标签。每条返回记录占一行；本工具不导出私有账户或会话数据。

#### 空关键词会自动抓取首页吗？

表单默认带有 OpenAI 搜索词和 story 标签。要读取首页，请清空搜索词并选择 front_page；至少保留一个有效查询或标签。

#### 多个查询如何合并？

查询按输入顺序执行，合并结果受 maxItems 限制。一次核心调用会按项目 ID 去重，因此重叠查询不会重复返回同一 ID。不同运行仍是独立快照。

#### byDate 有什么作用？

启用后使用按时间排序的公开搜索端点；关闭时使用相关度排序端点。两种方式都会保留来源提供的 createdAt 时间。

#### 能否抓取评论？

可以。选择 comment 标签并设置查询，或使用适当的公开标签。评论可能没有标题或 points；存在时，storyId 和 parentId 用于表示讨论关系。

#### points 和评论数是实时的吗？

它们是本次运行查询时公开页面提供的快照。Hacker News 后续可能修改分数或评论数；数据不会自动追溯更新。

#### 每条故事都有外链吗？

不一定。有些故事链接到外部网站，有些是站内自发布。若没有外部链接，url 会回退到 Hacker News 项目页。

#### 为什么 text 为空？

很多故事只有标题和链接。仅当公开项目包含故事或评论文本时才填写 text；空值本身并不表示解析错误。

#### 这会抓取完整历史库吗？

不会。工具只返回本次公开搜索或 feed 选中的项目，并受 maxItems 限制。不承诺覆盖完整档案或私有审核数据。

#### 每次最多能拿多少条？

每次最多 100 条、最多 20 个查询。Apify 免费方案每个 Actor 每天限制 40 个请求结果；付费 Apify 方案不受此日限额约束。

#### 如何计费？

按写入默认数据集的每条结果计费。故事或评论各算一条；没有配置启动费。零行结果不会产生结果事件。

#### 重试会收费吗？

重试若写入结果行，就按该行计费。没有写入数据行的失败请求不会生成结果事件。请先修正错误输入，不要重复提交受限目标。

#### 支持哪些导出格式？

可从 Apify 数据集下载 JSON、JSONL、CSV、Excel、XML、RSS 等平台支持的格式。API 链接也可读取原始数据集。

#### 可以定时运行吗？

可以。创建 Apify Schedule 并保存查询、标签和结果上限。频繁运行时应降低 maxItems，避免重复收集过多快照。

#### 需要 Hacker News 账号或 API 密钥吗？

不需要 Hacker News 凭据。工具读取公开搜索/feed 数据。运行私有或付费 Actor 仍需 Apify 账户和 Apify API token。

#### 可以传任意 API 参数吗？

请使用文档列出的输入字段。Actor 不接收浏览器 Cookie、账户密码、自定义代理凭据或任意 HTTP 标头。

#### createdAt 使用什么时区？

来源时间以公开搜索端点提供的 ISO 时间形式返回。转换时请保留时区偏移，不要默认当成本地时间。

#### 如何避免多次定时运行重复？

每次运行都是独立快照。需要当前列表时，请在自己的数据库中以 id 做 upsert；Actor 不保存客户之间的历史状态。

#### 查询没有结果时会怎样？

明确确认无匹配时，运行以 SUCCEEDED 状态结束，不写入结果行，原因见 OUTPUT；服务和传输错误仍为 FAILED。请检查拼写、标签和时间筛选；空结果不会伪装成成功的计费故事。

#### 能否抓取用户完整资料？

当前输入面向故事、评论和 feed 搜索，不承诺完整用户档案。所选项目响应中存在的作者字段会随结果返回。

#### 为什么同时提供 hnUrl 和 url？

url 可能是外部故事链接，也可能是自发布项目的 Hacker News 页面；hnUrl 始终指向 Hacker News 项目页，便于讨论和去重。

#### 可用于投资或法律决策吗？

请把结果当作公开讨论信号，而非已核实事实或财务建议。保存、转发或联系作者前，应遵守 Hacker News 条款和适用法律。

#### 这是 Y Combinator 官方产品吗？

不是。Hacker News 和 Y Combinator 是第三方服务及商标。本工具独立开发，不代表或隶属于它们。

#### AI agent 可以运行它吗？

可以。用 Apify MCP 或 Apify API 启动运行并读取数据集。明确填写查询、标签和 maxItems，避免代理请求超出需要的数据。

#### 联系客服需要提供什么？

请提供 Actor run ID、输入字段、UTC 时间，以及空结果或缺失字段描述。不要发送 Apify token 或私有账户凭据。

### 相关搜索

Hacker News 抓取器 · Hacker News API 抓取 · Hacker News 搜索 API · Hacker News 故事抓取 · Hacker News 评论抓取 · Ask HN 抓取 · Show HN 抓取 · Hacker News 首页 · 最新 Hacker News 故事 · 最热 Hacker News 故事 · Hacker News jobs feed · OpenAI Hacker News 搜索 · MCP server Hacker News 搜索 · 公开开发者讨论 · Hacker News points 和评论 · Hacker News 故事链接 · Hacker News 作者数据 · Hacker News JSON 导出 · Hacker News CSV 导出 · Hacker News 趋势监控 · 技术主题研究 · 创业讨论 · Hacker News 定时抓取 · Hacker News 数据集 API · Hacker News 自动化 · Apify Hacker News Actor

### 免责声明

本工具独立开发，仅读取 Hacker News 公开搜索和 Feed 结果。Hacker News 和 Y Combinator 是第三方服务及商标；本 Actor 不隶属于它们，也未获其认可。用户应遵守适用法律、来源条款、隐私规则和引用/版权要求。公开可见并不代表可以不受限制地转载内容。

### 资源

- [Apify API 文档](https://docs.apify.com/api/v2)
- [Apify MCP 集成](https://docs.apify.com/platform/integrations/mcp)
- [数据集导出](https://docs.apify.com/platform/storage/dataset)
- [定时任务](https://docs.apify.com/platform/schedules)
- [平台集成](https://docs.apify.com/platform/integrations)
- [myagizm Actor 页面](https://apify.com/myagizm)

### Errors & billing

Input errors finish with status SUCCEEDED, no results and no charge; see the OUTPUT record for the reason.

#### 错误与计费

输入错误会以 SUCCEEDED 状态结束，不产生结果且不收费；原因请查看 OUTPUT 记录。

# Actor input Schema

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

Optional Hacker News search terms. Each query searches public stories by default, or the selected tags. A run returns at most maxItems rows across all queries.

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

Optional Hacker News tags such as story, comment, front_page, ask_hn, show_hn or job. Leave the default story tag to search stories; use front_page for the current front page.

## `byDate` (type: `boolean`):

When enabled, use Hacker News' date-ordered search endpoint. When disabled, use its relevance-ordered endpoint.

## `maxItems` (type: `integer`):

Maximum combined number of story or comment rows returned by this run. Every stored row is one billable result; the free Apify plan is limited to 40 requested results per day for this Actor.

## Actor input object example

```json
{
  "queries": [
    "OpenAI"
  ],
  "tags": [
    "story"
  ],
  "byDate": false,
  "maxItems": 20
}
```

# Actor output Schema

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

Search results with story titles, authors, links, points and comment counts.

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

Story rows with public text and metadata.

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

Comment rows linked to their story and parent item where available.

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

All returned rows and fields without a view filter.

# 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": [
        "OpenAI"
    ],
    "tags": [
        "story"
    ],
    "byDate": false,
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("myagizm/hackernews-scraper").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": ["OpenAI"],
    "tags": ["story"],
    "byDate": False,
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("myagizm/hackernews-scraper").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": [
    "OpenAI"
  ],
  "tags": [
    "story"
  ],
  "byDate": false,
  "maxItems": 20
}' |
apify call myagizm/hackernews-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,myagizm/hackernews-scraper"
        }
    }
}
```

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/kpJMzQ0TQX9KkKOCi/builds/dNi8enaaAJzW0O6Rc/openapi.json
