Search Hacker News stories and comments
Full-text search over Hacker News stories, comments, polls and jobs with filters for type, author, domain, date range and points. Paginate with `cursor`.
Pricing — $ · min $0.003
Minimum 3 credits ($0.003) per call. Records returned above the minimum bill 1 credit ($0.001) each.
Authorization
bearerAuth UnifAPI API key. Provider credentials are managed by UnifAPI.
In: header
Query Parameters
Full-text search query. Required unless front_page_only, author, domain, or url is set.
1 <= length <= 512Restrict search results to a Hacker News content type. ask_hn: Ask HN posts (questions to the community). show_hn: Show HN posts (projects/work being shared). launch_hn: Launch HN posts (YC-affiliated company launches). Default: all.
Value in
- "all"
- "story"
- "comment"
- "ask_hn"
- "show_hn"
- "launch_hn"
- "job"
- "poll"
Ranking mode. Default: popularity.
Value in
- "popularity"
- "date"
Creation-time window. Default: all.
Value in
- "24h"
- "week"
- "month"
- "year"
- "all"
Hits per page. Must be one of 10, 20, 30, 50. Default: 20. Prefer this over page_size.
1 <= lengthWhen true, restrict results to current front-page items. Allows omitting query.
Value in
- "true"
- "false"
Include story/comment text in searchable fields. Default: true. Set false to search title/URL only.
Value in
- "true"
- "false"
When true, enable prefix matching for query tokens.
Value in
- "true"
- "false"
Enable typo tolerance. Default: true.
Value in
- "true"
- "false"
Restrict search to story URLs matching this domain (e.g. example.com). Can omit query.
1 <= length <= 255Restrict search to story URLs matching this URL substring. Can omit query.
1 <= length <= 2048Minimum points/score filter.
1 <= lengthOpaque pagination cursor from a previous response's pagination.next_cursor. Omit for the first page.
1 <= length <= 16384Header Parameters
Pin the API version an integration was built against (date-based, e.g. 2026-07-01). Omit to use the current version. Public URL paths stay stable and unversioned; breaking changes ship under a new dated version and are announced with Deprecation and Sunset response headers. The served version is echoed in every response's Unifapi-Version header. Policy: https://unifapi.com/versioning.md
"2026-07-01"Value in
- "2026-07-01"
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/hacker-news/search"{ "request_id": "string", "data": [ { "id": 0, "type": "string", "author": "string", "created_at": 0, "title": "string", "text": "string", "url": "string", "score": 0, "comment_count": 0, "story_id": 0, "parent_id": 0, "tags": [ "string" ], "item_url": "string" } ], "pagination": { "has_more": true, "next_cursor": "string" }, "billing": { "credits_charged": 0, "records_charged": 0, "balance_remaining": 0, "truncated_due_to_balance": true }}