Dev.to Comment API
One comment by its short code, plus the replies underneath it.
GET /v1/dev-to/comment1 credit Failed requests are free
About this endpoint
GET /v1/dev-to/comment takes a comment id, the short code in a comment URL such as https://dev.to/ben/comment/3jnm7, or the full URL. The reply returns the comment in comment with bodyHtml, createdAt, aiDisclosure and its author, plus replies in reading order.
The response does not include the requested comment's position in its full thread, so comment.parentId and comment.depth are null even when the comment is itself a reply. Each reply keeps the parentId it answers and a depth counted from the requested comment, so a direct reply has depth: 1. Use /v1/dev-to/article/comments for the whole thread with positions. When the comment does not exist, lookupStatus is not_found, comment is null and replies is empty.
Dev.to Comment API FAQ
Where do I find a comment id?
It is the short code at the end of a comment URL, for example 3jnm7 in https://dev.to/ben/comment/3jnm7. The comments list returns the same id on every row, and a full comment URL is also accepted.
How many credits does a comment 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 are comment.parentId and comment.depth null?
A single comment response does not say where the requested comment sits in its full thread. The call returns both fields as null instead of guessing. Use /v1/dev-to/article/comments for the whole thread with positions.
What does lookupStatus mean?
found means the comment was returned. not_found means no comment has that id. HTTP 200 only means the request finished, so branch on lookupStatus.
Are replies included?
Yes. Every reply under the comment comes back in the replies array with its own parentId and a depth counted from the requested comment, so a direct reply has depth 1. Use /v1/dev-to/article/comments for positions in the full thread.