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.
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
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.
querystringSearch query for stories or comments. Optional when using tags such as front_page.
item_idintegerHacker News item ID for item mode.
usernamestringHacker News username for user mode.
max_resultsintegerdefault: 10Maximum search records to return.
max_commentsintegerdefault: 10Maximum nested comments returned in item mode.
Output
modestringrequiredMode used for the run
userobjectPublic HN user metadata
user.typestringRecord type
user.karmaintegerHN karma
user.usernamestringHN username
user.about_textstringAbout text with HTML removed
user.created_atstringUser creation timestamp
user.submitted_countintegerNumber of submitted public items
user.recent_submitted_idsstringComma-separated recent submitted item IDs
countintegerrequiredNumber of primary records returned
recordsobject[]Hacker News story, comment, or item records
commentsobject[]Bounded nested comment records for item mode
source_urlstringrequiredFetched HN API URL
total_matchesintegerTotal Algolia matches when reported
Examples
openai-stories
{
"mode": "search",
"tags": "story",
"query": "openai",
"max_results": 3
}Use cases
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}'