> **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/stack-overflow/posts-postid-comments>
- **Markdown (.mdx) URL:** <https://www.socialfetch.dev/platforms/stack-overflow/posts-postid-comments.mdx>

---

# Stack Overflow Comments API

Every comment on one question or answer, oldest first, with its author and score.

`GET /v1/stack-overflow/posts/{postId}/comments` returns the comments on a question or an answer, oldest first, up to 1,000. Each comment has `id`, `postId`, `postType`, `url`, `score`, `edited`, `createdAt`, `author`, `replyTo`, `isByPostAuthor`, `license` and `bodyHtml`.

`complete` is false when the post has more comments than one response holds. A post that does not exist is `not_found`; a post with no comments is `found` with an empty list.

This route is thinner than the comments returned inside the question route: `bodyMarkdown` is null and `replyTo` is always null because this list does not carry reply targets. `isByPostAuthor` is present. `edited` is the marker shown with the comment and can differ from the same comment on another route. When you need the fuller comment shape, use `GET /v1/stack-overflow/questions/{questionId}?include=answers,comments` or the answers route with `include=comments`.

## Request

- **Endpoint:** `GET /v1/stack-overflow/posts/{postId}/comments`
- **Credits:** 1 credit
Failed requests are free
- **Input:** by post id
- **Full reference:** [docs](https://www.socialfetch.dev/docs/api/v1/stack-overflow/posts/postid/comments/get)
- **Platform page:** [/platforms/stack-overflow](https://www.socialfetch.dev/platforms/stack-overflow)

## FAQ

### Does it work for an answer as well as a question?

Yes. postId is a question id or an answer id. Read postType to see which it is.

### How many credits does a comments lookup 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.

### Why is bodyMarkdown null?

This list carries the comment HTML but not its Markdown, so bodyMarkdown is null. The comments on the question and answers routes carry the fuller shape.

### Why is replyTo always null?

This list does not carry reply targets, so replyTo is always null here. The comments nested in a question or answer do carry it.

### What does the complete flag mean?

complete is true when the response holds every comment the post has. It is false when the post has more than 1,000 comments and the list stops at the ceiling.
