Better Fetch

Hacker News Scraper

Search Hacker News stories and comments, inspect item threads, or fetch public user metadata through the HN Algolia and Firebase APIs, returning titles, URLs, authors, points, comments, timestamps, tags, text, and profile fields.

Newsv0.1.0~1 credit/runApify StoreSource on GitHub

Overview

Hacker News Scraper gives agents a clean, validated path into the public HN discussion graph without scraping fragile HTML. Search by keyword and tag, sort by relevance or date, inspect a story or comment thread, or fetch public user metadata. The tool normalizes HN Algolia and Firebase API responses into compact records for trend monitoring, launch research, technical sentiment, DevRel workflows, and competitive intelligence.

Last validated: Jul 3, 2026

Playground

Run an Algolia search, inspect an HN item/thread, or fetch public HN user metadata.

Search ordering: relevance or date.

HN Algolia tags separated by commas, spaces, or semicolons, such as story, comment, front_page, ask_hn, show_hn, job, author_pg, or story_8863.

Search query for stories or comments. Optional when using tags such as front_page.

Hacker News item ID for item mode.

Hacker News username for user mode.

Maximum search records to return.

Maximum nested comments returned in item mode.

Sign in to run this tool

~1 credit per run · runs against your account

Input

mode"search" | "item" | "user"default: "search"

Run an Algolia search, inspect an HN item/thread, or fetch public HN user metadata.

sort"relevance" | "date"default: "relevance"

Search ordering: relevance or date.

tagsstringdefault: "story"

HN Algolia tags separated by commas, spaces, or semicolons, such as story, comment, front_page, ask_hn, show_hn, job, author_pg, or story_8863.

querystring

Search query for stories or comments. Optional when using tags such as front_page.

item_idinteger

Hacker News item ID for item mode.

usernamestring

Hacker News username for user mode.

max_resultsintegerdefault: 10

Maximum search records to return.

max_commentsintegerdefault: 10

Maximum nested comments returned in item mode.

Output

modestringrequired

Mode used for the run

userobject

Public HN user metadata

user.typestring

Record type

user.karmainteger

HN karma

user.usernamestring

HN username

user.about_textstring

About text with HTML removed

user.created_atstring

User creation timestamp

user.submitted_countinteger

Number of submitted public items

user.recent_submitted_idsstring

Comma-separated recent submitted item IDs

countintegerrequired

Number of primary records returned

recordsobject[]

Hacker News story, comment, or item records

commentsobject[]

Bounded nested comment records for item mode

source_urlstringrequired

Fetched HN API URL

total_matchesinteger

Total Algolia matches when reported

Examples

openai-stories

{
  "mode": "search",
  "tags": "story",
  "query": "openai",
  "max_results": 3
}

Use cases

Launch and competitor monitoring

Track mentions of a company, product, domain, or technology across Hacker News stories and comments with author, points, comment count, and timestamp fields.

Show HN and Ask HN research

Use tag filters such as show_hn, ask_hn, front_page, story, and comment to focus on launches, questions, or live front-page discussion.

Thread inspection

Fetch a known HN item and return the story plus a bounded set of nested comments so agents can summarize discussion without crawling page HTML.

FAQ

Does Hacker News Scraper require a login or API key?

No. Version 0.1 uses the public HN Algolia API and the official Hacker News Firebase API through Better Fetch. It does not access saved items or private account data.

Can it export every historical HN comment?

Not yet. Version 0.1 is intentionally bounded: search returns up to 50 records and item mode returns a limited comment slice. Full archive export and deep pagination should be separate validated slices.

Which tag filters can I use?

The tags input is passed to HN Algolia after validation. Common filters include story, comment, front_page, ask_hn, show_hn, job, author_username, and story_itemid.

Use it anywhere

MCP (Claude, Cursor, any client)

# Add the Better Fetch MCP connector (or paste the URL into
# Claude → Settings → Connectors → Add custom connector):
claude mcp add --transport http better-fetch https://betterfetch.co/api/mcp \
  --header "Authorization: Bearer bf_your_key_here"

# Then ask for the tool by name: hacker_news_scraper

REST

curl -sS -X POST "https://betterfetch.co/api/tools/hacker_news_scraper/run" \
  -H "Authorization: Bearer bf_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"input": {"mode":"search","tags":"story","query":"openai","max_results":3}}'

Run locally

git clone https://github.com/better-fetch/hacker-news-scraper && cd hacker-news-scraper && npm i
BETTER_FETCH_API_KEY=bf_your_key_here npx bf-tool run --input '{"mode":"search","tags":"story","query":"openai","max_results":3}'