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.
Workspace
Configure
Inputs stay here while results become exportable artifacts.
Start from an example
Results
Preview, inspect, copy, or export the complete output.
Your result will become an artifact
Run the tool to inspect structured rows, raw JSON, execution details, and downloadable JSON, CSV, and Markdown files.
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 4, 2026
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, ChatGPT, Codex)
# After connecting https://betterfetch.co/api/mcp, ask your AI to:
1. Call search_tools for "Hacker News Scraper"
2. Call run_tool with:
name: "hacker_news_scraper"
input: {"mode":"search","tags":"story","query":"openai","max_results":3}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/tools/tree/main/tools/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}'