Hacker News Scraper avatar

Hacker News Scraper

Pricing

Pay per usage

Go to Apify Store
Hacker News Scraper

Hacker News Scraper

Scrape Top, New, Best, Ask HN, Show HN and Job stories from Hacker News via the official keyless Firebase API — title, score, author, comment count and links, no proxy needed.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Dan Cristian Podina

Dan Cristian Podina

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 days ago

Last modified

Categories

Share

Pull the latest Hacker News stories — Top, New, Best, Ask HN, Show HN, or Jobs — as clean, structured data: title, score, author, comment count, the outbound link, and the HN discussion link. Great for tracking the front page, feeding fresh tech headlines to an LLM, or building a daily digest.

What it does

  • Every front-page list — choose top, new, best, ask, show, or job.
  • Official, keyless source — reads the public Hacker News Firebase API, the same data that powers the site. No login, no key, no proxy.
  • Clean, structured output — each story as { id, title, url, score, by, time, timeIso, descendants, type, text, hnUrl }.
  • Reliable — a public JSON API that's meant to be fetched by machines, so it just works from a datacenter IP on the free plan.

Input

FieldTypeDescription
listTypetop | new | best | ask | show | jobWhich HN list to scrape. Default top.
maxItemsintegerHow many stories to fetch from the top of the list (1–200). Default 30.

Example input

{
"listType": "top",
"maxItems": 5
}

Output

Each story becomes one dataset item:

{
"id": 42345678,
"title": "Show HN: I built a thing",
"url": "https://example.com/thing",
"score": 512,
"by": "pg",
"time": 1754660580,
"timeIso": "2026-08-08T14:03:00Z",
"descendants": 137,
"type": "story",
"text": null,
"hnUrl": "https://news.ycombinator.com/item?id=42345678"
}

Field notes:

  • url is null for Ask HN and other text posts — the discussion is the content. Use hnUrl to open it on Hacker News, and text for the post body (HTML).
  • descendants is the comment count.
  • time is unix seconds; timeIso is the same instant as a UTC ISO-8601 string.

Notes

  • Only public data is accessed (the same JSON that powers news.ycombinator.com).
  • Ordering follows Hacker News' own ranking for the chosen list at the moment of the run.
  • The Actor makes N+1 requests: one for the id list, then one per story. Items that fail to fetch are skipped rather than aborting the run.

Local development

$apify run -i '{"listType":"top","maxItems":5}'

The fetch core (src/hn.py) has no Apify dependency and uses only the Python standard library, so it can be imported and run directly for quick testing.