Overview
Hacker News tool allows you to fetch top stories, new stories, and comments from Hacker News. No API key required. The user asks for tech news; the agent fetches Hacker News stories and returns them.Installation
Quick Start
Usage with Agent
Available Methods
get_top_stories(limit=10)
Get top stories from Hacker News.get_new_stories(limit=10)
Get newest stories.get_best_stories(limit=10)
Get best stories.get_story(story_id)
Get a specific story by ID.Function-Based Usage
CLI Usage
Error Handling
Common Errors
| Error | Cause | Solution |
|---|---|---|
requests not installed | Missing dependency | Run pip install requests |
Connection error | Network issue | Check internet connection |
Rate limited | Too many requests | Add delay between requests |
How It Works
Best Practices
No API key needed
No API key needed
The Hacker News API is public — no credentials required.
Limit story count
Limit story count
Fetch the top N stories so the agent summarises a focused set instead of the full feed.
Cache the front page
Cache the front page
The front page changes slowly — cache it briefly to avoid repeated calls.
Related Tools
Reddit discussions
ArXiv
Academic papers
DuckDuckGo
Web search

