Compare

Hacker News search vs story comments: which endpoint to call

hackernews.search finds stories and comments by text; hackernews.story_comments returns one story's full thread. What each returns and costs.

The Hacker News endpoints come from two upstreams: HN Search (full-text, by relevance or date) and the official Firebase item API (one item and its thread).

EndpointWhat it doesPriceOutput fields
hackernews.searchFull-text search of Hacker News stories and comments, by relevance or date.$0.0015 per request ($1.50 per 1,000)results, total
hackernews.storyOne Hacker News item (story, comment, job or poll) by id.$0.0015 per request ($1.50 per 1,000)title, points, num_comments, url
hackernews.story_commentsThe full comment thread of a Hacker News story, flattened with depth.$0.0015 per request ($1.50 per 1,000)comments

Which one to call

IfCall
You need stories or comments that mention a wordhackernews.search
You have a story id and need its title, score and linkhackernews.story
You have a story id and need the whole discussionhackernews.story_comments

hackernews.search

curl -s -X POST https://getallapis.com/v1/run/hackernews.search \
  -H "Authorization: Bearer $GETALLAPIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"postgres","limit":10}'

Get an API key. New API keys come with $0.10 of free credit, no card required (limited to 2 keys per network every 30 days). That covers about 66 requests of hackernews.search. Then add credits (packs from $10). No subscription; failed calls are refunded.

Get a free API key Try it in the playground