Hacker News Data Scraper avatar

Hacker News Data Scraper

Pricing

from $0.70 / 1,000 results

Go to Apify Store
Hacker News Data Scraper

Hacker News Data Scraper

Scrape Hacker News stories by keyword, front page, Ask HN, Show HN, jobs, user or story link. Get points, comments, authors, dates, domains, trend rows and comment threads. Export JSON, CSV or Excel, and schedule runs.

Pricing

from $0.70 / 1,000 results

Rating

0.0

(0)

Developer

Crawl Craft

Crawl Craft

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

6 days ago

Last modified

Categories

Features

Limited permissions

Share

🚀 What is Hacker News Data Scraper?

Hacker News Data Scraper is an Apify Actor that works as a Hacker News scraper for stories, comment threads and keyword trends. Add keywords, sections such as the front page, users or story links, and get one row per story with points, comments, author, date and domain, ready to export as JSON, CSV, Excel, XML or HTML.

  • 🔎 One input list: mix keywords, sections (FRONTPAGE, NEWEST, ASK, SHOW, JOBS, BEST), users and story links, and each entry is collected on its own.
  • 📈 Trend rows: switch the result type to Trends and get one summary row per keyword.
  • 💬 Comment threads: add comments with their reply level to each story, also saved one row per comment in a second table.
  • 🎯 Filters: narrow results by time window, exact dates, minimum points and minimum comments.
  • ⏰ Recurring runs: schedule the Actor, call it through the API or send results to other apps with webhooks.

Pick your goal first, such as tracking a topic, watching a competitor or building a research dataset. Then pick the input that serves it, and run a small test of 20 stories before you collect more.

📊 What data can you extract from Hacker News?

As a Hacker News stories scraper, Hacker News Data Scraper saves the fields below for every story. Field names match the dataset schema, and the examples are illustrative values from that schema.

FieldDescriptionExample
idStory ID40000001
typeType of the entry (the example is a Show HN post)show_hn
titleTitleShow HN: Example open-source data tool
urlLink of the storyhttps://example.com/data-tool
domainDomain of the linkexample.com
textStory text; for link stories, a short description of the linked article when one is availableExample description of the project and what it does.
authorAuthorexample_user
pointsPoints250
num_commentsNumber of comments120
created_atPosted date2026-11-20T10:00:00.000Z
age_hoursAge of the story in hours10.0
points_per_hourPoints per hour25.0
hn_urlLink to the story on Hacker Newshttps://news.ycombinator.com/item?id=40000001
scraped_atTime of collection2026-11-20T20:00:00Z
commentsComment thread (when Max comments per story is above 0)list of comments, see below

Comment threads

As a Hacker News comments scraper, the Actor adds a list of comments to each story when you set Max comments per story above 0. Each comment has id, parent_id, author, text, created_at, depth (reply level), replies and hn_url. The same comments are also saved one per row in a separate Comments table, together with story_id, story_title and story_hn_url.

Trend rows

When the result type is Trends, you get one summary row per keyword with story_count, points, num_comments, trend_score, top_story, top_domains, hn_url and scraped_at. In a trend row, title holds the keyword and hn_url links to the top story.

Deleted comments are not included. Private data such as favorites, hidden stories or account details is not collected.

💡 Use cases for Hacker News data

  • Track Hacker News mentions: add your product, company or topic as keywords with the sort set to Newest first, then read title, points, num_comments and hn_url. You can also monitor Hacker News keywords by running the same input on a schedule.
  • Hacker News trend analysis: set the result type to Trends to compare keywords by story_count, trend_score and top_story. Hacker News top domains come from the top_domains field, which lists the sites linked most for each keyword.
  • Hacker News market research: collect stories and comment threads about a language, tool or product category to see what practitioners ask and how fast interest grows (created_at, points, num_comments).
  • Hacker News competitor monitoring: add competitor names as keywords and use Minimum points to keep only the stories that got attention.
  • Hacker News sentiment analysis: the Actor collects comment text with depth and replies, so you can run your own sentiment analysis on the threads.
  • Hacker News content ideas: sort stories by points or points_per_hour to find the topics and questions people respond to.
  • Hacker News AI dataset: export comment threads with reply levels as JSON for analysis or model training.
  • Hacker News job posts: use the JOBS section and read type, title, text and url for hiring posts.

🛠️ How to scrape Hacker News stories and comments

You can scrape Hacker News in five steps, and this Hacker News scraping tool only needs an Apify account.

  1. Sign in to your Apify account.
  2. Open Hacker News Data Scraper in Apify Console.
  3. Add keywords, sections, users or story links to Keywords, sections, users or story links.
  4. Click Start and wait for the run to finish.
  5. Export Hacker News to CSV, Excel, JSON, XML or HTML from the dataset.

How to scrape Hacker News with Python

The Hacker News API scraper runs from code through the apify-client package. See the Python example in the integrations section below.

Hacker News search by keyword

Add a keyword such as python or machine learning to the input list. Set Sort keyword search to Most relevant or Newest first.

Hacker News stories by date

Choose a Time window (24 hours up to 2 years) or set From date and To date. The exact dates replace the time window.

Hacker News front page data

As a Hacker News top stories scraper, the Actor reads the sections FRONTPAGE, NEWEST, ASK, SHOW, JOBS and BEST. Add one of those words to get the Hacker News front page data or one of the other sections.

How to find Show HN launches

Add SHOW to the input list to find Show HN launches. Add ASK to start Ask HN research, because Ask HN and Show HN posts keep their own text.

How to scrape Hacker News comments

Set Max comments per story above 0 to scrape Hacker News comments. Use Comment reply levels to keep only top-level comments (1) or top-level plus direct replies (2), and Comment order to keep Hacker News order or the newest comments.

💰 How much does it cost to scrape Hacker News?

Hacker News Data Scraper uses the pay-per-event model. You pay for each result row, which is the main_result event: a story row, or a trend row when the result type is Trends.

Plan tierPrice
FREE$1.000 per 1,000 results ($0.001 per result)
BRONZE$0.9000 per 1,000 results ($0.0009 per result)
SILVER$0.8000 per 1,000 results ($0.0008 per result)
GOLD$0.7000 per 1,000 results ($0.0007 per result)

For example, 1,000 results cost $1.000 at the FREE tier and $0.7000 at the GOLD tier. Comments are included in the story row and are not charged separately. An input that returns nothing is not charged.

Apify also adds a small Actor Start event of $0.00005 per run start (one event per GB of memory, minimum one). If you set a maximum charge per run, the Actor stops cleanly once that limit is reached. See the Pricing tab for current rates.

⬇️ Input

You only need one keyword, section, user or story link. Set the input in the Actor's input form or send it as JSON through the API. See the Input tab for every option.

Hacker News scraper input form with keywords, sections and filters

This example collects up to 20 stories for a keyword, the front page and one user, with 3 comments each:

{
"queries": ["python", "FRONTPAGE", "user:pg"],
"maxItems": 20,
"sort": "relevance",
"maxCommentsPerStory": 3
}

What can I put in the input list?

Each line is collected on its own, up to Max stories per input (default 20):

  • Keyword: python or machine learning
  • Section: FRONTPAGE, NEWEST, ASK, SHOW, JOBS or BEST
  • User: user:pg, @pg or a profile link
  • Story: an ID such as 8863 or a news.ycombinator.com item link
  • A line with only punctuation is ignored

Other options are Result type (Stories or Trend summary per keyword), Time window, From date, To date, Minimum points, Minimum comments (the two minimums are not applied to story links), Max comments per story, Comment reply levels, Comment order and Add article description. Turn off Add article description for the fastest run.

⬆️ Output

The results are shown as a dataset in the Storage tab. The table view is for convenience and does not show all the fields. Each run saves a Hacker News dataset with one row per story, and a second table with one row per comment.

Hacker News data export table with title, author, points and comments

Download the Hacker News data export as JSON, CSV, Excel, XML or HTML. As a Hacker News downloader it offers the views Stories, Content, Engagement, Comment threads and Trends. Every run also saves a RUN_SUMMARY record in the key-value store with total results, comments, stop reason, timings, the number of inputs that failed or were skipped, and a status for every input.

Example output: story

This is an example built from the dataset schema's example values. It is not a captured run.

{
"id": 40000001,
"type": "show_hn",
"title": "Show HN: Example open-source data tool",
"url": "https://example.com/data-tool",
"domain": "example.com",
"text": "Example description of the project and what it does.",
"author": "example_user",
"points": 250,
"num_comments": 120,
"created_at": "2026-11-20T10:00:00.000Z",
"age_hours": 10.0,
"points_per_hour": 25.0,
"hn_url": "https://news.ycombinator.com/item?id=40000001",
"scraped_at": "2026-11-20T20:00:00Z",
"comments": [
{
"id": 40000002,
"parent_id": 40000001,
"author": "example_commenter",
"text": "Example comment text.",
"created_at": "2026-11-20T10:30:00.000Z",
"depth": 0,
"replies": 2,
"hn_url": "https://news.ycombinator.com/item?id=40000002"
}
]
}

Example output: trend row

Also built from schema example values, showing only the trend fields that have an example:

{
"story_count": 20,
"trend_score": 86.2,
"top_story": "Show HN: Example open-source data tool",
"top_domains": ["example.com", "example.org"],
"hn_url": "https://news.ycombinator.com/item?id=40000001",
"scraped_at": "2026-11-20T20:00:00Z"
}

⚠️ Limitations and error handling

  • Search by relevance stops at about 1,000 results per keyword. Choose Newest first with a larger Max stories per input to collect more.
  • Hacker News Data Scraper is not a Hacker News crawler that browses the whole site. You choose what is collected with keywords, sections, users and story links.
  • Only public Hacker News data is collected. Deleted comments, comment points, flagged comments and private account data are not included.
  • Article descriptions for link stories are added only when one is available.
  • Max stories per input accepts 1 to 1,000,000. Max comments per story accepts 0 to 5,000, where 0 skips comments.
  • An input that finds nothing is marked skipped in the run summary and in the run log, and an input that could not be collected is counted as failed in the run summary. If every input fails, the run ends with a failed status and a short message.
  • A date that does not look like 2025-01-31 stops the run with an input problem message before any data is collected.
  • If you set a maximum charge per run, the Actor stops cleanly when it is reached and marks the remaining inputs as skipped.

🔌 Integrating Hacker News Data Scraper with other apps

You can start Hacker News Data Scraper from the Apify Console, on a schedule or through the Apify API, and the same input gives you fresh rows every time. Run it as a Hacker News scraper API from your own app, or connect it to other tools.

  • Set up schedules to repeat a keyword list every day or week.
  • Use webhooks to trigger an action when a run finishes.
  • Send results to Make, Zapier, Slack, Google Sheets or Google Drive with Apify integrations.
  • The Apify API turns the Actor into a Hacker News data API for your own apps, and the API tab shows ready-made code.
  • As a Hacker News extractor for AI assistants, add https://mcp.apify.com?tools=crawl_craft/hacker-news-data-scraper to your MCP client, see the Apify MCP guide.

Python example

from apify_client import ApifyClient
client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("crawl_craft/hacker-news-data-scraper").call(run_input={
"queries": ["python", "FRONTPAGE", "user:pg"],
"maxItems": 20,
"maxCommentsPerStory": 3,
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item["title"], item["points"])

🔗 More Apify Actors by crawl_craft

ActorWhat it extractsWhen to use it
Quora ScraperQuora questions, answers, author profiles, spaces and topicsUse it when you want question-and-answer discussions from Quora next to Hacker News threads.
Telegram ScraperMessages, views, reactions and subscriber counts from public Telegram channelsUse it when your topic is also discussed in public Telegram channels.
Facebook Posts Search ScraperPublic Facebook posts by keyword or hashtag with reactions and commentsUse it to follow the same keywords on Facebook.
Ats Jobs APIOpen jobs from Greenhouse, Lever and Ashby board linksUse it for structured job data after you spot hiring posts on Hacker News.

Hacker News Data Scraper only collects data that is publicly visible on Hacker News and does not collect private data such as account details. Results can still contain personal data, such as usernames and comment text, so collect it only with a legitimate reason and consider GDPR (Regulation (EU) 2016/679) and the Hacker News terms of service. Read Apify's guide on the legality of web scraping, and consult a lawyer if you are unsure.

❓ FAQ

Is Hacker News Data Scraper a Hacker News web scraper?

Yes. It collects public Hacker News data and returns finished rows, so you do not write or host any code. It also works as a Hacker News data extractor for people who prefer files over code.

Can I use it as a Hacker News API alternative?

Yes, when you want finished rows instead of building requests yourself. Start a run from the Console or through the Apify API and download the results.

Do I need an account or API key?

You need an Apify account. No Hacker News account, login or key is needed.

How many stories can I get?

You set Max stories per input per entry, up to 1,000,000. Relevance search stops at about 1,000 results per keyword, so sort by Newest first to go further. Run a quick test to see the count for your keyword.

Why am I getting fewer results than expected?

Check three things. Relevance search stops at about 1,000 results per keyword, a time window or minimum points can narrow a keyword a lot, and the run log shows each entry with its number of stories and why an entry returned nothing.

Can I scrape the comments of one story?

Yes. Add the story ID or link to the input list and set Max comments per story above 0. Set Comment reply levels to 1 for top-level comments only.

Do I need proxies?

No. The proxy setting is optional and the default is used if you leave it. Set your own only if you need a specific one.

Can I scrape private data?

No. Only public Hacker News data is collected.

Can I use it through an MCP server?

Yes. Connect your MCP client to https://mcp.apify.com?tools=crawl_craft/hacker-news-data-scraper and the Actor is available as a tool.

💬 Your feedback

Found a bug or have a feature request? Open the Issues tab on the Actor's Store page. Questions about the HN data scraper or the HN scraper input fields are welcome there too.

Need a custom solution or more data? Contact hello.crawlcraft@gmail.com.