Hacker News · Capability

Hacker News API

The official Hacker News API provides read-only access to items (stories, comments, jobs, Ask HNs, polls), users, and live data via Firebase. No authentication is required.

Run with Naftiko HackerNewsAPI

What You Can Do

GET
Getitem — Get item by ID
/item/{id}.json
GET
Getuser — Get user profile
/user/{username}.json
GET
Getmaxitem — Get max item ID
/maxitem.json
GET
Gettopstories — Get top stories
/topstories.json
GET
Getnewstories — Get new stories
/newstories.json
GET
Getbeststories — Get best stories
/beststories.json
GET
Getaskstories — Get latest Ask HN stories
/askstories.json
GET
Getshowstories — Get latest Show HN stories
/showstories.json
GET
Getjobstories — Get latest job stories
/jobstories.json
GET
Getupdates — Get changed items and profiles
/updates.json

MCP Tools

getitem

Get item by ID

read-only idempotent
getuser

Get user profile

read-only idempotent
getmaxitem

Get max item ID

read-only idempotent
gettopstories

Get top stories

read-only idempotent
getnewstories

Get new stories

read-only idempotent
getbeststories

Get best stories

read-only idempotent
getaskstories

Get latest Ask HN stories

read-only idempotent
getshowstories

Get latest Show HN stories

read-only idempotent
getjobstories

Get latest job stories

read-only idempotent
getupdates

Get changed items and profiles

read-only idempotent

Capability Spec

hacker-news-capability.yaml Raw ↑
naftiko: 1.0.0-alpha2
info:
  label: Hacker News API
  description: The official Hacker News API provides read-only access to items (stories, comments, jobs, Ask HNs, polls),
    users, and live data via Firebase. No authentication is required.
  tags:
  - Hacker
  - News
  - API
  created: '2026-05-06'
  modified: '2026-05-06'
capability:
  consumes:
  - type: http
    namespace: hacker-news
    baseUri: https://hacker-news.firebaseio.com/v0
    description: Hacker News API HTTP API.
    resources:
    - name: item-id-json
      path: /item/{id}.json
      operations:
      - name: getitem
        method: GET
        description: Get item by ID
        inputParameters:
        - name: id
          in: path
          type: integer
          required: true
          description: Numeric item ID.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: user-username-json
      path: /user/{username}.json
      operations:
      - name: getuser
        method: GET
        description: Get user profile
        inputParameters:
        - name: username
          in: path
          type: string
          required: true
          description: Case-sensitive HN username.
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: maxitem-json
      path: /maxitem.json
      operations:
      - name: getmaxitem
        method: GET
        description: Get max item ID
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: topstories-json
      path: /topstories.json
      operations:
      - name: gettopstories
        method: GET
        description: Get top stories
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: newstories-json
      path: /newstories.json
      operations:
      - name: getnewstories
        method: GET
        description: Get new stories
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: beststories-json
      path: /beststories.json
      operations:
      - name: getbeststories
        method: GET
        description: Get best stories
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: askstories-json
      path: /askstories.json
      operations:
      - name: getaskstories
        method: GET
        description: Get latest Ask HN stories
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: showstories-json
      path: /showstories.json
      operations:
      - name: getshowstories
        method: GET
        description: Get latest Show HN stories
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: jobstories-json
      path: /jobstories.json
      operations:
      - name: getjobstories
        method: GET
        description: Get latest job stories
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
    - name: updates-json
      path: /updates.json
      operations:
      - name: getupdates
        method: GET
        description: Get changed items and profiles
        outputRawFormat: json
        outputParameters:
        - name: result
          type: object
          value: $.
  exposes:
  - type: rest
    port: 8080
    namespace: hacker-news-rest
    description: REST adapter for Hacker News API.
    resources:
    - path: /item/{id}.json
      name: getitem
      operations:
      - method: GET
        name: getitem
        description: Get item by ID
        call: hacker-news.getitem
        with:
          id: rest.id
        outputParameters:
        - type: object
          mapping: $.
    - path: /user/{username}.json
      name: getuser
      operations:
      - method: GET
        name: getuser
        description: Get user profile
        call: hacker-news.getuser
        with:
          username: rest.username
        outputParameters:
        - type: object
          mapping: $.
    - path: /maxitem.json
      name: getmaxitem
      operations:
      - method: GET
        name: getmaxitem
        description: Get max item ID
        call: hacker-news.getmaxitem
        outputParameters:
        - type: object
          mapping: $.
    - path: /topstories.json
      name: gettopstories
      operations:
      - method: GET
        name: gettopstories
        description: Get top stories
        call: hacker-news.gettopstories
        outputParameters:
        - type: object
          mapping: $.
    - path: /newstories.json
      name: getnewstories
      operations:
      - method: GET
        name: getnewstories
        description: Get new stories
        call: hacker-news.getnewstories
        outputParameters:
        - type: object
          mapping: $.
    - path: /beststories.json
      name: getbeststories
      operations:
      - method: GET
        name: getbeststories
        description: Get best stories
        call: hacker-news.getbeststories
        outputParameters:
        - type: object
          mapping: $.
    - path: /askstories.json
      name: getaskstories
      operations:
      - method: GET
        name: getaskstories
        description: Get latest Ask HN stories
        call: hacker-news.getaskstories
        outputParameters:
        - type: object
          mapping: $.
    - path: /showstories.json
      name: getshowstories
      operations:
      - method: GET
        name: getshowstories
        description: Get latest Show HN stories
        call: hacker-news.getshowstories
        outputParameters:
        - type: object
          mapping: $.
    - path: /jobstories.json
      name: getjobstories
      operations:
      - method: GET
        name: getjobstories
        description: Get latest job stories
        call: hacker-news.getjobstories
        outputParameters:
        - type: object
          mapping: $.
    - path: /updates.json
      name: getupdates
      operations:
      - method: GET
        name: getupdates
        description: Get changed items and profiles
        call: hacker-news.getupdates
        outputParameters:
        - type: object
          mapping: $.
  - type: mcp
    port: 9090
    namespace: hacker-news-mcp
    transport: http
    description: MCP adapter for Hacker News API for AI agent use.
    tools:
    - name: getitem
      description: Get item by ID
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: hacker-news.getitem
      with:
        id: tools.id
      inputParameters:
      - name: id
        type: integer
        description: Numeric item ID.
        required: true
      outputParameters:
      - type: object
        mapping: $.
    - name: getuser
      description: Get user profile
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: hacker-news.getuser
      with:
        username: tools.username
      inputParameters:
      - name: username
        type: string
        description: Case-sensitive HN username.
        required: true
      outputParameters:
      - type: object
        mapping: $.
    - name: getmaxitem
      description: Get max item ID
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: hacker-news.getmaxitem
      outputParameters:
      - type: object
        mapping: $.
    - name: gettopstories
      description: Get top stories
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: hacker-news.gettopstories
      outputParameters:
      - type: object
        mapping: $.
    - name: getnewstories
      description: Get new stories
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: hacker-news.getnewstories
      outputParameters:
      - type: object
        mapping: $.
    - name: getbeststories
      description: Get best stories
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: hacker-news.getbeststories
      outputParameters:
      - type: object
        mapping: $.
    - name: getaskstories
      description: Get latest Ask HN stories
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: hacker-news.getaskstories
      outputParameters:
      - type: object
        mapping: $.
    - name: getshowstories
      description: Get latest Show HN stories
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: hacker-news.getshowstories
      outputParameters:
      - type: object
        mapping: $.
    - name: getjobstories
      description: Get latest job stories
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: hacker-news.getjobstories
      outputParameters:
      - type: object
        mapping: $.
    - name: getupdates
      description: Get changed items and profiles
      hints:
        readOnly: true
        destructive: false
        idempotent: true
      call: hacker-news.getupdates
      outputParameters:
      - type: object
        mapping: $.