Hn Search Content
hn_search_contentSearch Hacker News stories and comments via Algolia. Filterable by content type, author, date range, and minimum points.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number for pagination (0-indexed). | |
| sort | No | Sort order. "relevance" for best match, "date" for most recent first. | relevance |
| tags | No | Filter results by content type. Omit to search all types. | |
| view | No | How much of each hit to return. "full" includes every field. "compact" omits the two body-text fields — `text` and `highlights.text` — which together can repeat a long comment twice per hit; everything else (id, title, url, domain, author, points, comment count, timestamp, parent story, title highlight, matchedWords) is unchanged. Use "compact" to scan many results, then pass a hit id to hn_get_thread to read the body you skipped. | full |
| count | No | Number of results to return. | |
| query | Yes | Search terms. Supports simple keywords — Algolia handles stemming and relevance. Trimmed before searching; blank or whitespace-only input is rejected. | |
| author | No | Filter results to a specific author. Useful for finding a user's posts on a topic (hn_get_user only shows recent submissions). Trimmed before filtering; omit the field to search all authors rather than passing a blank string. | |
| dateRange | No | Filter to a date window. Useful for finding discussions about recent events. | |
| minPoints | No | Minimum score/points. Filters out low-engagement content. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cap | No | The count cap that was applied. | |
| hits | No | Search results ranked by sort order. | |
| page | No | Current page number (0-indexed). | |
| error | No | Present when the call failed. Absent on success. | |
| query | No | The query that was searched. | |
| shown | No | Number of hits returned. | |
| notice | No | Recovery hint when results are empty — names the filters applied, for relaxing the search. Absent on non-empty result pages. | |
| totalHits | No | Total matching results across all pages. | |
| truncated | No | True when the hit list was capped by the count parameter. | |
| totalPages | No | Number of pages Algolia will actually serve for this query. Not derived from totalHits — broad queries report a totalHits far larger than the reachable page range, so paginate against this value. |