vøiddo guidesAll Actors on Apify

Hacker News Scraper: how to get Stories and Comments by Query as JSON/CSV (API, Python, no code)

Search Hacker News via the public Algolia API. This guide shows the output fields, a working input, and Python, JavaScript and cURL code for the Actor v0iddo/hn-algolia-search on Apify.

Open Hacker News Scraper on Apify

What data you get

One row per result. Every row can be downloaded as JSON, CSV, Excel or HTML, or read through the API.

FieldLabelTypeExample
objectIDObject IDtext50238751
storyIdStory Idnumber50238751
titleTitletextShow HN: Nodecode, open-source living agent in Lisp that rewrites i...
authorAuthortext
urlUrlURL
pointsPointsnumber2
numCommentsNum Commentsnumber0
createdAtCreated Atdate2026-10-26T03:30:18Z
createdAtUnixCreated At Unixnumber1792985418
tagsTagslist["story"]
commentTextComment Texttext
permalinkPermalinkURLhttps://news.ycombinator.com/item?id=50238751
querytextShow HN: open source

Input example

This is the input that is pre-filled on the Actor page. Change the values for your own run.

{
  "queries": [
    "Show HN: open source"
  ],
  "maxResultsPerQuery": 20
}
Input fieldTypeWhat it does
queriesarrayFull-text queries. Leave empty + use tags for a tag-only feed (e.g.
tagsarrayHN Algolia tags: story, comment, frontpage, showhn, askhn, poll, author, story_.
sinceDaysintegerServer-side date filter via createdati>UNIX.
maxResultsPerQueryintegerHard cap per query. Algolia paginates 100/page.
sortBystringdate = newest first (uses /searchbydate).

Output sample

Real rows from a run of the Actor. Fields that name people are left out of the sample.

[
  {
    "objectID": "50238751",
    "storyId": 50238751,
    "title": "Show HN: Nodecode, open-source living agent in Lisp that rewrites itself for you",
    "points": 2,
    "numComments": 0,
    "createdAt": "2026-10-26T03:30:18Z",
    "createdAtUnix": 1792985418,
    "tags": [
      "story"
    ],
    "permalink": "https://news.ycombinator.com/item?id=50238751",
    "query": "Show HN: open source"
  },
  {
    "objectID": "50237813",
    "storyId": 50237813,
    "title": "Show HN: Freehire, open-source search 3M+ tech jobs from company career boards",
    "url": "https://freehire.me/",
    "points": 4,
    "numComments": 0,
    "createdAt": "2026-10-26T01:13:43Z",
    "createdAtUnix": 1792977223,
    "tags": [
      "story"
    ],
    "permalink": "https://news.ycombinator.com/item?id=50237813",
    "query": "Show HN: open source"
  }
]

Code: Python, JavaScript and cURL

Get your API token in Apify Console under Settings, then Integrations. The Actor id is v0iddo/hn-algolia-search.

Python (apify-client)

from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run_input = {'queries': ['Show HN: open source'], 'maxResultsPerQuery': 20}

run = client.actor("v0iddo/hn-algolia-search").call(run_input=run_input)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

JavaScript (apify-client)

import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const input = {
  "queries": [
    "Show HN: open source"
  ],
  "maxResultsPerQuery": 20
};

const run = await client.actor('v0iddo/hn-algolia-search').call(input);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

cURL

curl -X POST "https://api.apify.com/v2/acts/v0iddo~hn-algolia-search/run-sync-get-dataset-items" \
  -H "Authorization: Bearer YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"queries": ["Show HN: open source"], "maxResultsPerQuery": 20}'

Price

$0.10 per 1,000 results. You pay per result row. There is no separate charge per run. Higher Apify plans pay less per result, down to $0.07 per 1,000. See the pricing tab for your plan. A new Apify account gets $5 of platform credit every month.

FAQ

What data does the Hacker News Scraper return?

Each result is one row in an Apify dataset. Fields include objectID, storyId, title, author, url, points, numComments, createdAt, and more. The table above shows every field with an example value.

How do I use the Hacker News Scraper from Python?

Install the apify-client package, create a client with your Apify API token, call the Actor v0iddo/hn-algolia-search with an input like the one above, and read the rows from the run's dataset. The Python snippet above does exactly that.

Can I use it without writing code?

Yes. Open the Actor page on Apify, fill in the input form (an example is already filled in), press Start, and download the results as JSON, CSV, Excel or HTML. You can also schedule runs there.

How much does it cost?

$0.10 per 1,000 results. You pay per result row. There is no separate charge per run. Higher Apify plans pay less per result, down to $0.07 per 1,000. A new Apify account gets $5 of platform credit every month.

How do I limit the number of results?

Set a maximum cost for a run in the run options on Apify, and the run stops when it is reached.

Can I send the results to Google Sheets, Make, Zapier or n8n?

Yes. Apify datasets connect to Google Sheets, Slack, Make, Zapier and n8n, and a webhook can call your own service when a run finishes. You can also export the dataset as JSON, CSV or Excel.

Open Hacker News Scraper on Apify

Related guides