{"openapi":"3.0.0","info":{"title":"Hacker News Stories Jobs and Comments","version":"1.0.0","description":"Hacker News stories, Ask HN, Show HN, jobs, polls and nested comments by keyword search, live feeds or item IDs, one row per entity."},"servers":[{"url":"https://ah-hackernews-com.opendata.best/s/hackernews-com"}],"paths":{"/v1/search":{"post":{"operationId":"search","summary":"Search Hacker News stories, jobs and comments","description":"Keyword search across Hacker News posts and comments with optional author profile enrichment.","tags":["search"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"searchQuery":{"type":"string","description":"Search keyword. Keyword or phrase to search on Hacker News. When set, Specific item IDs and Hacker News feeds are ignored; clear it to use those inputs.","example":"AI"},"recordTypes":{"type":"array","items":{"type":"string"},"description":"Record types to keep. Choose which item types to keep as rows: story, comment, job, poll, or pollopt. Applies to search, feed, and item-ID modes.","default":["story","comment","job","poll","pollopt"],"example":["story","comment","job","poll","pollopt"]},"enrichDetails":{"type":"boolean","description":"Enrich public author profiles. Add website and social links from public author profiles, without creating extra profile rows. Limited to 25 distinct authors and about 20 seconds per collection part of up to 70 rows; gaps are recorded in leadAbsences.","default":true,"example":true},"skipNoLeads":{"type":"boolean","description":"Only keep records with outreach clues. When enabled, omit records without an email, phone, location, organization, website, or social profile. Author username alone does not count as an outreach clue.","default":false,"example":false},"maxFetches":{"type":"integer","minimum":1,"maximum":5000,"description":"Maximum candidate reads. Most candidate items to read per collection part of up to 70 rows; must be at least Maximum rows per search, feed, or item ID. Reading stops once the row allowance is filled; public profile enrichment has a separate 25-author and 20-second limit.","default":500},"maxResults":{"type":"integer","minimum":1,"maximum":20,"description":"Max rows per input (each listed URL, ID or keyword; a single target counts as one input). All row types share this allowance. Each plan caps the rows of one request (BASIC 10, PRO 70, ULTRA 200, MEGA 500); larger values are lowered to your plan's cap. You pay per delivered row (Rows).","default":10,"example":3},"requestId":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,80}$","description":"Optional. Your id for this request: repeating it while the job runs returns the same job."}}},"example":{"searchQuery":"AI","enrichDetails":false,"maxResults":3}}}},"responses":{"200":{"description":"Done within the request: the rows.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RowsPage"}}}},"404":{"description":"No results matched the query (nothing was billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid or missing parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"At capacity, too many running jobs, or rolling 24-hour row limit reached; retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The source could not be collected this time (not billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Synchronous timeout reached before completion; task cancelled (nothing was billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/feeds":{"post":{"operationId":"feeds","summary":"Live Hacker News feeds (top, new, best, ask, show, job)","description":"Collect live posts and optional comment or poll descendants from selected Hacker News feeds.","tags":["feeds"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"feeds":{"type":"array","items":{"type":"string"},"description":"Hacker News feeds. Choose live feeds: top, new, best, ask, show, or job. Used when Search keyword and Specific item IDs are both empty.","example":["top","new","best","ask","show","job"]},"recordTypes":{"type":"array","items":{"type":"string"},"description":"Record types to keep. Choose which item types to keep as rows: story, comment, job, poll, or pollopt. Applies to search, feed, and item-ID modes.","default":["story","comment","job","poll","pollopt"],"example":["story","comment","job","poll","pollopt"]},"includeDescendants":{"type":"boolean","description":"Include comment and poll descendants. Add separate comment and poll-option rows beneath selected roots in feed or item-ID mode, up to Maximum descendant depth. Each added row is billed like any other row; search mode returns matching rows without expanding threads.","default":false,"example":false},"maxDepth":{"type":"integer","minimum":0,"maximum":10,"description":"Maximum descendant depth. Depth below each selected root to traverse when descendants are enabled. A root has depth 0. Not used in keyword-search mode.","default":2},"enrichDetails":{"type":"boolean","description":"Enrich public author profiles. Add website and social links from public author profiles, without creating extra profile rows. Limited to 25 distinct authors and about 20 seconds per collection part of up to 70 rows; gaps are recorded in leadAbsences.","default":true,"example":true},"skipNoLeads":{"type":"boolean","description":"Only keep records with outreach clues. When enabled, omit records without an email, phone, location, organization, website, or social profile. Author username alone does not count as an outreach clue.","default":false,"example":false},"maxFetches":{"type":"integer","minimum":1,"maximum":5000,"description":"Maximum candidate reads. Most candidate items to read per collection part of up to 70 rows; must be at least Maximum rows per search, feed, or item ID. Reading stops once the row allowance is filled; public profile enrichment has a separate 25-author and 20-second limit.","default":500},"maxResults":{"type":"integer","minimum":1,"maximum":20,"description":"Max rows per input (each listed URL, ID or keyword; a single target counts as one input). All row types share this allowance. Each plan caps the rows of one request (BASIC 10, PRO 70, ULTRA 200, MEGA 500); larger values are lowered to your plan's cap. You pay per delivered row (Rows).","default":10,"example":3},"requestId":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,80}$","description":"Optional. Your id for this request: repeating it while the job runs returns the same job."}}},"example":{"feeds":["top"],"enrichDetails":false,"maxResults":3}}}},"responses":{"200":{"description":"Done within the request: the rows.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RowsPage"}}}},"404":{"description":"No results matched the query (nothing was billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid or missing parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"At capacity, too many running jobs, or rolling 24-hour row limit reached; retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The source could not be collected this time (not billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Synchronous timeout reached before completion; task cancelled (nothing was billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/items":{"post":{"operationId":"items","summary":"Hacker News items and comment trees by item ID","description":"Read specific Hacker News item IDs and optional nested comment or poll option rows.","tags":["items"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"itemIds":{"type":"array","items":{"type":"string"},"description":"Specific item IDs (optional). Positive Hacker News item IDs (the number after item?id= in a news.ycombinator.com link), used when Search keyword is empty. Ignored when Search keyword is set (they are not collected or billed). Each item ID gets its own Maximum rows per search, feed, or item ID."},"recordTypes":{"type":"array","items":{"type":"string"},"description":"Record types to keep. Choose which item types to keep as rows: story, comment, job, poll, or pollopt. Applies to search, feed, and item-ID modes.","default":["story","comment","job","poll","pollopt"],"example":["story","comment","job","poll","pollopt"]},"includeDescendants":{"type":"boolean","description":"Include comment and poll descendants. Add separate comment and poll-option rows beneath selected roots in feed or item-ID mode, up to Maximum descendant depth. Each added row is billed like any other row; search mode returns matching rows without expanding threads.","default":false,"example":false},"maxDepth":{"type":"integer","minimum":0,"maximum":10,"description":"Maximum descendant depth. Depth below each selected root to traverse when descendants are enabled. A root has depth 0. Not used in keyword-search mode.","default":2},"enrichDetails":{"type":"boolean","description":"Enrich public author profiles. Add website and social links from public author profiles, without creating extra profile rows. Limited to 25 distinct authors and about 20 seconds per collection part of up to 70 rows; gaps are recorded in leadAbsences.","default":true,"example":true},"skipNoLeads":{"type":"boolean","description":"Only keep records with outreach clues. When enabled, omit records without an email, phone, location, organization, website, or social profile. Author username alone does not count as an outreach clue.","default":false,"example":false},"maxFetches":{"type":"integer","minimum":1,"maximum":5000,"description":"Maximum candidate reads. Most candidate items to read per collection part of up to 70 rows; must be at least Maximum rows per search, feed, or item ID. Reading stops once the row allowance is filled; public profile enrichment has a separate 25-author and 20-second limit.","default":500},"maxResults":{"type":"integer","minimum":1,"maximum":20,"description":"Max rows per input (each listed URL, ID or keyword; a single target counts as one input). All row types share this allowance. Each plan caps the rows of one request (BASIC 10, PRO 70, ULTRA 200, MEGA 500); larger values are lowered to your plan's cap. You pay per delivered row (Rows).","default":10,"example":3},"requestId":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,80}$","description":"Optional. Your id for this request: repeating it while the job runs returns the same job."}}},"example":{"itemIds":["8863"],"enrichDetails":false,"maxResults":3}}}},"responses":{"200":{"description":"Done within the request: the rows.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RowsPage"}}}},"404":{"description":"No results matched the query (nothing was billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Invalid or missing parameters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"At capacity, too many running jobs, or rolling 24-hour row limit reached; retry after Retry-After seconds.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The source could not be collected this time (not billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"504":{"description":"Synchronous timeout reached before completion; task cancelled (nothing was billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/health":{"get":{"operationId":"health","summary":"API health check","description":"Lightweight readiness check for this API. Never starts a collection and always bills 0 rows.","tags":["health"],"responses":{"200":{"description":"API is operational (0 rows).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthStatus"}}}},"503":{"description":"API is temporarily unavailable (not billed).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthStatus"}}}}}}}},"components":{"schemas":{"Row":{"type":"object","properties":{"itemId":{"type":"string"},"rowType":{"type":"string","enum":["story","comment","job","poll","pollopt"]},"id":{"type":"string"},"type":{"type":"string","enum":["story","comment","job","poll","pollopt"]},"by":{"nullable":true,"type":"string"},"time":{"nullable":true,"type":"integer"},"createdAt":{"nullable":true,"type":"string"},"title":{"nullable":true,"type":"string"},"text":{"nullable":true,"type":"string"},"url":{"nullable":true,"type":"string"},"hnUrl":{"type":"string"},"parentId":{"nullable":true,"type":"string"},"kids":{"nullable":true,"type":"array","description":"Direct child item IDs, limited to the first 50; an empty array means no children. Null in keyword-search rows because child lists are not available there.","items":{"type":"string"}},"kidsCount":{"nullable":true,"type":"integer","description":"Total direct children before truncation, including zero when there are none. Null in keyword-search rows; descendants is the published total comment count when available."},"parts":{"nullable":true,"type":"array","description":"Poll-option item IDs, limited to the first 50; an empty array means no options. Null in keyword-search rows because option lists are not available there.","items":{"type":"string"}},"partsCount":{"nullable":true,"type":"integer","description":"Total poll options before truncation, including zero when there are none. Null in keyword-search rows."},"rootTitle":{"nullable":true,"type":"string"},"score":{"nullable":true,"type":"integer"},"descendants":{"nullable":true,"type":"integer"},"deleted":{"type":"boolean"},"dead":{"type":"boolean"},"sourceFeeds":{"type":"array","items":{"type":"string"}},"rootItemId":{"type":"string"},"depth":{"nullable":true,"type":"integer","description":"Distance from rootItemId (0 for the root). In keyword-search mode story/job/poll hits are 0 and comment/pollopt hits are null because the search source does not give their depth."},"sourceSearchQuery":{"nullable":true,"type":"string"},"searchRank":{"nullable":true,"type":"integer"},"source":{"type":"string","enum":["hacker-news-firebase","hacker-news-algolia-search"]},"scrapedAt":{"type":"string"},"phones":{"type":"array","description":"Currently empty because phone extraction is not verified. Numeric item IDs, dates, versions, and time-zone offsets are not treated as phone numbers.","items":{"type":"object","properties":{"value":{"type":"string"},"type":{"type":"string"},"e164":{"nullable":true,"type":"string"}},"additionalProperties":false}},"emails":{"type":"array","description":"Public email addresses attributable to the item author. The Hacker News platform footer address is excluded.","items":{"type":"object","properties":{"value":{"type":"string"},"type":{"type":"string"}},"additionalProperties":false}},"address":{"type":"object","description":"Explicit public Location text. unit is the street or door number; street, unit, and postalCode are currently unverified.","properties":{"street":{"nullable":true,"type":"string","description":"Street name when explicitly present; currently unverified."},"unit":{"nullable":true,"type":"string","description":"Street or door number when explicitly present; currently unverified."},"locality":{"nullable":true,"type":"string","description":"Locality parsed from an explicit public Location line."},"region":{"nullable":true,"type":"string","description":"Region parsed from an explicit public Location line."},"postalCode":{"nullable":true,"type":"string","description":"Postal code when explicitly present; currently unverified."},"country":{"nullable":true,"type":"string","description":"Country parsed from an explicit public Location line."},"full":{"nullable":true,"type":"string","description":"Original normalized public Location value."}},"additionalProperties":false},"geo":{"nullable":true,"type":"object","description":"Structured coordinates when supplied by the source. Current measured Hacker News surfaces do not provide them.","properties":{"lat":{"nullable":true,"type":"number"},"lng":{"nullable":true,"type":"number"}},"additionalProperties":false},"person":{"nullable":true,"type":"object","description":"Attributable Hacker News username and a public role when present. role is a text-extraction heuristic, not a structured field. Conservative extraction from explicit self-descriptions; unrecognized or ambiguous roles remain null.","properties":{"name":{"type":"string"},"role":{"nullable":true,"type":"string","description":"Conservative extraction from explicit self-descriptions; unrecognized or ambiguous roles remain null."}},"additionalProperties":false},"org":{"nullable":true,"type":"object","description":"Hiring organization parsed from an organization-bearing Hacker News job title.","properties":{"name":{"type":"string"},"id":{"nullable":true,"type":"string"}},"additionalProperties":false},"web":{"type":"object","description":"Attributable websites and social profiles from comment text, public author profiles, or job careers links. Profile enrichment is limited to 25 distinct authors and about 20 seconds per collection part of up to 70 rows.","properties":{"website":{"nullable":true,"type":"string"},"socials":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"leadSource":{"type":"string","description":"Where contact clues appeared. Current rows use search for search results, entity for jobs collected by feed or ID, and detail for other items collected by feed or ID.","enum":["search","detail","entity","contact","reveal-xhr"]},"leadReveal":{"type":"string","description":"How the lead was disclosed. Current Hacker News lead values are visible public content or absent.","enum":["visible","click","xhr","gated","image","absent"]},"leadAbsences":{"type":"object","description":"Per-field honest reasons for missing or unverified lead values.","additionalProperties":{"type":"string"}}},"additionalProperties":true,"description":"One collected entity. Field availability depends on rowType and the source. Fields always present (a|b = at least one of them): every row: id, hnUrl; rowType=story: id, title, hnUrl."},"Error":{"type":"object","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"}}},"ErrorDetail":{"type":"object","required":["code","message","retryable"],"properties":{"code":{"type":"string","example":"invalid_input"},"message":{"type":"string"},"retryable":{"type":"boolean"}}},"JobStatus":{"type":"object","properties":{"jobId":{"type":"string"},"status":{"type":"string","enum":["queued","running","succeeded","partial","failed","cancelled"]},"done":{"type":"boolean"},"rowsAvailable":{"type":"integer"},"rowsDelivered":{"type":"integer","description":"Rows already delivered (and billed) to you for this job."},"rowsLimit":{"type":"integer","description":"Most rows this job can deliver."},"estimatedFinishSec":{"type":"integer","description":"While running: estimated seconds until done."},"statusUrl":{"type":"string"},"resultsUrl":{"type":"string"},"expiresAt":{"type":"string","format":"date-time"},"retentionHours":{"type":"integer"},"error":{"$ref":"#/components/schemas/ErrorDetail"}}},"RowsPage":{"allOf":[{"$ref":"#/components/schemas/JobStatus"},{"type":"object","properties":{"offset":{"type":"integer"},"nextOffset":{"type":"integer"},"hasMore":{"type":"boolean"},"rowCount":{"type":"integer"},"rowsBilled":{"type":"integer","description":"Rows delivered by this response."},"rows":{"type":"array","items":{"$ref":"#/components/schemas/Row"}},"meta":{"type":"object","additionalProperties":true}}}]},"HealthStatus":{"type":"object","required":["ok","site","status","endpoints","rowsBilled"],"properties":{"ok":{"type":"boolean"},"site":{"type":"string"},"status":{"type":"string","enum":["operational","unavailable"]},"endpoints":{"type":"array","items":{"type":"string"}},"rowsBilled":{"type":"integer"}}}}}}