Skip to content

Last updated

Changelog

Hacker News API

HealthyRead-only

Hacker News story lists (front page, newest, Ask HN, Show HN) with rank, title, url, site, points, author, comment count and age, plus any item's details and its full nested comment thread. Generated from news.ycombinator.com.

Base URL
https://api.maviapi.com/v1/sites/hackernews
7
Endpoints
54 min ago
Last verified
100%
Uptime / 7d
1388ms
p50 latency
GET/front5 credits per call

Front

Stories on the Hacker News front page in HN rank order, 30 per page, each with rank, id, title, url, site, points, author, comment_count, age, posted_at (UTC), type and hn_url. data.next holds the next page's params, or null on the last page.

Bearer auth. Pass your key as Authorization: Bearer <key> on every request.
integerOptionalin query

page number, 1 to 17 (30 stories per page).

feedstringe.g."front"
pageintegere.g.1
countintegere.g.30
storiesobject[]12 fields
rankintegere.g.1
idintegere.g.50663595
titlestringe.g."The group chat where your AI talks behind your back"
urlstringe.g."https://construct22.com/"
sitestringe.g."construct22.com"
pointsintegere.g.238
authorstringe.g."utiiiD"
comment_countintegere.g.104
agestringe.g."3 hours ago"
posted_atstringe.g."2026-11-27T06:44:34Z"
typestringe.g."story"
hn_urlstringe.g."https://news.ycombinator.com/item?id=50663595"
nextobject1 field
pstringe.g."2"
paginationobject3 fields
countintegere.g.30
has_morebooleane.g.false
next_cursornull
fetched_atstringe.g."2026-11-27T10:11:48.780Z"
ageintegere.g.0
Try itLive
GET
https://api.maviapi.com/v1/sites/hackernews/front?p=1
Request
curl "https://api.maviapi.com/v1/sites/hackernews/front?p=1" \
-H "Authorization: Bearer $MAVI_KEY"
Example670 B
{
  "feed": "front",
  "page": 1,
  "count": 30,
  "stories": [
    {
      "rank": 1,
      "id": 50663595,
      "title": "The group chat where your AI talks behind your back",
      "url": "https://construct22.com/",
      "site": "construct22.com",
      "points": 238,
      "author": "utiiiD",
      "comment_count": 104,
      "age": "3 hours ago",
      "posted_at": "2026-11-27T06:44:34Z",
      "type": "story",
      "hn_url": "https://news.ycombinator.com/item?id=50663595"
    }
  ],
  "next": {
    "p": "2"
  },
  "pagination": {
    "count": 30,
    "has_more": false,
    "next_cursor": null
  },
  "fetched_at": "2026-11-27T10:11:48.780Z",
  "age": 0
}

Get all the data, no code

Collect every page of GET /front into a dataset, for one request or for a whole list of them, then download it as CSV or JSON. A page costs the same as one call of the endpoint; the download is free.

Use Hacker News API from Claude, ChatGPT and your coding tools

Add this URL as a custom connector and sign in to maviapi. Nothing to install.

How to connect
https://mcp.maviapi.com/mcp

Or run it locally, with each endpoint of Hacker News API as its own tool:

claude mcp add maviapi -e MAVIAPI_TOOLS=hackernews -- npx -y '@maviapi/mcp'

Import Hacker News API into Postman and other tools

How to import

Paste a link into Postman, Insomnia, an agent framework or a no-code tool to get every endpoint with its parameters and response fields. The link always serves the current endpoints, so importing it again picks up new ones.

  • OpenAPI 3.1
    https://api.maviapi.com/v1/apis/hackernews/openapi.json
  • Postman
    https://api.maviapi.com/v1/apis/hackernews/postman.json

The Postman collection sends the shared demo key until you put your own key in its maviapi_key variable.

Build with the Hacker News API

Choose a starting endpoint

  • Front GET /front

    Stories on the Hacker News front page in HN rank order, 30 per page, each with rank, id, title, url, site, points, author, comment_count, age, posted_at (UTC), type and hn_url. data.next holds the next page's params, or null on the last page.

    Parameters and response fields for GET /front
    Request parameters
    NameType / locationRequiredDescription
    pinteger / queryNopage number, 1 to 17 (30 stories per page).
    Response fields
    FieldTypeDescription
    feedstring
    pageinteger
    countinteger
    storiesobject[]
    stories[].rankinteger
    stories[].idinteger
    stories[].titlestring
    stories[].urlstring
    stories[].sitestring
    stories[].pointsinteger
    stories[].authorstring
    stories[].comment_countinteger
    stories[].agestring
    stories[].posted_atstring
    stories[].typestring
    stories[].hn_urlstring
    nextobject
    next.pstring
    paginationobject
    pagination.countinteger
    pagination.has_moreboolean
    pagination.next_cursornull
    fetched_atstring
    ageinteger
  • Ask GET /ask

    Ask HN posts in HN rank order, 30 per page, each with rank, id, title, url, site, points, author, comment_count, age, posted_at (UTC), type and hn_url. data.next holds the next page's params, or null on the last page.

    Parameters and response fields for GET /ask
    Request parameters
    NameType / locationRequiredDescription
    pinteger / queryNopage number, 1 to 17 (30 stories per page).
    Response fields
    FieldTypeDescription
    feedstring
    pageinteger
    countinteger
    storiesobject[]
    stories[].rankinteger
    stories[].idinteger
    stories[].titlestring
    stories[].urlstring
    stories[].sitenull
    stories[].pointsinteger
    stories[].authorstring
    stories[].comment_countinteger
    stories[].agestring
    stories[].posted_atstring
    stories[].typestring
    stories[].hn_urlstring
    nextobject
    next.pstring
    paginationobject
    pagination.countinteger
    pagination.has_moreboolean
    pagination.next_cursornull
    fetched_atstring
    ageinteger
  • Item GET /item/{id}

    One Hacker News item (story, Ask/Show HN, job, poll or a single comment) by id: type, title, url, site, text, points, author, comment_count, age, posted_at (UTC), parent_id / story_id / story_title for comments, poll_options for polls, and its whole comment thread as a nested tree (top level in HN order, each comment with id, author, age, posted_at, depth, parent_id, plain text, raw html, deleted flag and replies). thread_source is "algolia" for the full tree, or "firebase" for a bounded live walk when the item is too new to be indexed.

    Parameters and response fields for GET /item/{id}
    Request parameters
    NameType / locationRequiredDescription
    idinteger / pathYesHacker News item id.
    Response fields
    FieldTypeDescription
    idinteger
    typestring
    titlestring
    urlstring
    sitestring
    textnull
    pointsinteger
    authorstring
    comment_countinteger
    agestring
    posted_atstring
    parent_idnull
    story_idnull
    story_titlenull
    poll_optionsnull
    hn_urlstring
    comments_totalinteger
    commentsobject[]
    comments[].idinteger
    comments[].authorstring
    comments[].agestring
    comments[].posted_atstring
    comments[].depthinteger
    comments[].parent_idinteger
    comments[].textstring
    comments[].htmlstring
    comments[].deletedboolean
    comments[].repliesobject[]
    comments[].replies[].idinteger
    comments[].replies[].authorstring
    comments[].replies[].agestring
    comments[].replies[].posted_atstring
    comments[].replies[].depthinteger
    comments[].replies[].parent_idinteger
    comments[].replies[].textstring
    comments[].replies[].htmlstring
    comments[].replies[].deletedboolean
    comments[].replies[].repliesobject[]
    comments[].replies[].replies[].idinteger
    comments[].replies[].replies[].authorstring
    comments[].replies[].replies[].agestring
    comments[].replies[].replies[].posted_atstring
    comments[].replies[].replies[].depthinteger
    comments[].replies[].replies[].parent_idinteger
    comments[].replies[].replies[].textstring
    comments[].replies[].replies[].htmlstring
    comments[].replies[].replies[].deletedboolean
    comments[].replies[].replies[].repliesobject[]
    comments[].replies[].replies[].replies[].idinteger
    comments[].replies[].replies[].replies[].authorstring
    comments[].replies[].replies[].replies[].agestring
    comments[].replies[].replies[].replies[].posted_atstring
    comments[].replies[].replies[].replies[].depthinteger
    comments[].replies[].replies[].replies[].parent_idinteger
    comments[].replies[].replies[].replies[].textstring
    comments[].replies[].replies[].replies[].htmlstring
    comments[].replies[].replies[].replies[].deletedboolean
    comments[].replies[].replies[].replies[].repliesobject[]
    comments[].replies[].replies[].replies[].replies[].idinteger
    comments[].replies[].replies[].replies[].replies[].authorstring
    comments[].replies[].replies[].replies[].replies[].agestring
    comments[].replies[].replies[].replies[].replies[].posted_atstring
    comments[].replies[].replies[].replies[].replies[].depthinteger
    comments[].replies[].replies[].replies[].replies[].parent_idinteger
    comments[].replies[].replies[].replies[].replies[].textstring
    comments[].replies[].replies[].replies[].replies[].htmlstring
    comments[].replies[].replies[].replies[].replies[].deletedboolean
    comments[].replies[].replies[].replies[].replies[].repliesobject[]
    comments[].replies[].replies[].replies[].replies[].replies[].idinteger
    comments[].replies[].replies[].replies[].replies[].replies[].authorstring
    comments[].replies[].replies[].replies[].replies[].replies[].agestring
    comments[].replies[].replies[].replies[].replies[].replies[].posted_atstring
    comments[].replies[].replies[].replies[].replies[].replies[].depthinteger
    comments[].replies[].replies[].replies[].replies[].replies[].parent_idinteger
    comments[].replies[].replies[].replies[].replies[].replies[].textstring
    comments[].replies[].replies[].replies[].replies[].replies[].htmlstring
    comments[].replies[].replies[].replies[].replies[].replies[].deletedboolean
    comments[].replies[].replies[].replies[].replies[].replies[].repliesstring[]
    thread_sourcestring
    paginationobject
    pagination.countinteger
    pagination.has_moreboolean
    pagination.next_cursornull
  • Feed GET /feed

    The first page (30 stories) of a Hacker News story list in HN order, each story with rank, id, title, url, site, points, author, comment_count, age, posted_at (UTC), type, hn_url and comments. With comments=true the first `top` stories carry their top-level comments in HN order, each with its direct replies; every other story has comments null.

    Parameters and response fields for GET /feed
    Request parameters
    NameType / locationRequiredDescription
    typestring / queryNowhich story list: front, newest, ask or show. Allowed values: front, newest, ask, show.
    commentsboolean / queryNoattach top comments to the first `top` stories.
    topinteger / queryNohow many stories to enrich with comments (1-5). Allowed values: 1, 2, 3, 4, 5.
    comments_per_storyinteger / queryNotop-level comments, and direct replies under each, per enriched story (1, 3, 5 or 10). Allowed values: 1, 3, 5, 10.
    Response fields
    FieldTypeDescription
    feedstring
    with_commentsboolean
    enrichedinteger
    countinteger
    storiesobject[]
    stories[].rankinteger
    stories[].idinteger
    stories[].titlestring
    stories[].urlstring
    stories[].sitestring
    stories[].pointsinteger
    stories[].authorstring
    stories[].comment_countinteger
    stories[].agestring
    stories[].posted_atstring
    stories[].typestring
    stories[].hn_urlstring
    stories[].commentsnull
    paginationobject
    pagination.countinteger
    pagination.has_moreboolean
    pagination.next_cursornull
    fetched_atstring
    ageinteger
  • Newest GET /newest

    Newest Hacker News submissions, newest first, 30 per page, each with rank, id, title, url, site, points, author, comment_count, age, posted_at (UTC), type and hn_url. data.next holds the next page's params, or null on the last page.

    Parameters and response fields for GET /newest
    Request parameters
    NameType / locationRequiredDescription
    pinteger / queryNopage number, 1 to 17 (30 stories per page).
    Response fields
    FieldTypeDescription
    feedstring
    pageinteger
    countinteger
    storiesobject[]
    stories[].rankinteger
    stories[].idinteger
    stories[].titlestring
    stories[].urlstring
    stories[].sitestring
    stories[].pointsinteger
    stories[].authorstring
    stories[].comment_countinteger
    stories[].agestring
    stories[].posted_atstring
    stories[].typestring
    stories[].hn_urlstring
    nextobject
    next.pstring
    paginationobject
    pagination.countinteger
    pagination.has_moreboolean
    pagination.next_cursornull
    fetched_atstring
    ageinteger
  • Show GET /show

    Show HN posts in HN rank order, 30 per page, each with rank, id, title, url, site, points, author, comment_count, age, posted_at (UTC), type and hn_url. data.next holds the next page's params, or null on the last page.

    Parameters and response fields for GET /show
    Request parameters
    NameType / locationRequiredDescription
    pinteger / queryNopage number, 1 to 17 (30 stories per page).
    Response fields
    FieldTypeDescription
    feedstring
    pageinteger
    countinteger
    storiesobject[]
    stories[].rankinteger
    stories[].idinteger
    stories[].titlestring
    stories[].urlstring
    stories[].sitestring
    stories[].pointsinteger
    stories[].authorstring
    stories[].comment_countinteger
    stories[].agestring
    stories[].posted_atstring
    stories[].typestring
    stories[].hn_urlstring
    nextobject
    next.pstring
    paginationobject
    pagination.countinteger
    pagination.has_moreboolean
    pagination.next_cursornull
    fetched_atstring
    ageinteger
  • Best GET /best

    Best (highest-voted recent) Hacker News stories, ranked, 30 per page, each with rank, id, title, url, site, points, author, comment_count, age, posted_at (UTC), type and hn_url. data.next holds the next page's params, or null on the last page.

    Parameters and response fields for GET /best
    Request parameters
    NameType / locationRequiredDescription
    pinteger / queryNopage number, 1 to 7 (30 stories per page).
    Response fields
    FieldTypeDescription
    feedstring
    pageinteger
    countinteger
    storiesobject[]
    stories[].rankinteger
    stories[].idinteger
    stories[].titlestring
    stories[].urlstring
    stories[].sitestring
    stories[].pointsinteger
    stories[].authorstring
    stories[].comment_countinteger
    stories[].agestring
    stories[].posted_atstring
    stories[].typestring
    stories[].hn_urlstring
    nextobject
    next.pstring
    paginationobject
    pagination.countinteger
    pagination.has_moreboolean
    pagination.next_cursornull
    fetched_atstring
    ageinteger

Export Hacker News data to CSV

Each list below downloads as a CSV file with one row per record. Collect it into a dataset with "Get all the data, no code" under the console above. The dataset reads the list page by page, and you download it as CSV, JSON or JSONL.

ListCSV columns
FrontGET /frontrank, id, title, url, site, points, author, comment_count, age, posted_at, type, hn_url
AskGET /askrank, id, title, url, site, points, author, comment_count, age, posted_at, type, hn_url
ItemGET /item/{id}id, author, age, posted_at, depth, parent_id, text, html, deleted, replies
FeedGET /feedrank, id, title, url, site, points, author, comment_count, age, posted_at, type, hn_url, comments
NewestGET /newestrank, id, title, url, site, points, author, comment_count, age, posted_at, type, hn_url
ShowGET /showrank, id, title, url, site, points, author, comment_count, age, posted_at, type, hn_url
BestGET /bestrank, id, title, url, site, points, author, comment_count, age, posted_at, type, hn_url

A nested value (a list or an object) is written as JSON in one cell. How datasets and exports work

Hacker News API questions

What you get, what it costs and how to call it.

Is there an official Hacker News API?

Yes. Hacker News has an official API, run with Firebase, that makes its public data (stories, comments, polls, users) available in near real time. Source: Hacker News API (checked 2026-11-25). This Hacker News API is a separate, unofficial one: an independent, hosted API from maviapi for the public data on news.ycombinator.com. It is not made, endorsed or supported by Hacker News.

What data can I get from the Hacker News API?

The Hacker News API has 7 endpoints. Each returns JSON with the parameters and fields documented above:

  • GET /front: Stories on the Hacker News front page in HN rank order, 30 per page, each with rank, id, title, url, site, points, author, comment_count, age, posted_at…
  • GET /ask: Ask HN posts in HN rank order, 30 per page, each with rank, id, title, url, site, points, author, comment_count, age, posted_at (UTC), type and hn_url.
  • GET /item/{id}: One Hacker News item (story, Ask/Show HN, job, poll or a single comment) by id: type, title, url, site, text, points, author, comment_count, age, posted_at…
  • GET /feed: The first page (30 stories) of a Hacker News story list in HN order, each story with rank, id, title, url, site, points, author, comment_count, age, posted_at…
  • GET /newest: Newest Hacker News submissions, newest first, 30 per page, each with rank, id, title, url, site, points, author, comment_count, age, posted_at (UTC), type and…
  • GET /show: Show HN posts in HN rank order, 30 per page, each with rank, id, title, url, site, points, author, comment_count, age, posted_at (UTC), type and hn_url.
  • GET /best: Best (highest-voted recent) Hacker News stories, ranked, 30 per page, each with rank, id, title, url, site, points, author, comment_count, age, posted_at…

How much does the Hacker News API cost?

Calls are paid in credits from your maviapi plan, and only successful calls are charged. Every endpoint of this API costs 5 credits per call. On the Hobby plan ($49 a month for 250,000 credits), 1,000 calls cost about $0.98. Failed calls are free. The Free plan gives you 1,000 credits a month, with no credit card required. See plans and credit prices for everything after that.

How do I call the Hacker News API?

Send an HTTPS request to the endpoint with your API key in the Authorization header. For example, GET /front:

cURL
curl 'https://api.maviapi.com/v1/sites/hackernews/front' \
  -H "Authorization: Bearer $MAVI_KEY"

Create a key on your API keys page, or try any endpoint first in the console above with the free test key.

What are the ways to get Hacker News data as JSON?

Each way to get Hacker News data as JSON fits a different need:

  • Hacker News API: Hacker News has an official API, run with Firebase, that makes its public data (stories, comments, polls, users) available in near real time. Better when you need write access, account data or an agreement with Hacker News.
  • Your own scraper: Full control and no vendor, but the parsing, the blocked requests and the repairs after every change on news.ycombinator.com are yours. Better for a one-off pull from a page that rarely changes.
  • Apify: A marketplace of Actors you run, where input, output and price are set by each Actor. Better when an Actor already returns what you need, or you want to host your own code. See maviapi vs Apify.
  • RapidAPI: A hub of APIs added by many providers, called with one RapidAPI key and priced per API. Better when you already use the hub and one of its APIs covers what you need. Source: RapidAPI docs.
  • maviapi: The Hacker News API on this page: 7 documented endpoints, a published response schema and one key for the whole catalog. Better when this data is part of your product and you do not want to maintain a scraper.

What happens when news.ycombinator.com changes its layout?

Your code does not change. maviapi keeps the Hacker News API working when news.ycombinator.com changes its pages, so you keep calling the same endpoints and get JSON in the shape documented here. See its current health on the status page and what changed in its changelog.

Will an update break my Hacker News API integration?

No. An endpoint you use never changes shape: new fields, optional parameters and endpoints are added beside it, and a change that would break a call ships as a new endpoint. Ignore response fields you do not know, and follow the changelog for what is new.

  • Hürriyet API

    Latest Turkish news from Hürriyet: a combined newest-first feed across sections (gündem, ekonomi, dünya, spor, ...)…

  • Tripadvisor API

    Trip-planning data from Tripadvisor: geo search plus attractions, restaurants and hotels by location (geo_id), with…

  • Google Maps API

    Structured data from maps.google.com.