Hacker News Story Scraper avatar

Hacker News Story Scraper

Pricing

from $0.01 / 1,000 results

Go to Apify Store
Hacker News Story Scraper

Hacker News Story Scraper

Grab stories from any Hacker News feed — Top, New, Best, Ask HN, Show HN or Jobs — or a set of specific item IDs, returned as clean, flat JSON. Powered by the free official Firebase API, so no key, login or proxy is required.

Pricing

from $0.01 / 1,000 results

Rating

0.0

(0)

Developer

Assia Fadli

Assia Fadli

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

5 days ago

Last modified

Categories

Share

Collect stories from Hacker News straight from its free, official Firebase API. There is nothing to configure — no API key, no login, and no proxy — the feed is public and rock-solid.

Point it at a feed (or a handful of item IDs), pick how many stories you want, and get back one tidy JSON row per story.

Features

  • Reads any standard Hacker News feed: Top, New, Best, Ask HN, Show HN or Jobs.
  • Optionally targets a set of specific item IDs instead of a feed.
  • Fetches item details concurrently in small batches to stay fast and polite.
  • Emits one flat, ready-to-use JSON record per story.
  • Skips gracefully over deleted or missing items — they are recorded with an error field so a single bad item never stops the run.

Input

FieldTypeDefaultDescription
listselecttopstoriesWhich feed to scrape: topstories, newstories, beststories, askstories, showstories, jobstories.
maxItemsinteger50Maximum number of stories to fetch.
itemIdsarrayOptional. Fetch these specific item IDs instead of a feed. When set, list is ignored.

Example input

{
"list": "topstories",
"maxItems": 10
}

Or fetch specific items:

{
"itemIds": ["8863", "121003"]
}

Output

Each dataset record looks like this:

{
"id": 8863,
"type": "story",
"title": "My YC app: Dropbox - Throw away your USB drive",
"url": "http://www.getdropbox.com/u/2/screencast.html",
"hnUrl": "https://news.ycombinator.com/item?id=8863",
"by": "dhouston",
"score": 111,
"comments": 71,
"time": "2007-04-04T19:16:40.000Z",
"text": null
}
FieldDescription
idHacker News item ID.
typeItem type (story, job, poll, etc.).
titleStory title.
urlThe story's external URL (null for Ask HN / text posts).
hnUrlLink to the discussion on Hacker News.
byAuthor username.
scorePoints/upvotes.
commentsComment count (descendants).
timeSubmission time as an ISO 8601 timestamp.
textBody text (for Ask HN and text posts), as raw HTML.

If an item can't be fetched (e.g. it was deleted), the row is { "id": <id>, "error": "<message>" } instead.

Pricing

This actor uses the pay-per-event model: you are charged once per successfully scraped story (the story-scraped event). Deleted or unreachable items produce an error row and are never charged.

Data source

The actor talks to the official Hacker News API hosted on Firebase:

  • Base URL: https://hacker-news.firebaseio.com/v0
  • Lists: /topstories.json, /newstories.json, /beststories.json, /askstories.json, /showstories.json, /jobstories.json
  • Items: /item/{id}.json

The API is free and requires no authentication.

License

MIT © Assia Fadli