{"openapi":"3.0.3","info":{"title":"Hacker News API (ReefAPI)","version":"1.2.0","description":"Hacker News API — stories, comments, full comment trees, polls, front-page, user profiles and full-text search across Hacker News (news.ycombinator.com) Call POST /hackernews/v1/{action} with an x-api-key header; every response is the { ok, data, meta, error } envelope.","contact":{"name":"ReefAPI","url":"https://reefapi.com/hackernews-api","email":"support@reefapi.com"},"license":{"name":"ReefAPI Terms","url":"https://reefapi.com/terms"},"termsOfService":"https://reefapi.com/terms"},"externalDocs":{"description":"Hacker News API documentation","url":"https://reefapi.com/docs/hackernews"},"servers":[{"url":"https://api.reefapi.com"}],"security":[{"ApiKeyAuth":[]}],"tags":[{"name":"hackernews","description":"Hacker News API — stories, comments, full comment trees, polls, front-page, user profiles and full-text search across Hacker News (news.ycombinator.com)"}],"paths":{"/hackernews/v1/item":{"post":{"operationId":"hackernews_item","summary":"single item by id (story/comment/job/poll/pollopt) — all official fields + time_iso/kids_count/hn_url; hydrate_kids=resolve top-level comments","description":"single item by id (story/comment/job/poll/pollopt) — all official fields + time_iso/kids_count/hn_url; hydrate_kids=resolve top-level comments","tags":["hackernews"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":8863,"description":"HackerNews item id (story/comment/job/poll/pollopt) — the digits in an item URL (news.ycombinator.com/item?id=...)."},"hydrate_kids":{"type":"boolean","default":false,"example":true,"description":"If true, resolve the item's top-level comments into full objects instead of bare ids."},"kids_limit":{"type":"integer","minimum":1,"maximum":100,"default":30,"example":30,"description":"When hydrate_kids=true, how many top-level comments to resolve (1-100)."}},"required":["id"]},"example":{"id":8863}}}},"responses":{"200":{"description":"Result envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"description":"Missing or invalid x-api-key"},"429":{"description":"Rate limited or quota exhausted"}},"x-reefapi-credits":1}},"/hackernews/v1/item_tree":{"post":{"operationId":"hackernews_item_tree","summary":"full nested comment TREE for a story in ONE call; recursive children + descendants count","description":"full nested comment TREE for a story in ONE call; recursive children + descendants count","tags":["hackernews"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":8863,"description":"HackerNews item id (story/comment/job/poll/pollopt) — the digits in an item URL (news.ycombinator.com/item?id=...)."}},"required":["id"]},"example":{"id":8863}}}},"responses":{"200":{"description":"Result envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"description":"Missing or invalid x-api-key"},"429":{"description":"Rate limited or quota exhausted"}},"x-reefapi-credits":1}},"/hackernews/v1/user":{"post":{"operationId":"hackernews_user","summary":"user profile by id: karma/created/about/submitted; hydrate_submitted=resolve recent submissions","description":"user profile by id: karma/created/about/submitted; hydrate_submitted=resolve recent submissions","tags":["hackernews"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","example":"pg","description":"HackerNews username (case-sensitive), e.g. 'pg'."},"hydrate_submitted":{"type":"boolean","default":false,"example":true,"description":"If true, resolve the user's recent submissions into full objects instead of bare ids."},"submitted_limit":{"type":"integer","minimum":1,"maximum":100,"default":20,"example":20,"description":"When hydrate_submitted=true, how many recent submissions to resolve (1-100)."}},"required":["id"]},"example":{"id":"pg"}}}},"responses":{"200":{"description":"Result envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"description":"Missing or invalid x-api-key"},"429":{"description":"Rate limited or quota exhausted"}},"x-reefapi-credits":1}},"/hackernews/v1/stories":{"post":{"operationId":"hackernews_stories","summary":"story-list (list=top/new/best/ask/show/job) → ranked hydrated stories; offset/limit pagination, hydrate=false for ids only","description":"story-list (list=top/new/best/ask/show/job) → ranked hydrated stories; offset/limit pagination, hydrate=false for ids only","tags":["hackernews"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"list":{"type":"string","enum":["top","new","best","ask","show","job"],"default":"top","example":"top","description":"Which HackerNews story list to return."},"limit":{"type":"integer","minimum":1,"maximum":100,"default":30,"example":30,"description":"Stories to return (1-100, default 30). Out-of-range values are clamped."},"offset":{"type":"integer","minimum":0,"maximum":500,"default":0,"example":0,"description":"Pagination offset into the story list (0-500). Skip N ranked stories."},"hydrate":{"type":"boolean","default":true,"example":true,"description":"If true, resolve each ranked story id into full objects instead of bare ids (default true)."}}},"example":{"list":"top","limit":15}}}},"responses":{"200":{"description":"Result envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"description":"Missing or invalid x-api-key"},"429":{"description":"Rate limited or quota exhausted"}},"x-reefapi-credits":2}},"/hackernews/v1/search":{"post":{"operationId":"hackernews_search","summary":"Full-text search: query + tags(story/comment/ask_hn/show_hn/poll/front_page/author_X/story_X) + min_points/max_points/min_comments/before/after + sort(relevance|date), paginated","description":"Full-text search: query + tags(story/comment/ask_hn/show_hn/poll/front_page/author_X/story_X) + min_points/max_points/min_comments/before/after + sort(relevance|date), paginated","tags":["hackernews"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"type":"string","example":"python","description":"Full-text search keywords. search needs query OR tags."},"tags":{"type":"string","example":"story","description":"Tag filter. Built-ins: story, comment, ask_hn, show_hn, poll, front_page. Dynamic: author_USERNAME, story_ID. Comma-joins = AND, (a,b) = OR. search needs query OR tags."},"sort":{"type":"string","enum":["relevance","date"],"default":"relevance","example":"date","description":"Result ordering: relevance (default) or date (newest first). Any non-date value is treated as relevance."},"page":{"type":"integer","minimum":0,"maximum":50,"default":0,"example":0,"description":"0-based search results page (0-50). Page forward via meta.nbPages."},"hits_per_page":{"type":"integer","minimum":1,"maximum":100,"default":20,"example":20,"description":"Search results per page (1-100, default 20)."},"min_points":{"type":"integer","minimum":0,"example":100,"description":"Minimum score (points) filter for search hits."},"max_points":{"type":"integer","minimum":0,"example":1000,"description":"Maximum score (points) filter for search hits."},"min_comments":{"type":"integer","minimum":0,"example":10,"description":"Minimum comment-count filter for search hits."},"max_comments":{"type":"integer","minimum":0,"example":500,"description":"Maximum comment-count filter for search hits."},"before":{"type":"string","example":"2024-12-31","description":"Only hits created on/before this date. Accepts a unix timestamp or an ISO date (YYYY-MM-DD)."},"after":{"type":"string","example":"2024-01-01","description":"Only hits created on/after this date. Accepts a unix timestamp or an ISO date (YYYY-MM-DD)."},"numeric_filters":{"type":"string","example":"points>100,num_comments>10","description":"Advanced: raw Algolia numericFilters string, appended to the built min/max/date filters (e.g. 'points>100,created_at_i>1700000000')."},"restrict":{"type":"string","example":"title","description":"Advanced: restrictSearchableAttributes — limit matching to given Algolia fields (e.g. 'title' or 'title,story_text')."}}},"example":{"query":"python","tags":"story"}}}},"responses":{"200":{"description":"Result envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"description":"Missing or invalid x-api-key"},"429":{"description":"Rate limited or quota exhausted"}},"x-reefapi-credits":1}},"/hackernews/v1/poll":{"post":{"operationId":"hackernews_poll","summary":"Poll detail by id: the question + every voting option resolved and ranked by votes, with total_votes and the comment count","description":"Poll detail by id: the question + every voting option resolved and ranked by votes, with total_votes and the comment count. (Find poll ids via search with tags=poll.)","tags":["hackernews"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","example":126809,"description":"HackerNews poll id (the digits in a poll's item URL). Find polls with the search action using tags=poll."}},"required":["id"]},"example":{"id":126809}}}},"responses":{"200":{"description":"Result envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"description":"Missing or invalid x-api-key"},"429":{"description":"Rate limited or quota exhausted"}},"x-reefapi-credits":1}},"/hackernews/v1/front_page":{"post":{"operationId":"hackernews_front_page","summary":"Stories that recently made the Hacker News front page (newest-first), paginated","description":"Stories that recently made the Hacker News front page (newest-first), paginated. Optional after/before date window. NOTE: the front-page index only retains ~the last 7 days — it is 'what's on / recently hit the front page', not a historical archive.","tags":["hackernews"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"limit":{"type":"integer","minimum":1,"maximum":100,"default":30,"example":30,"description":"Front-page stories to return (1-100, default 30). Out-of-range values are clamped."},"page":{"type":"integer","minimum":0,"maximum":50,"default":0,"example":0,"description":"0-based search results page (0-50). Page forward via meta.nbPages."},"after":{"type":"string","example":"2026-06-18","description":"Only front-page stories created on/after this date (unix ts or YYYY-MM-DD). Note: the front-page index only retains ~the last 7 days."},"before":{"type":"string","example":"2026-06-21","description":"Only front-page stories created on/before this date (unix ts or YYYY-MM-DD)."}}},"example":{"limit":10}}}},"responses":{"200":{"description":"Result envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"description":"Missing or invalid x-api-key"},"429":{"description":"Rate limited or quota exhausted"}},"x-reefapi-credits":1}},"/hackernews/v1/updates":{"post":{"operationId":"hackernews_updates","summary":"live changefeed: recently changed item ids + profiles + max_item; hydrate=resolve changed items","description":"live changefeed: recently changed item ids + profiles + max_item; hydrate=resolve changed items","tags":["hackernews"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"hydrate":{"type":"boolean","default":false,"example":true,"description":"If true, resolve the changed item ids into full objects instead of bare ids."},"limit":{"type":"integer","minimum":1,"maximum":100,"default":30,"example":30,"description":"Changed items to hydrate (1-100, default 30). Out-of-range values are clamped."}}},"example":{"hydrate":true}}}},"responses":{"200":{"description":"Result envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"description":"Missing or invalid x-api-key"},"429":{"description":"Rate limited or quota exhausted"}},"x-reefapi-credits":1}},"/hackernews/v1/max_item":{"post":{"operationId":"hackernews_max_item","summary":"the current largest item id on Hacker News — the newest id, useful for backfilling / id-range walks","description":"the current largest item id on Hacker News — the newest id, useful for backfilling / id-range walks","tags":["hackernews"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Result envelope","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"401":{"description":"Missing or invalid x-api-key"},"429":{"description":"Rate limited or quota exhausted"}},"x-reefapi-credits":1}}},"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"x-api-key"}},"schemas":{"Envelope":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean"},"data":{"description":"Action result (shape varies per action)"},"meta":{"type":"object","description":"api, endpoint, mode, latency_ms, record_count, completeness_pct"},"error":{"type":"object","nullable":true,"properties":{"code":{"type":"string"},"message":{"type":"string"},"retryable":{"type":"boolean"}}}}}}}}