Stack Overflow hub

Stack Overflow Comments Batch API

Comments for up to 100 questions or answers in one request, one entry per distinct post id.

GET /v1/stack-overflow/posts/comments

1 credit per post id Up to 100 ids per request Max 100 credits An id that is not a post is still charged Failed requests are free

About this endpoint

GET /v1/stack-overflow/posts/comments?ids=11,11227902 returns one entry per distinct post id, in the order first asked. Each entry has postId, lookupStatus, postType, commentCount, commentsComplete and comments. A missing post is not_found with an empty comments list and null counts, while the other entries are unaffected.

commentCount is the post's comment count and commentsComplete is false when the post has more comments than this response holds. The batch charges 1 credit per distinct post id, including an id that is not a post. Repeats are dropped before billing.

replyTo is always null on this batch because the comments-by-post routes do not carry reply targets. edited is the marker shown with the comment and can differ from the same comment on another route.

Stack Overflow Comments Batch API FAQ

How many posts can one call take?

1 to 100 post ids, comma-separated. A post id is a question id or an answer id; read postType on the entry to see which it is.

How is the comments batch billed?

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 commentsComplete false?

The post has more comments than this response holds. The comments returned are still in comments, and the flag tells you the list is short.

What does a missing post look like?

Its entry has lookupStatus not_found, postType null, commentCount null, commentsComplete null and an empty comments list. The response stays HTTP 200.