canonical: https://jentic.com/apis/hacker-news.firebaseio.com/hacker-news

# Hacker News Firebaseio Hacker News API

The official Hacker News API is hosted on Firebase and provides read-only access to all public Hacker News data. Agents can fetch any item (story, comment, job, poll, or poll option) by id, look up user profiles, and pull live ranked feeds for top, new, best, Ask HN, Show HN, and job stories. The API returns JSON over HTTPS and requires no authentication. It is ideal for trend monitoring, citation lookup, and community sentiment analysis.

## For AI agents

Pull Hacker News stories, comments, user profiles, and live ranked feeds (top, new, best, Ask HN, Show HN, jobs) without authentication.

## Scope

Does not support posting, voting, commenting, or any write operations - use for read-only access to Hacker News stories, comments, users, and live feeds only.

## Capabilities

- Fetch a single Hacker News item by id and read its title, url, score, and kids
- Retrieve a user profile with karma, submitted ids, and account creation time
- List the current top, new, and best story ids in ranked order
- Pull the latest Ask HN and Show HN story ids for community Q&A and launches
- Fetch the latest job listing ids for hiring monitoring
- Watch the maxitem id and updates feed to detect newly created or changed items

## Use cases

### Trend and Sentiment Monitor

Watch the Hacker News top and new feeds for stories matching a brand, product, or technology and surface a digest with comment sentiment. The agent polls /topstories.json and /newstories.json, fetches each item via /item/{itemId}.json, and walks the kids array to read the comment thread. Useful for PR teams, founders monitoring launch reception, and competitive intelligence.

Example prompt: Fetch /topstories.json, retrieve each of the top 30 stories via /item/{itemId}.json, and return any whose title or url contains the keyword 'jentic'.

### Show HN Launch Tracker

Build a feed of new Show HN posts in your category and notify the team when a competing launch appears. The agent pulls /showstories.json, fetches each item, filters by keyword or domain, and posts matches to a chat channel. Setup is straightforward because the API requires no authentication.

Example prompt: Pull /showstories.json, fetch the first 50 items, and report any whose url matches a list of competitor domains.

### Hiring Pipeline Watcher

Scrape Hacker News 'Who is hiring?' threads and the dedicated jobs feed to surface roles relevant to a candidate's profile. The agent fetches /jobstories.json, walks the items, and uses keyword matching against role descriptions. Recruiters use this pattern to source from a high-signal community without paying for a job board.

Example prompt: Fetch /jobstories.json, retrieve each item, and return roles whose text contains 'remote' and 'rust'.

### Citation and Discussion Lookup

When a research agent encounters a URL, look up whether it has been discussed on Hacker News and surface the top comment thread. The agent searches by item id (from a third-party index) and pulls the discussion via /item/{itemId}.json. Useful for AI research assistants and content curation tools.

Example prompt: Given an item id 8863, GET /item/8863.json and return the title, score, and the first three top-level comment texts by walking the kids array.

### Agent Discovery Through Jentic

AI agents discover Hacker News operations by searching Jentic with intents like 'list top hacker news stories' and receive the matching operation with its input schema. The agent invokes the call through Jentic without writing custom HTTP code. Because the API is unauthenticated, no vault entry is needed.

Example prompt: Use Jentic search 'list top hacker news stories' to find the GET /topstories.json operation and execute it to receive the top 500 ranked story ids.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | /item/{itemId}.json | Fetch any item by id |
| GET | /user/{username}.json | Fetch a user profile |
| GET | /topstories.json | List the current top story ids |
| GET | /newstories.json | List the newest story ids |
| GET | /askstories.json | List the latest Ask HN ids |
| GET | /showstories.json | List the latest Show HN ids |
| GET | /jobstories.json | List the latest job ids |
| GET | /maxitem.json | Get the maximum item id currently posted |

## Key resources

- **Items** — Fetch any item (story, comment, ask, show, job, poll, pollopt) by id
- **Users** — Read public user profiles with karma and submitted item ids
- **Live feeds** — Top, new, best, Ask HN, Show HN, and job story id rankings
- **Updates** — Latest changed items and profiles, plus the global maxitem id

## Why Jentic

- **Setup:** Wiring the Hacker News API by hand still means learning its Firebase-style item and user paths and building each .json request and id lookup yourself. Through Jentic you install once, import the Hacker News API from the API Directory, and your agent calls it, with no key to manage since the API is unauthenticated.
- **Permission scoping:** The Hacker News API is read-only, so scope your agent to the operations it needs, such as listing top stories or fetching an item by id. You choose what it may call, and there are no write operations for it to reach.
- **Credential handling:** The Hacker News API is unauthenticated, so there is no credential to store; your Jentic One instance forwards the request without injecting any key. Nothing secret enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'list top hacker news stories' or 'fetch a hacker news item', and Jentic returns the matching operation with its input schema so the agent calls the right endpoint without building URLs by hand.

## Related APIs

- **Reddit API** — Larger community feed with subreddit-level filtering and authenticated posting.
- **Stack Exchange API** — Q&A network with structured tags and accepted-answer signals.
- **Dev.to API** — Cross-post discoveries from Hacker News into the dev.to feed.
- **Product Hunt API** — Pair Show HN tracking with Product Hunt launches for full launch coverage.

## FAQ

### What authentication does the Hacker News API use?

None. The Hacker News Firebase API is fully public and read-only, so no API key, OAuth token, or signed request is needed. Agents can call any endpoint anonymously, which means no credential setup is required in Jentic.

### How do I fetch a single Hacker News story and its comments?

GET /item/{itemId}.json returns the story object with its title, url, score, and a kids array of child comment ids. To build the full thread, fetch each id in kids recursively. There are no batch endpoints, so plan to make one request per node.

### What live feeds does the Hacker News API provide?

The API exposes /topstories.json, /newstories.json, /beststories.json, /askstories.json, /showstories.json, and /jobstories.json. Each returns up to 500 item ids in ranked order. Combine with /item/{itemId}.json to hydrate the full story payloads.

### Are there rate limits on the Hacker News API?

Hacker News does not publish formal rate limits, but sustained heavy polling will be throttled at the Firebase layer. For trend monitoring, poll the live feed endpoints every 30-60 seconds rather than continuously, and cache item payloads since they rarely change after a few hours.

### How do I use the Hacker News API with AI agents through Jentic?

Run pip install jentic, then search 'list top hacker news stories' to find GET /topstories.json. Load the operation and execute. Because the API is unauthenticated, the only setup is running Jentic One, the self-hosted execution layer, to use the SDK.

### Can I detect newly posted items in real time?

Yes. GET /maxitem.json returns the largest item id ever posted, and /updates.json returns recently changed items and profiles. Agents can poll maxitem and fetch any new ids since the last seen value to build a near-real-time stream.

### Can I limit what my agent is allowed to do with the Hacker News API?

Yes. Because Jentic One is self-hosted, you set the rules that decide which Hacker News operations your agent may call, so you can grant only what it needs, such as listing top stories with GET /topstories.json or fetching a single item with GET /item/{itemId}.json, while withholding user lookups or the live update feeds. The Hacker News API is read-only, so there are no posting, voting, or commenting operations for the agent to reach in the first place. And since the API is unauthenticated, no credential is stored or injected when your instance forwards the request.
