Hacker News

Search Hacker News

Search Hacker News by keyword.

get/v1/hackernews/search

Request

  • Base URL: https://api.socialfetch.dev
  • URL: https://api.socialfetch.dev/v1/hackernews/search
  • Auth: one of:
    • API key in header x-api-key
    • none

Query parameters

querystring

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

type'all' | 'story' | 'comment' | 'ask_hn' | 'show_hn' | 'launch_hn' | 'job' | 'poll'

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.

sort'popularity' | 'date'

Ranking mode. Default: popularity.

dateRange'24h' | 'week' | 'month' | 'year' | 'all'

Creation-time window. Default: all.

pageinteger nullable

Zero-based page index (maximum 50 pages, up to 1,000 hits).

10
OR
20
OR
30
OR
50
frontPageOnlyboolean

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

searchStoryTextboolean

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

searchAuthorboolean

When true, include author username in the searchable fields.

prefixboolean

When true, enable prefix matching for query tokens.

typoToleranceboolean

Enable typo tolerance. Default: true.

authorstring

Restrict results to items by this Hacker News username.

domainstring

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

urlstring

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

minPointsinteger nullable

Minimum points/score filter.

Response

Hacker News search results.

Changes

No recorded changes to this operation across all 1 revision of this API.