# Hacker News on Onekey > 25 endpoints for Hacker News (25 stable, 0 beta), 1 to 5 credits each. Category: Messaging & communities. One key, one JSON shape. Base URL: https://api.onekey.dev Auth: header `x-api-key: `. Call shape: `GET /v1/{platform}/{endpoint}?{params}`. Every response is `{success, data, metadata, error}`; check `success` first. Cost is in `metadata.credits_charged`. Free when served from cache (0.2 credit for a cached response over 100 KB). Failed and not-found calls are refunded. Status: stable = verified against the live source; beta = not yet verified, fields may be missing. Page: https://onekey.dev/platforms/hackernews Reference (Markdown): https://onekey.dev/docs/api/hackernews.md All docs: https://onekey.dev/llms.txt ## Canonical fields returned Unified-schema fields (same names on every platform), with how many of the 25 mapped Hacker News endpoints return each: - `content.id` (string): 23 - `author.username` (string): 17 - `content.createdAt` (ISO 8601 date): 15 - `content.text` (string): 15 - `content.title` (string): 14 - `content.url` (URL): 14 - `engagement.likes` (integer): 14 - `engagement.comments` (integer): 10 - `content.threadId` (string): 3 - `author.id` (string): 2 - `content.parentId` (string): 1 - `content.type` (string): 1 - plus 1 platform-specific field under `ext.` ## Endpoints ### hackernews.ask_hn Latest Ask HN posts. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/hackernews/ask_hn` with header `x-api-key: YOUR_API_KEY` - Parameters: - `cursor` (string, optional): Opaque cursor from a previous response's `pagination.next_cursor`. Omit for the first page. - Fields returned: `content.id`, `author.username`, `content.title`, `content.url`, `content.text`, `content.createdAt`, `engagement.likes`, `engagement.comments` - Reference: https://onekey.dev/docs/api/hackernews/ask_hn.md ### hackernews.askstories Latest Ask HN story ids. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/hackernews/askstories` with header `x-api-key: YOUR_API_KEY` - Parameters: none - Fields returned: `content.id` - Reference: https://onekey.dev/docs/api/hackernews/askstories.md ### hackernews.author_comments Comments written by a Hacker News user. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/hackernews/author_comments?user=pg` with header `x-api-key: YOUR_API_KEY` - Parameters: - `user` (string, required): Hacker News username, e.g. pg - `cursor` (string, optional): Opaque cursor from a previous response's `pagination.next_cursor`. Omit for the first page. - Fields returned: `content.id`, `author.username`, `content.title`, `content.url`, `content.text`, `content.createdAt`, `content.threadId`, `engagement.likes` - Reference: https://onekey.dev/docs/api/hackernews/author_comments.md ### hackernews.author_submissions Stories submitted by a Hacker News user. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/hackernews/author_submissions?user=pg` with header `x-api-key: YOUR_API_KEY` - Parameters: - `user` (string, required): Hacker News username, e.g. pg - `cursor` (string, optional): Opaque cursor from a previous response's `pagination.next_cursor`. Omit for the first page. - Fields returned: `content.id`, `author.username`, `content.title`, `content.url`, `content.text`, `content.createdAt`, `engagement.likes`, `engagement.comments` - Reference: https://onekey.dev/docs/api/hackernews/author_submissions.md ### hackernews.beststories Best story ids on Hacker News. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/hackernews/beststories` with header `x-api-key: YOUR_API_KEY` - Parameters: none - Fields returned: `content.id` - Reference: https://onekey.dev/docs/api/hackernews/beststories.md ### hackernews.front_page Hacker News front page (Algolia). - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/hackernews/front_page` with header `x-api-key: YOUR_API_KEY` - Parameters: - `cursor` (string, optional): Opaque cursor from a previous response's `pagination.next_cursor`. Omit for the first page. - Fields returned: `content.id`, `author.username`, `content.title`, `content.url`, `content.text`, `content.createdAt`, `engagement.likes`, `engagement.comments` - Reference: https://onekey.dev/docs/api/hackernews/front_page.md ### hackernews.item A Hacker News item (Algolia, with points and counts). - Price: 1 credit per fresh call. Status: stable. Returns: one record. - Request: `GET https://api.onekey.dev/v1/hackernews/item?id=8863` with header `x-api-key: YOUR_API_KEY` - Parameters: - `id` (string, required): Item id - Fields returned: `content.id`, `author.username`, `content.title`, `content.url`, `content.text`, `content.createdAt`, `engagement.likes` - Reference: https://onekey.dev/docs/api/hackernews/item.md ### hackernews.item_comments Top-level comments of a Hacker News item (children of the comment tree). - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/hackernews/item_comments?id=8863` with header `x-api-key: YOUR_API_KEY` - Parameters: - `id` (string, required): Item id - Fields returned: `content.id`, `author.username`, `content.text`, `content.createdAt`, `content.parentId` - Reference: https://onekey.dev/docs/api/hackernews/item_comments.md ### hackernews.item_firebase A Hacker News item (official Firebase API). - Price: 1 credit per fresh call. Status: stable. Returns: one record. - Request: `GET https://api.onekey.dev/v1/hackernews/item_firebase?id=8863` with header `x-api-key: YOUR_API_KEY` - Parameters: - `id` (string, required): Item id - Fields returned: `content.id`, `author.username`, `content.title`, `content.url`, `content.text`, `content.createdAt`, `engagement.likes`, `engagement.comments`, `content.type` - Reference: https://onekey.dev/docs/api/hackernews/item_firebase.md ### hackernews.jobs Hacker News job posts. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/hackernews/jobs` with header `x-api-key: YOUR_API_KEY` - Parameters: - `cursor` (string, optional): Opaque cursor from a previous response's `pagination.next_cursor`. Omit for the first page. - Fields returned: `content.id`, `author.username`, `content.title`, `content.url`, `content.text`, `content.createdAt`, `engagement.likes`, `engagement.comments` - Reference: https://onekey.dev/docs/api/hackernews/jobs.md ### hackernews.jobstories Latest job story ids. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/hackernews/jobstories` with header `x-api-key: YOUR_API_KEY` - Parameters: none - Fields returned: `content.id` - Reference: https://onekey.dev/docs/api/hackernews/jobstories.md ### hackernews.maxitem Current maximum Hacker News item id. - Price: 1 credit per fresh call. Status: stable. Returns: one record. - Request: `GET https://api.onekey.dev/v1/hackernews/maxitem` with header `x-api-key: YOUR_API_KEY` - Parameters: none - Fields returned: `content.id` - Reference: https://onekey.dev/docs/api/hackernews/maxitem.md ### hackernews.newstories Newest story ids on Hacker News. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/hackernews/newstories` with header `x-api-key: YOUR_API_KEY` - Parameters: none - Fields returned: `content.id` - Reference: https://onekey.dev/docs/api/hackernews/newstories.md ### hackernews.polls Hacker News polls. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/hackernews/polls` with header `x-api-key: YOUR_API_KEY` - Parameters: - `cursor` (string, optional): Opaque cursor from a previous response's `pagination.next_cursor`. Omit for the first page. - Fields returned: `content.id`, `author.username`, `content.title`, `content.url`, `content.text`, `content.createdAt`, `engagement.likes`, `engagement.comments` - Reference: https://onekey.dev/docs/api/hackernews/polls.md ### hackernews.search Search Hacker News stories by keyword. - Price: 1 credit per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/hackernews/search?q=startup` with header `x-api-key: YOUR_API_KEY` - Parameters: - `q` (string, required): Search query - `cursor` (string, optional): Opaque cursor from a previous response's `pagination.next_cursor`. Omit for the first page. - Fields returned: `author.id`, `content.id`, `author.username`, `engagement.likes`, `engagement.comments`, `content.title`, `content.url`, `content.createdAt` - Reference: https://onekey.dev/docs/api/hackernews/search.md ### hackernews.search_by_date Search Hacker News stories, newest first. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/hackernews/search_by_date?q=startup` with header `x-api-key: YOUR_API_KEY` - Parameters: - `q` (string, required): Search query - `cursor` (string, optional): Opaque cursor from a previous response's `pagination.next_cursor`. Omit for the first page. - Fields returned: `content.id`, `author.username`, `content.title`, `content.url`, `content.text`, `content.createdAt`, `engagement.likes`, `engagement.comments` - Reference: https://onekey.dev/docs/api/hackernews/search_by_date.md ### hackernews.search_comments Search Hacker News comments. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/hackernews/search_comments?q=rust` with header `x-api-key: YOUR_API_KEY` - Parameters: - `q` (string, required): Search query - `cursor` (string, optional): Opaque cursor from a previous response's `pagination.next_cursor`. Omit for the first page. - Fields returned: `content.id`, `author.username`, `content.title`, `content.url`, `content.text`, `content.createdAt`, `content.threadId`, `engagement.likes` - Reference: https://onekey.dev/docs/api/hackernews/search_comments.md ### hackernews.search_url Stories that link to a URL or domain. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/hackernews/search_url?q=github.com` with header `x-api-key: YOUR_API_KEY` - Parameters: - `q` (string, required): Domain or URL fragment, e.g. github.com - `cursor` (string, optional): Opaque cursor from a previous response's `pagination.next_cursor`. Omit for the first page. - Fields returned: `content.id`, `author.username`, `content.title`, `content.url`, `content.text`, `content.createdAt`, `engagement.likes`, `engagement.comments` - Reference: https://onekey.dev/docs/api/hackernews/search_url.md ### hackernews.show_hn Latest Show HN posts. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/hackernews/show_hn` with header `x-api-key: YOUR_API_KEY` - Parameters: - `cursor` (string, optional): Opaque cursor from a previous response's `pagination.next_cursor`. Omit for the first page. - Fields returned: `content.id`, `author.username`, `content.title`, `content.url`, `content.text`, `content.createdAt`, `engagement.likes`, `engagement.comments` - Reference: https://onekey.dev/docs/api/hackernews/show_hn.md ### hackernews.showstories Latest Show HN story ids. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/hackernews/showstories` with header `x-api-key: YOUR_API_KEY` - Parameters: none - Fields returned: `content.id` - Reference: https://onekey.dev/docs/api/hackernews/showstories.md ### hackernews.story_comments Comments of a Hacker News story (flat, newest first). - Price: 1 credit per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/hackernews/story_comments?id=8863` with header `x-api-key: YOUR_API_KEY` - Parameters: - `id` (string, required): Story id - `cursor` (string, optional): Opaque cursor from a previous response's `pagination.next_cursor`. Omit for the first page. - Fields returned: `content.id`, `author.username`, `content.title`, `content.url`, `content.text`, `content.createdAt`, `content.threadId`, `engagement.likes` - Reference: https://onekey.dev/docs/api/hackernews/story_comments.md ### hackernews.topstories Top story ids on Hacker News. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/hackernews/topstories` with header `x-api-key: YOUR_API_KEY` - Parameters: none - Fields returned: `content.id` - Reference: https://onekey.dev/docs/api/hackernews/topstories.md ### hackernews.updated_profiles Recently changed Hacker News usernames. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/hackernews/updated_profiles` with header `x-api-key: YOUR_API_KEY` - Parameters: none - Fields returned: `author.username` - Reference: https://onekey.dev/docs/api/hackernews/updated_profiles.md ### hackernews.updates Recently changed Hacker News item ids. - Price: 5 credits per fresh call. Status: stable. Returns: a list. - Request: `GET https://api.onekey.dev/v1/hackernews/updates` with header `x-api-key: YOUR_API_KEY` - Parameters: none - Fields returned: `content.id` - Reference: https://onekey.dev/docs/api/hackernews/updates.md ### hackernews.user Fetch a Hacker News user profile. - Price: 1 credit per fresh call. Status: stable. Returns: one record. - Request: `GET https://api.onekey.dev/v1/hackernews/user?username=pg` with header `x-api-key: YOUR_API_KEY` - Parameters: - `username` (string, required): HN username (case-sensitive), e.g. pg - Fields returned: `author.id`, `author.username`, `content.text`, `ext.karma` - Reference: https://onekey.dev/docs/api/hackernews/user.md ## Sample request ```bash curl "https://api.onekey.dev/v1/hackernews/item?id=8863" \ -H "x-api-key: YOUR_API_KEY" ```