Note that the HN Algolia API seems to no longer be available, so we can’t add search without quite a bit of overhead.

  • package: @agentic/hacker-news
  • exports: class HackerNewsClient, namespace hackernews
  • env vars: HACKER_NEWS_API_USER_AGENT (optional)
  • source
  • HN api docs

Install

Usage

import { HackerNewsClient } from '@agentic/hacker-news'

const hn = new HackerNewsClient()
const res = await hn.getTopStories()