Skip to main content

Hacker News

Connects to the public Hacker News (Firebase) API and the Algolia HN Search API. An agent can fetch top stories, look up a specific item (story, comment, or job), search stories/comments, and browse current Ask HN / Show HN posts.

Add to an agent node's tools array with _node_type: "tool-hackernews". See Connector Reference — How connectors are used.

Authentication

No credentials are required — Hacker News exposes a fully public API.

{
"name": "hackernews",
"_node_type": "tool-hackernews"
}

Tools

hn_top_stories

Get the current top stories from Hacker News.

Parameters

ParameterTypeRequiredDescription
countnumberNoNumber of top stories to return (default 10, capped at 30)

Returns: A numbered list separated by blank lines, each as N. **title** (↑score | N comments)\n url (falls back to the HN discussion URL if the story has no external URL).

hn_get_item

Get details of a Hacker News item (story, comment, or job).

Parameters

ParameterTypeRequiredDescription
item_idnumberYesHacker News item ID

Returns: For story/job items: **title** by u/author\n↑score | N comments\nURL: <url>\nHN: <hnUrl>\n\n<text>. For comment items: Comment by **u/author** (↑score)\nHN: <hnUrl>\n\n<text>. For other item types: the raw item as indented JSON. Returns "Item not found." if the item doesn't exist.

Search Hacker News stories and comments using Algolia.

Parameters

ParameterTypeRequiredDescription
querystringYesSearch query
typestringNoResult type: story, comment (default story)
sortstringNoSort by: relevance or date (default relevance)
num_itemsnumberNoNumber of results (default 10)

Returns: A numbered list separated by blank lines, each as N. **title** by u/author (↑points)\n url (comment hits use a truncated comment text as the title, capped at 100 characters). Returns "No results found." if there are no matches.

hn_ask_hn

Get current Ask HN posts from Hacker News.

Parameters

ParameterTypeRequiredDescription
countnumberNoNumber of Ask HN posts (default 10)

Returns: A numbered list separated by blank lines, each as N. **title** (↑score | N comments)\n https://news.ycombinator.com/item?id=<id>.

hn_show_hn

Get current Show HN posts from Hacker News.

Parameters

ParameterTypeRequiredDescription
countnumberNoNumber of Show HN posts (default 10)

Returns: A numbered list separated by blank lines, each as N. **title** (↑score)\n url (falls back to the HN discussion URL if the post has no external URL).

Next