# Discourse Likes API

**URL:** https://meta.discourse.org/t/discourse-likes-api/249009
**Category:** Development
**Tags:** rest-api
**Created:** [December 15, 2022, 7:21am UTC](https://meta.discourse.org/t/discourse-likes-api/249009 "2022-12-15T07:21:09Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Ajay\_Dev\_M](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ajay_dev_m/32/284776_2.png) [@Ajay\_Dev\_M](https://meta.discourse.org/u/Ajay_Dev_M)
#### Post date: [December 15, 2022, 7:21am UTC](https://meta.discourse.org/t/discourse-likes-api/249009/1 "2022-12-15T07:21:09Z")

</div>

I’m trying to integrate my discourse community to my project. I’m using ‘/post.json’ API to fetch the latest post. I also need to fetch the Likes of the post not only the count but also the user details who liked. Is there any API to fetch the likes of the Post/topics/comments.?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 15, 2022, 2:04pm UTC](https://meta.discourse.org/t/discourse-likes-api/249009/2 "2022-12-15T14:04:54Z")

</div>

Like in `https://meta.discourse.org/t/discourse-likes-api/249009.json`?

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [December 15, 2022, 3:08pm UTC](https://meta.discourse.org/t/discourse-likes-api/249009/3 "2022-12-15T15:08:55Z")

</div>

> [@Reverse engineer the Discourse API](https://meta.discourse.org/t/reverse-engineer-the-discourse-api/20576):
>
> Discourse is backed by a complete JSON api. Anything you can do on the site you can also do using the JSON api. The API is documented at [docs.discourse.org](https://docs.discourse.org). You can also use the [discourse\_api](https://github.com/discourse/discourse_api) Ruby gem as a client library. However, not every endpoint is documented. To determine how to do something with the JSON API here are some steps you can follow. Example: recategorize a topic. Go to a topic and start editing a category: Open Chrome dev tools, switch to the Network tab, select …

You should check the above documentation. You get the details of users who liked a post by fetching the endpoint `/post_action_users.json?id=POST_ID&post_action_type_id=2`

---

<div class="post-metadata">

### Author: ![Ajay\_Dev\_M](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ajay_dev_m/32/284776_2.png) [@Ajay\_Dev\_M](https://meta.discourse.org/u/Ajay_Dev_M)
#### Post date: [December 16, 2022, 5:33am UTC](https://meta.discourse.org/t/discourse-likes-api/249009/4 "2022-12-16T05:33:22Z")

</div>

Under every post there is a show more thing when i click that it shows the users who liked the post. I just took that API from network and called but that API did’t return time of the activity.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 16, 2022, 11:22am UTC](https://meta.discourse.org/t/discourse-likes-api/249009/5 "2022-12-16T11:22:52Z")

</div>

I think you might need a custom plugin to add that to the serializer.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [December 16, 2022, 11:36am UTC](https://meta.discourse.org/t/discourse-likes-api/249009/6 "2022-12-16T11:36:57Z")

</div>

Interestingly, if you have Reactions enabled you can use `/discourse-reactions/posts/:post_id/reactions-users.json` to get the `created_at` information for those (including for the reaction mapped to Like).

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 16, 2022, 1:13pm UTC](https://meta.discourse.org/t/discourse-likes-api/249009/7 "2022-12-16T13:13:41Z")

</div>

Wow! That’s a good catch, @JammyDodger!
