> **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/dev-to/article-comments>
- **Markdown (.mdx) URL:** <https://www.socialfetch.dev/platforms/dev-to/article-comments.mdx>

---

# Dev.to Comments API

Every comment under a post or podcast episode, flat in reading order with its parent and depth.

`GET /v1/dev-to/article/comments` takes exactly one of `articleId` or `podcastEpisodeId` and returns `comments` in reading order: each top-level comment immediately followed by its replies. `parentId` and `depth` are on every row, and `depth` is 0 for a top-level comment and 1 for a reply, which is enough to rebuild the tree without another call.

`topLevelCount` counts the top-level comments on this page. Replies are not counted against `limit`, so raise `limit` when a thread is reply-heavy. An unknown id and a post with no comments both return an empty list, so use the post route when you also need to know whether the post exists.

## Request

- **Endpoint:** `GET /v1/dev-to/article/comments`
- **Credits:** 1 credit
Failed requests are free
- **Input:** by post or podcast episode
- **Full reference:** [docs](https://www.socialfetch.dev/docs/api/v1/dev-to/article/comments/get)
- **Platform page:** [/platforms/dev-to](https://www.socialfetch.dev/platforms/dev-to)

## FAQ

### How do I rebuild the reply tree?

Group rows by parentId. A row with depth 0 has no parent; a reply points at the id of the comment above it. Rows arrive in reading order, so the tree is stable without extra sorting.

### How many credits does a comments page 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. Each paginated page is a separate billed request.

### Can I get comments for a podcast episode?

Yes. Send podcastEpisodeId instead of articleId. The response shape is the same flat list.

### Why is the list empty?

Either the post has no comments or the id does not exist. This route returns an empty list for both, so check the post first when the difference matters.
