Hacker News API
Read-only live Hacker News stories, story details, and top-level comments backed by the public Firebase API. Newest-story pages use opaque offset cursors, while polling uses a source ID checkpoint and reports when a checkpoint has expired from the source's 500-item window.
Endpoint health
Loading verification…
Connect your agent
Connect through MCP so your agent can find this API, read its docs, and call its endpoints.
Add the server from your terminal.
claude mcp add --transport http agent-data https://agent-data.motie.dev/mcpIn Claude Code, run /mcp, select agent-data, then Authenticate. Sign in to your agent-data account in the browser.
Then ask your agent to use the Hacker News API for your task.
Call it over HTTP
Get an API keySign up free, generate an API key, and set it as AGENT_DATA_API_KEY in your environment. Your first 100 calls each month are free.
curl --request GET --get 'https://api.agent-data.dev/news-ycombinator-com/v1/stories/newest' \
--header "Authorization: Bearer $AGENT_DATA_API_KEY"Endpoints
Inputs and response fields for every endpoint in this API.
GETStories newest/v1/stories/newest
Read the source's newest-story window; ranking can change between cursor calls.
Input
limitOptionalQuery · integer, min: 1, max: 30, default: 20Number of stories to return; maximum 30 per request
Example: 20
cursorOptionalQuery · string | nullOpaque cursor returned by the previous page
Response
itemsobject[]items[].by?string | nullitems[].idstringitems[].url?string | nullitems[].deadbooleanitems[].kids?integer[]items[].text?string | nullitems[].time?string | nullitems[].typestringitems[].score?integer | nullitems[].title?string | nullitems[].deletedbooleanitems[].parent_id?integer | nullitems[].source_idintegeritems[].descendants?integer | nullcheckpointstringnext_cursorstring | nullsource_limitintegerFields marked ? are optional.
For the next page, pass next_cursor from the response as cursor. Leave it empty on the first call.
GETStories poll/v1/stories/poll
Drain a checkpoint backlog with a cursor; an absent source marker expires with 410.
Input
after_idOptionalQuery · integer, min: 1 | nullLast processed Hacker News story ID; required when cursor is omitted
Example: 49806335
limitOptionalQuery · integer, min: 1, max: 30, default: 20Maximum number of new stories to return
Example: 20
cursorOptionalQuery · string | nullOpaque continuation returned when the checkpoint backlog exceeds limit
Response
itemsobject[]items[].by?string | nullitems[].idstringitems[].url?string | nullitems[].deadbooleanitems[].kids?integer[]items[].text?string | nullitems[].time?string | nullitems[].typestringitems[].score?integer | nullitems[].title?string | nullitems[].deletedbooleanitems[].parent_id?integer | nullitems[].source_idintegeritems[].descendants?integer | nullcheckpointstringsource_limitintegernext_poll_afterstringcheckpoint_foundbooleannext_poll_cursorstring | nullFields marked ? are optional.
For the next page, pass next_cursor from the response as cursor. Leave it empty on the first call.
GETStories by story id/v1/stories/{story_id}
Get a Hacker News story or item
Input
story_idRequiredPath · integer, min: 1Numeric Hacker News story/item ID
Example: 49806271
Response
storyobjectstory.by?string | nullstory.idstringstory.url?string | nullstory.deadbooleanstory.kids?integer[]story.text?string | nullstory.time?string | nullstory.typestringstory.score?integer | nullstory.title?string | nullstory.deletedbooleanstory.parent_id?integer | nullstory.source_idintegerstory.descendants?integer | nullFields marked ? are optional.
GETStories by story id comments/v1/stories/{story_id}/comments
List top-level comments for a Hacker News story
Input
story_idRequiredPath · integer, min: 1Numeric parent Hacker News story ID
Example: 49806271
limitOptionalQuery · integer, min: 1, max: 30, default: 20Number of top-level comments to return; maximum 30
Example: 20
cursorOptionalQuery · string | nullOpaque comment-page cursor returned by the previous page
Response
itemsobject[]items[].by?string | nullitems[].idstringitems[].deadbooleanitems[].kids?integer[]items[].text?string | nullitems[].time?string | nullitems[].deletedbooleanitems[].parent_id?integer | nullitems[].source_idintegercoveragestringstory_idintegernext_cursorstring | nullFields marked ? are optional.
For the next page, pass next_cursor from the response as cursor. Leave it empty on the first call.
Don’t see the endpoint you need?
Ask agent-data to add an endpoint or return more fields. Extensions are free and keep existing endpoints working.
An account is required to submit an extension. Prepare your request, then sign in to build.