Hacker News Max Item API
Read HN's current high-water item id — then walk new ids you have not seen yet.
GET /v1/hackernews/maxitem1 credit per successful request.
About this endpoint
Ingest pipelines that follow the HN firehose need a high-water mark: the largest item id the corpus has assigned so far. Without it, you either miss new posts or re-scan huge id ranges. The official maxitem endpoint is a single integer; Social Fetch wraps it in the same `{ data, meta }` envelope as the rest of the marketplace.
`GET /v1/hackernews/maxitem` returns `data.maxItemId` and `data.fetchedAt`. Send `x-api-key`; there is no path or query parameter. Compare against your stored watermark, then hydrate the gap with `GET /v1/hackernews/items/{id}` (or stories when you only care about story-shaped rows). Pair with `GET /v1/hackernews/updates` for mutations to older ids that maxitem alone will not surface.
Credit pricing for this operation comes from the API registry and appears on this page, and `meta.creditsCharged` is the billing source of truth.
Hacker News Max Item API FAQ
How do I get the current Hacker News max item id?
Call GET /v1/hackernews/maxitem with your Social Fetch API key in the x-api-key header. Read data.maxItemId and data.fetchedAt. No path or query parameters are required.
How many credits does maxitem cost?
Pricing is documented on the operation in the API registry (shown on this page). Confirm on every response with meta.creditsCharged — that field is the billing source of truth.
Does maxitem return item bodies?
No. It returns only the current largest id and a fetch timestamp. Hydrate individual ids with GET /v1/hackernews/items/{id} or the stories route when appropriate.
Maxitem vs updates?
maxitem tracks the high-water mark for newly assigned ids. updates lists recently changed existing item ids and usernames. Use both for complete freshness: new ids plus edits to older ones.
How should I use maxitem in a sync job?
Store the last processed maxItemId. On each poll, if the new max is higher, walk the open id range (with backoff and rate awareness), hydrate what you need, then advance the watermark. Log meta.requestId per poll.
Do I need a Hacker News account?
No. Social Fetch authenticates with your Social Fetch API key only. The route mirrors the public HN maxitem helper under the shared marketplace envelope.
Can gaps appear between polls?
Yes if your poll interval is long or hydration lags. Design for catch-up: compare watermarks, bound how many ids you fetch per tick, and prefer items get for unknown types in the gap.
Other Hacker News endpoints
- SearchGET /v1/hackernews/search
- FeedGET /v1/hackernews/feeds/{feed}
- StoryGET /v1/hackernews/stories/{id}
- Story commentsGET /v1/hackernews/stories/{id}/comments
- ItemGET /v1/hackernews/items/{id}
- Comment contextGET /v1/hackernews/comments/{id}/context
- UserGET /v1/hackernews/users/{username}
- User submissionsGET /v1/hackernews/users/{username}/submissions