← all repositories
steven-tey/chathn

Ask HN, but the AI answers back

A chatbot that lets you query Hacker News in plain English instead of wrestling with the official API.

1.2k stars TypeScript Chat AssistantsRAG · Search
chathn
Velocity · 7d
+1.1
★ / day
Trend
steady
star history

What it does ChatHN is a Next.js app that translates natural-language questions into calls against the Hacker News API. You type “What are the top stories about Rust?” and OpenAI Functions figures out which endpoints to hit, then streams the answer back via the Vercel AI SDK. It’s essentially a conversational wrapper around HN’s bare-bones JSON API.

The interesting bit The project is a tidy demo of OpenAI’s function-calling feature in action: the model decides whether it needs live data, picks the right HN endpoint, and formats the response without hand-written parsing logic. The Vercel AI SDK handles streaming tokens to the UI, so the whole thing feels like a chat app rather than a slow API explorer.

Key highlights

  • Built on Next.js with TailwindCSS, deployed to Vercel
  • Uses OpenAI Functions to map user questions to Hacker News API calls
  • Streams responses with the Vercel AI SDK
  • One-click deploy via Vercel template; only requires an OPENAI_API_KEY
  • Open source under MIT license

Caveats

  • The README is thin on implementation details (no mention of rate limits, caching, or HN API quotas)
  • Requires your own OpenAI API key; no indication of token usage or cost per query
  • The tech stack list contains a typo (“ChatH” instead of “ChatHN”), which suggests maintenance is light

Verdict Worth a look if you’re building with OpenAI Functions and want a reference integration with a real, public API. Skip it if you need a production-grade HN client — this is a demo, not a replacement for reading the orange site yourself.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.