Lightweight Python wrapper for the official Hacker News Firebase API. Get top stories, comments, user profiles — with zero authentication.
from hn_client import HackerNewsClient
hn = HackerNewsClient()
# Top stories right now
for story in hn.top_stories(limit=5):
print(f"[{story['score']}] {story['title']}")
print(f" {story.get('url', 'Ask HN')}")
# Search for stories (via Algolia)
results = hn.search("Python API", limit=5)
for r in results:
print(f" {r['title']} ({r['points']} points)")
# Get comments on a story
comments = hn.get_comments(story_id=12345, limit=10)- Top/New/Best/Ask/Show stories
- Story details (title, URL, score, author, time)
- Comments and nested replies
- User profiles
- Search via Algolia HN API (also free, no key)
- Zero authentication required
MIT — Built by Spinov001