> **For coding agents and LLMs:** This is one Social Fetch marketing page (markdown export). For API orientation start with [`/llms.txt`](https://www.socialfetch.dev/llms.txt); for auth and crawl rules use [`/agents.txt`](https://www.socialfetch.dev/agents.txt); for every operation use [`/llms-endpoints.txt`](https://www.socialfetch.dev/llms-endpoints.txt).

## This page

- **On-site (HTML):** <https://www.socialfetch.dev/platforms/hackernews/comments-id-context>
- **Markdown (.mdx) URL:** <https://www.socialfetch.dev/platforms/hackernews/comments-id-context.mdx>

---

# Hacker News Comment Context API

Start from a comment id and walk up to the root story — comment, ancestors, and story card in one lookup.

`GET /v1/hackernews/comments/{id}/context` resolves a comment id to `data.comment`, an `ancestors` chain toward the root, and the root `story` when available. Send `x-api-key` and branch on `data.lookupStatus` before you write. `found` populates the comment (and typically story); `not_found` and `not_comment` return typed misses. HTTP 200 still means the request finished.

Credit pricing for this operation comes from the API registry and appears on this page, and `meta.creditsCharged` is the billing source of truth. To page an entire thread, use story comments instead of calling context once per node.

## Request

- **Endpoint:** `GET /v1/hackernews/comments/{id}/context`
- **Credits:** 2 credits
Failed requests are free
- **Input:** by comment id
- **Full reference:** [docs](https://www.socialfetch.dev/docs/api/v1/hackernews/comments/id/context/get)
- **Platform page:** [/platforms/hackernews](https://www.socialfetch.dev/platforms/hackernews)

## FAQ

### How do I get Hacker News comment context by id?

Call GET /v1/hackernews/comments/{id}/context with your Social Fetch API key in the x-api-key header. Pass the numeric comment id. Read data.lookupStatus, then data.comment, data.ancestors, and data.story.

### How many credits does comment context cost?

Pricing is documented on the operation in the API registry (shown on this page). Confirm on every response with meta.creditsCharged — that field is the billing source of truth.

### What does lookupStatus mean on comment context?

found means the id resolved as a comment and context fields may be populated. not_found means the id does not exist. not_comment means the id exists but is not a comment. Always branch before treating the payload as found context.

### What is in the ancestors array?

Ancestors are intermediate items between the comment and the root story, ordered toward the story. Combined with data.story, they reconstruct the path a reader would see climbing the thread.

### Comment context vs story comments?

Use context when you start from a comment id and need upward context. Use GET /v1/hackernews/stories/{id}/comments when you start from a story and need to page the full discussion tree.

### Do I need a Hacker News account?

No. Social Fetch authenticates with your Social Fetch API key only. The route reads public item data; it does not act as a logged-in HN user.

### Can I use this for alert enrichment?

Yes. Teams expand comment-deep links into title, URL, and parent text before notifying Slack or a CRM. Persist meta.requestId when a miss needs support review.
