Search

hackernews.search
ActionBusiness appsconnection required

Calls the Hacker News API with the connection's credentials.

Search every Hacker News story, comment, poll and job by text, tag or numeric condition.

Connection

Required
Yes — the node will not save without one
Auth type
No auth
Providers
Hacker News
Secret shape
no credential — the Hacker News API is public; the connection is a pair of hosts
Config it needs
base_url, search_base_url
Resolved by
config.connection_id, else node.connection_id

Configuration

6 fields, none required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.

FieldTypeRequiredDefaultConstraintsExample
query
The words to search for across titles, story text and comments.
stringNo——postgres
tags
Filter by kind or relationship using the search index's own tags: story, comment, poll, pollopt, show_hn, ask_hn, front_page, author_USERNAME or story_ID. Commas are ANDed; parentheses OR, so 'author_pg,(story,poll)' means posted by pg AND a story or a poll.
stringNo——story
numeric_filters
Filter on a numeric field with <, <=, =, > or >=, comma-separated. The fields are created_at_i (a Unix timestamp), points and num_comments — for example 'points>100,created_at_i>1700000000'.
stringNo——points>100
sort
How to order the results: 'relevance' ranks by relevance then points then comment count, 'date' returns the most recent first.
stringNorelevanceone of "relevance", "date"—
page
Which page of results to return, counting from zero.
numberNo0≥ 0—
hits_per_page
How many hits to return on the page; the default is 20.
numberNo201–1000—
  • At least one of query, tags must be set.

Example configuration

Every value below is the contract’s own example or default — nothing invented.

{
  "hits_per_page": 20,
  "numeric_filters": "points>100",
  "page": 0,
  "query": "postgres",
  "sort": "relevance",
  "tags": "story"
}

Output

One shape.

result

FieldTypeExample
hits
The matching items on this page, in the requested order.
array—
count
How many hits this page carried.
number—
sort
Which ordering was used: relevance or date.
string—
nbHits
How many items matched in total, across all pages.
number—
nbPages
How many pages the result set spans.
number—
page
Which page this is, counting from zero.
number—
hitsPerPage
How many hits one page holds.
number—
query
The query text that was searched for.
string—
hits[].objectID
The item's Hacker News id, as a string.
string—
hits[].title
The story title, when the hit is a story.
string—
hits[].url
The story's link, when it has one.
string—
hits[].author
The username who posted the item.
string—
hits[].points
The item's score at index time.
number—
hits[].num_comments
How many comments the story had at index time.
number—
hits[].story_text
The body of a text post.
string—
hits[].comment_text
The body of a comment.
string—
hits[].created_at_i
When the item was created, as a Unix timestamp.
number—
hits[]._tags
The tags Algolia indexed the item under.
array—
{
  "count": 0,
  "hits": [
    {
      "_tags": [],
      "author": "",
      "comment_text": "",
      "created_at_i": 0,
      "num_comments": 0,
      "objectID": "",
      "points": 0,
      "story_text": "",
      "title": "",
      "url": ""
    }
  ],
  "hitsPerPage": 0,
  "nbHits": 0,
  "nbPages": 0,
  "page": 0,
  "query": "",
  "sort": ""
}

Notes

  • Search is a separate service Algolia runs for Hacker News, not the official API, and it limits one IP to 10,000 requests per hour.
  • A tag filter alone is a valid search: 'front_page' with no query returns whatever is on the front page right now.

See Search run in a workflow.

In a technical demo we add the Hacker News connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.