# How to get accurate reply count through API?

**URL:** https://meta.discourse.org/t/how-to-get-accurate-reply-count-through-api/144267
**Category:** Development
**Tags:** rest-api
**Created:** [March 13, 2020, 9:55pm UTC](https://meta.discourse.org/t/how-to-get-accurate-reply-count-through-api/144267 "2020-03-13T21:55:41Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![nedbat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nedbat/32/150103_2.png) [@nedbat](https://meta.discourse.org/u/nedbat)
#### Post date: [March 13, 2020, 9:55pm UTC](https://meta.discourse.org/t/how-to-get-accurate-reply-count-through-api/144267/1 "2020-03-13T21:55:42Z")

</div>

I pulled the topics from a specific category in my forum. Each topic has a reply\_count, but it often seems to have no relationship to the user-experienced replies.

For example, this topic: [Error 404 after installing a SSL certificate - Site Operations Help - Open edX discussions](https://discuss.openedx.org/t/error-404-after-installing-a-ssl-certificate/1578) has 1 reply. But the JSON ([https://discuss.openedx.org/posts/1578.json](https://discuss.openedx.org/posts/1578.json)) says reply\_count: 0. Why? How can I get an accurate reply count?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [March 13, 2020, 10:10pm UTC](https://meta.discourse.org/t/how-to-get-accurate-reply-count-through-api/144267/2 "2020-03-13T22:10:57Z")

</div>

The `reply_count` parameter on a post gives you the number of direct replies to the post. A reply to a post is created by clicking the “Reply” button that is directly under the post. Replies to the topic’s original post are an exception to this. If a post is created by clicking the Reply button directly under the topic’s first post, it will not increment the OPs reply count.

The `reply_count` on a _topic_ is the total number of direct replies to posts in that topic. It is not the total number of posts in the topic.

For finding the total number of comments in a topic, look at the topic’s `posts_count` value. The total number of comments in the topic will be `posts_count - 1`. You can see that if you go to [https://discuss.openedx.org/t/error-404-after-installing-a-ssl-certificate/1578.json](https://discuss.openedx.org/t/error-404-after-installing-a-ssl-certificate/1578.json).

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [April 12, 2020, 10:11pm UTC](https://meta.discourse.org/t/how-to-get-accurate-reply-count-through-api/144267/3 "2020-04-12T22:11:04Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
