Answers / Hacker News

How can an AI agent read Hacker News comments?

Send GET /v1/hackernews/comments with the story ID or its news.ycombinator.com URL. PostToData walks the comment tree and returns each comment as plain text with its author, depth and a link, with the HTML already removed.

Hacker News · comments · $0.001 a call · one verified website trial · updated 2026-11-13

Run it live

Calls run only when you press Run. Opening this page does not spend credit.

Loading…

Your results will appear here. Choose a platform and action, then press Run.

Real API calls require verification for one trial, or a signed-in account with prepaid credit.

From code

curl
curl "https://posttodata.com/v1/hackernews/comments?id=44404905&limit=5" -H "Authorization: Bearer YOUR_API_KEY"
Python
import requests

r = requests.get(
    "https://posttodata.com/v1/hackernews/comments",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    params={"id": "44404905", "limit": 5},
)
for item in r.json()["data"]["items"]:
    print(item["url"], item.get("text") or item.get("title"))

From your AI

Claude and ChatGPT clients that support OAuth can sign in without pasting a key. Follow the client setup guide. The command below is the API-key option for Claude Code.

Add the MCP server once
claude mcp add --transport http posttodata https://posttodata.com/mcp --header "Authorization: Bearer YOUR_API_KEY"

Then ask

“Read the Hacker News thread 44404905 and summarize the main arguments for and against, quoting one comment for each.”

The model calls get_comments with platform hackernews.

Good to know

  • Deleted comments are skipped.
  • Add format=markdown to get an indented thread a model can read directly.
  • Over MCP, the tool is get_comments with platform set to hackernews.

Full reference in the docs. All Hacker News endpoints are on the Hacker News API page.

More answers