Hacker News Scraper - Search Stories & Comments avatar

Hacker News Scraper - Search Stories & Comments

Pricing

from $3.00 / 1,000 results

Go to Apify Store
Hacker News Scraper - Search Stories & Comments

Hacker News Scraper - Search Stories & Comments

Search Hacker News stories using the free Algolia HN API. Returns story titles, points, authors, URLs, comment counts, and creation dates. No authentication or browser required — pure JSON API with zero bot-detection risk.

Pricing

from $3.00 / 1,000 results

Rating

0.0

(0)

Developer

North Glass Labs

North Glass Labs

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

24 days ago

Last modified

Share

Hacker News Scraper — Search Stories, Points & Comments

Quickly search and extract Hacker News stories via the free Algolia HN Search API. Get story titles, URLs, authors, upvote points, comment counts, and creation dates as structured JSON. The actor uses HTTPS requests rather than a browser.

What it does

The Hacker News Scraper actor searches and retrieves stories from Hacker News (Y Combinator's social news site) using the free Algolia HN Search API. It talks directly to a public JSON API rather than rendering web pages.

Each story returned includes the title, external URL, author handle, upvote points, comment count, creation timestamp, the story's self-text, Algolia's objectID, and associated tags. Self-posts have an empty url; use objectId to identify the HN item. Results can be sorted by relevance or newest first.

This makes the actor ideal for tech sentiment monitoring, competitive intelligence, link-bait research, and building datasets of what the developer community is discussing on any topic — from new programming languages and AI tools to startup launches and security vulnerabilities.

Input parameters

ParameterTypeRequiredDefaultDescription
searchQuerystring✅ YesThe text to search for in Hacker News stories. Must not be empty.
maxResultsintegerNo50Maximum number of stories to retrieve (1–1000).
sortBystringNorelevanceSort order. One of: relevance or date_desc (newest first).

Output fields

Each result item pushed to the dataset contains:

FieldTypeDescription
titlestringStory title as shown on Hacker News
urlstringExternal URL linked from the story (empty for self-posts)
authorstringHacker News username of the story submitter
pointsintegerUpvote count (karma points) the story has received
numCommentsintegerNumber of comments on the story
createdAtstringISO-8601 timestamp of when the story was posted
objectIdstringAlgolia object ID (unique identifier for the story in the HN index)
storyTextstringSelf-text of the story (populated for "Ask HN" / "Show HN" posts; empty for link posts)
tagsarray of stringsTags associated with the story (e.g. ["story"])

Use cases

  • Tech trend monitoring — track what developer communities are discussing about new frameworks, AI models, or product launches
  • Sentiment analysis — collect story titles and points to gauge community reception of a topic
  • Competitive intelligence — find discussions mentioning your competitors or industry keywords
  • Content curation — build newsletters, blog roundups, or social media posts from top HN stories
  • Link-building research — identify popular URLs being shared in your niche for outreach
  • Data collection — assemble datasets of HN activity for NLP, research, or market analysis

How it works

The actor calls the Algolia HN Search API. When sortBy is relevance, it uses https://hn.algolia.com/api/v1/search. When sortBy is date_desc, it uses https://hn.algolia.com/api/v1/search_by_date, which returns newest-first results. The actor requests stories only (tags=story) and up to maxResults hits. Each hit is mapped to the nine documented output fields and pushed to the default dataset.

Example usage

Example input

{
"searchQuery": "Rust programming language",
"maxResults": 10,
"sortBy": "date_desc"
}

Example output

{
"title": "Why Rust is the most loved programming language",
"url": "https://blog.rust-lang.org/2025/01/15/Rust-survey.html",
"author": "jnordan",
"points": 452,
"numComments": 189,
"createdAt": "2025-01-15T10:30:00.000Z",
"objectId": "39871234",
"storyText": "",
"tags": ["story"]
}

Pricing

This actor uses the pay-per-event (PPE) pricing model on Apify. You are charged a small fee for each successful actor run. Because the Hacker News Scraper uses a free public API and does not launch a browser, runs are extremely fast and cost-efficient — typically completing in under 5 seconds. Check the actor's Apify Store page for the current per-run pricing. Apify's free tier includes monthly platform credits that are sufficient for hundreds of searches.

Tips

  • Use specific queries for relevance sorting — broad queries like "AI" will return the all-time top stories; narrow queries like "GPT-4 API pricing" return more targeted results.
  • Use date_desc for recent discussions — sort newest-first to monitor recent matching stories.
  • Increase maxResults for broad topics — the API supports up to 1,000 results per query. For niche topics, fewer than 50 results may exist, so the default is a good starting point.