UnifAPI Docs

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.

GET
/hacker-news/search

Authorization

bearerAuth
AuthorizationBearer <token>

UnifAPI API key. Provider credentials are managed by UnifAPI.

In: header

Query Parameters

query?string

Full-text search query. Required unless front_page_only, author, domain, or url is set.

Length1 <= length <= 512
type?string

Restrict 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"
sort?string

Ranking mode. Default: popularity.

Value in

  • "popularity"
  • "date"
date_range?string

Creation-time window. Default: all.

Value in

  • "24h"
  • "week"
  • "month"
  • "year"
  • "all"
limit?string

Hits per page. Must be one of 10, 20, 30, 50. Default: 20. Prefer this over page_size.

Length1 <= length
front_page_only?string

When true, restrict results to current front-page items. Allows omitting query.

Value in

  • "true"
  • "false"
search_story_text?string

Include story/comment text in searchable fields. Default: true. Set false to search title/URL only.

Value in

  • "true"
  • "false"
search_author?string

When true, include author username in the searchable fields.

Value in

  • "true"
  • "false"
prefix?string

When true, enable prefix matching for query tokens.

Value in

  • "true"
  • "false"
typo_tolerance?string

Enable typo tolerance. Default: true.

Value in

  • "true"
  • "false"
author?string

Restrict results to items by this Hacker News username.

Length1 <= length <= 255
domain?string

Restrict search to story URLs matching this domain (e.g. example.com). Can omit query.

Length1 <= length <= 255
url?string

Restrict search to story URLs matching this URL substring. Can omit query.

Length1 <= length <= 2048
min_points?string

Minimum points/score filter.

Length1 <= length
cursor?string

Opaque pagination cursor from a previous response's pagination.next_cursor. Omit for the first page.

Length1 <= length <= 16384

Header Parameters

Unifapi-Version?"2026-07-01"

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

Default"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  }}