# Watching API

**URL:** https://meta.discourse.org/t/watching-api/237739
**Category:** Development
**Tags:** rest-api
**Created:** [August 31, 2022, 6:41pm UTC](https://meta.discourse.org/t/watching-api/237739 "2022-08-31T18:41:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![chrisk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisk/32/272572_2.png) [@chrisk](https://meta.discourse.org/u/chrisk)
#### Post date: [August 31, 2022, 6:41pm UTC](https://meta.discourse.org/t/watching-api/237739/1 "2022-08-31T18:41:31Z")

</div>

Hi,

I am reviewing the REST API documentation, and am wondering if there is a way to gather a list of users watching/following any given topic? I hope to gather this information after posting the webhook of a new actions on a topic.

Thanks

---

<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: [August 31, 2022, 9:09pm UTC](https://meta.discourse.org/t/watching-api/237739/2 "2022-08-31T21:09:38Z")

</div>

Easiest way is probably the [data explorer](https://meta.discourse.org/t/32566?silent=true) plugin and then [How to run Data Explorer queries with the Discourse API](https://meta.discourse.org/t/how-to-run-data-explorer-queries-with-the-discourse-api/120063). I doubt that there is an endpoint that provides that, so you’ll need to sort-of make one with data-explorer.

---

<div class="post-metadata">

### Author: ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)
#### Post date: [September 1, 2022, 12:51am UTC](https://meta.discourse.org/t/watching-api/237739/3 "2022-09-01T00:51:46Z")

</div>

I had to look that up for a topic recently:

```sql
-- [params]
-- integer :topic_id

SELECT
    user_id,
    notification_level
FROM 
    topic_users
WHERE topic_id = :topic_id
AND notification_level > 1
ORDER BY notification_level DESC

```

The notification levels are [here](https://github.com/discourse/discourse/blob/main/lib/notification_levels.rb).

---

<div class="post-metadata">

### Author: ![chrisk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chrisk/32/272572_2.png) [@chrisk](https://meta.discourse.org/u/chrisk)
#### Post date: [September 1, 2022, 12:53pm UTC](https://meta.discourse.org/t/watching-api/237739/4 "2022-09-01T12:53:13Z")

</div>

Just what I needed, thank you very much!
