# Where do I find discourse functions?

**URL:** https://meta.discourse.org/t/where-do-i-find-discourse-functions/231994
**Category:** Development
**Created:** [July 5, 2022, 3:36pm UTC](https://meta.discourse.org/t/where-do-i-find-discourse-functions/231994 "2022-07-05T15:36:49Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Juraj\_Štefánik](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@Juraj\_Štefánik](https://meta.discourse.org/u/Juraj_%C5%A0tef%C3%A1nik)
#### Post date: [July 5, 2022, 3:36pm UTC](https://meta.discourse.org/t/where-do-i-find-discourse-functions/231994/1 "2022-07-05T15:36:49Z")

</div>

Hello, When I want to add a display somewhere that shows how many posts the user has commented on or similar, where should I look for these functions?

Thnak you

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [July 5, 2022, 3:37pm UTC](https://meta.discourse.org/t/where-do-i-find-discourse-functions/231994/2 "2022-07-05T15:37:58Z")

</div>

The API documentation is available at [https://docs.discourse.org/](https://docs.discourse.org/)

---

<div class="post-metadata">

### Author: ![keegan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/keegan/32/383395_2.png) [@keegan](https://meta.discourse.org/u/keegan)
#### Post date: [July 5, 2022, 5:52pm UTC](https://meta.discourse.org/t/where-do-i-find-discourse-functions/231994/3 "2022-07-05T17:52:27Z")

</div>

Also for client-side related, there is the pluginApi file that has many functions you can make use of. Each method is also nicely documented.

[https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/lib/plugin-api.js](https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/lib/plugin-api.js)

---

<div class="post-metadata">

### Author: ![Juraj\_Štefánik](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@Juraj\_Štefánik](https://meta.discourse.org/u/Juraj_%C5%A0tef%C3%A1nik)
#### Post date: [July 6, 2022, 7:58am UTC](https://meta.discourse.org/t/where-do-i-find-discourse-functions/231994/4 "2022-07-06T07:58:12Z")

</div>

```plaintext
<li class="stats-post-count linked-stat">
            <LinkTo @route="userActivity.replies">
              <UserStat @value={{this.model.post_count}} @label="user.summary.post_count" />
            </LinkTo>
</li>

```

Can I somehow append this code to make it work?

---

<div class="post-metadata">

### Author: ![keegan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/keegan/32/383395_2.png) [@keegan](https://meta.discourse.org/u/keegan)
#### Post date: [July 8, 2022, 3:27pm UTC](https://meta.discourse.org/t/where-do-i-find-discourse-functions/231994/5 "2022-07-08T15:27:07Z")

</div>

This code is from the user summary page where the stats are displayed. In this context, you have access to the `post_count` on the model.

So it really depends where you want to add your display. If its already present in the model it may work, but more often you’ll need to add some logic to fetch that data.
