News

Get Hacker News item by ID · Hacker News API

GET/hacker-news/items/{id}
Free

Fetch a single Hacker News item. Stories, comments, jobs, polls, and poll options share the same item shape.

Request
curl https://api.unifapi.com/hacker-news/items/{id} \
  -H "Authorization: Bearer $UNIFAPI_KEY"

Parameters

idpathrequired
Hacker News item id.
The parameter for this Hacker News operation. Use the URL-visible slug or id described in the docs.
Overview

This operation is part of the Hacker News API in the news category. It uses the same Bearer token, request tracing, error model, and billing envelope as every UnifAPI endpoint, so agents can switch between platforms without custom per-vendor glue code.

Use it when a workflow needs Hacker News public data but should still keep one API key, one account balance, and one predictable JSON contract across social, live public-data sources.

Common agent workflows

  • Look up public Hacker News data for agents that need reliable open-web context.
  • Give an AI agent a stable Hacker News data source without building a per-platform integration.
  • Normalize Hacker News responses into the same UnifAPI envelope used across the catalog.
Response shape

Unified envelope, platform-native fields

  • Lookup responses return one canonical object in `data` with stable identifiers, source URLs where available, and platform-specific metadata normalized into predictable JSON.
  • This operation has a zero-credit multiplier, so successful responses include zero-charge billing metadata.
  • A not-found or invalid-input condition uses the unified UnifAPI error shape, so callers do not need special handling for each source platform.

Response status codes

200400401402404429500502503

Billing

This operation is free: it has a zero-credit multiplier and still returns billing metadata with zero credits charged.

Errors and retries

Authentication, validation, rate-limit, not-found, and provider errors use the unified UnifAPI error format. Agents should log `request_id`, retry only retryable failures, and treat invalid API keys, disabled keys, and expired keys as the same public `unauthorized` error type.

Response fields

Fields in the data object

A successful Get Hacker News item by ID call returns one data object with these fields (12 of 15 shown — the docs list the full schema).

idinteger
deletedboolean
typestring
bystring
timeinteger
Unix epoch seconds
textstring
HTML text for comments, stories, polls, and jobs.
deadboolean
parentinteger
pollinteger
kidsinteger[]
urlstring
scoreinteger
Run it

Agents & Skills built on Hacker News

You rarely call Get Hacker News item by ID by hand. These prebuilt agents and skills already read Hacker News data inside Claude or Codex — start from one of them, or call this endpoint yourself.