Hacker News User Favorites API
Page public HN favorites for a username — or get a typed private_or_unavailable when the favorites list is not public.
GET /v1/hackernews/users/{username}/favorites1 credit per successful request.
About this endpoint
Public favorites are a rare signal: the stories and comments someone chose to save, not just vote on. HN does not expose favorites through the same public JSON paths as items — only the HTML favorites page — so most scrapers either skip the signal or break when markup shifts. Private favorites must stay typed misses, not empty success pages.
`GET /v1/hackernews/users/{username}/favorites` lists public favorites for a case-sensitive username. Optional one-based `page` (default 1) pages the HTML favorites list. On `found`, `data.items` are hydrated favorites and `data.page` reports returned and hasMore. When favorites are private or unavailable, `lookupStatus` is `private_or_unavailable` with empty items — not a fake empty found page. Upvoted pages are not supported.
Credit pricing for this operation comes from the API registry and appears on this page, and `meta.creditsCharged` is the billing source of truth. Always branch on `lookupStatus` before treating the list as public favorites.
Hacker News User Favorites API FAQ
How do I list a Hacker News user's public favorites?
Call GET /v1/hackernews/users/{username}/favorites with your Social Fetch API key in the x-api-key header. Pass the case-sensitive username. Optionally set page (one-based). Read data.lookupStatus before data.items.
How many credits does listing favorites 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.
What does private_or_unavailable mean?
The username may exist, but favorites are not publicly scrapable (private favorites or an unavailable page). data.items is empty and page is null. Do not treat this as found with zero favorites — branch on lookupStatus explicitly.
Are upvoted items supported?
No. This route covers the public favorites path family only. Upvoted pages are not supported.
How does pagination work on favorites?
Pass a one-based page query param (default 1). When data.page.hasMore is true, request the next page number. Each successful page is a separate billed request.
Favorites vs submissions vs comments?
Favorites are items the user saved publicly. Submissions are stories/polls/jobs they authored. Comments are their reply stream. Use the matching path under /users/{username}/ for each signal.
Does HTTP 200 always mean favorites were returned?
No. HTTP 200 means the request finished. Check lookupStatus: found, not_found, or private_or_unavailable. Persist meta.requestId when you need to debug a miss.
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