News Media
Hacker News logo

Hacker News API

news.ycombinator.com

Hacker News - top, new, and best stories, comments, users, and jobs.

Actions
4
Category
News Media
Login
Not required
Output
JSON

Call the Hacker News API

Submit a task, then poll the job until it settles. This example runs hn_search.

curl -X POST https://api.anakin.io/v1/wire/task \
  -H "X-API-Key: $ANAKIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action_id": "hn_search",
    "params": {
      "query": "claude"
    }
  }'

4 actions on news.ycombinator.com

Read

  • Hacker News Search

    hn_searchread1 credit / call

    Returns Hacker News stories with title, score, URL, author, and comment count.

    query
    string · required
  • Item Details

    hn_item_detailsread3 credits / call

    Returns full item details for a story, comment, job, or poll with nested comments.

    id
    string · required
    include_comments
    boolean
    comment_depth
    integer
  • Stories

    hn_storiesread2 credits / call

    Returns stories from any HN feed with title, score, URL, author, and comment count.

    type
    string
    limit
    integer
    offset
    integer
  • User Details

    hn_user_detailsread1 credit / call

    Returns a user profile with karma, about, and optionally recent submissions.

    username
    string · required
    include_submissions
    boolean
    submissions_limit
    integer

Hacker News API questions

Is there an API for Hacker News?
Hacker News does not offer a public data API for this, but Anakin Wire provides 4 maintained endpoints for news.ycombinator.com. You call Anakin's REST API with an action ID and parameters and get structured JSON back; Anakin handles the browser, proxies, anti-bot, and parsing.
How do I scrape Hacker News data?
POST to https://api.anakin.io/v1/wire/task with your API key, the action ID, and its parameters, then poll GET /v1/wire/jobs/{id} until the job settles. There is nothing to install and no scraper to maintain — when news.ycombinator.com changes its markup, Anakin updates the action.
Do I need a Hacker News account?
No. Every Hacker News action listed here runs anonymously — no account and no credentials required.
What does the Hacker News API cost?
Usage-based credits, charged per call and refunded automatically when a job fails. New accounts start with 300 free credits and no card. See anakin.io/pricing for the current rates.

More News Media APIs

All News Media sites