# Get active users - via API

**URL:** https://meta.discourse.org/t/api/382295
**Category:** Support
**Tags:** rest-api
**Created:** [September 11, 2025, 8:36am UTC](https://meta.discourse.org/t/api/382295 "2025-09-11T08:36:37Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![zhang\_zhiyuan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zhang_zhiyuan/32/430883_2.png) [@zhang\_zhiyuan](https://meta.discourse.org/u/zhang_zhiyuan)
#### Post date: [September 11, 2025, 8:36am UTC](https://meta.discourse.org/t/api/382295/1 "2025-09-11T08:36:37Z")

</div>

I want to get the number of active users through the API, exactly the same as what is exported. Which API should I use to get it?

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [September 11, 2025, 8:38am UTC](https://meta.discourse.org/t/api/382295/2 "2025-09-11T08:38:53Z")

</div>

Active in what sense: daily, weekly, monthly or yearly?

---

<div class="post-metadata">

### Author: ![zhang\_zhiyuan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zhang_zhiyuan/32/430883_2.png) [@zhang\_zhiyuan](https://meta.discourse.org/u/zhang_zhiyuan)
#### Post date: [September 11, 2025, 8:42am UTC](https://meta.discourse.org/t/api/382295/3 "2025-09-11T08:42:25Z")

</div>

To obtain, all currently active users, that is, the total number of users

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [September 11, 2025, 8:44am UTC](https://meta.discourse.org/t/api/382295/4 "2025-09-11T08:44:41Z")

</div>

So you mean all _online_ users, i.e. those that are currently on the forum _at that time_?

---

<div class="post-metadata">

### Author: ![Lilly](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lilly/32/575047_2.png) [@Lilly](https://meta.discourse.org/u/Lilly)
#### Post date: [September 11, 2025, 8:52am UTC](https://meta.discourse.org/t/api/382295/5 "2025-09-11T08:52:38Z")

</div>

what about `/admin/users/list/active.json`?

maybe this doc will help?

[https://docs.discourse.org/#tag/Users/operation/adminListUsers](https://docs.discourse.org/#tag/Users/operation/adminListUsers)

also see

> [@Run Data Explorer queries with the Discourse API](https://meta.discourse.org/t/run-data-explorer-queries-with-the-discourse-api/120063):
>
> bookmark This guide explains how to use the Discourse API to create, run, and manage queries with the [Data Explorer](https://meta.discourse.org/t/32566?silent=true) plugin. person_raising_hand Required user level: Administrator Virtually any action that can be performed through the Discourse user interface can also be triggered with the Discourse API. This document provides a comprehensive overview for utilizing the API specifically in conjunction with the [Data Explorer](https://meta.discourse.org/t/32566?silent=true) plugin. For a general overview of how to find the correct API …

---

<div class="post-metadata">

### Author: ![zhang\_zhiyuan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zhang_zhiyuan/32/430883_2.png) [@zhang\_zhiyuan](https://meta.discourse.org/u/zhang_zhiyuan)
#### Post date: [September 11, 2025, 9:01am UTC](https://meta.discourse.org/t/api/382295/6 "2025-09-11T09:01:30Z")

</div>

No, it’s the total number of active users on the website, meaning how many people are currently on the website.

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [September 11, 2025, 9:05am UTC](https://meta.discourse.org/t/api/382295/7 "2025-09-11T09:05:18Z")

</div>

You can pull the data from `{site url}/about.json`, and get the `users_count` key’s value. For example on Meta:

```json
{
  "about": {
    "stats": {
      "topics_last_day": 16,
      "topics_7_days": 99,
      "topics_30_days": 553,
      "topics_count": 60801,
      "posts_last_day": 549,
      "posts_7_days": 3352,
      "posts_30_days": 19273,
      "posts_count": 1722045,
      "users_last_day": 23,
      "users_7_days": 132,
      "users_30_days": 713,
      "users_count": 61086, // This value here!
      "active_users_last_day": 535,
      "active_users_7_days": 1219,
      "active_users_30_days": 2518,
      "likes_last_day": 169,
      "likes_7_days": 1547,
      "likes_30_days": 10833,
      "likes_count": 1641538,
      "participating_users_last_day": 119,
      "participating_users_7_days": 373,
      "participating_users_30_days": 912,
      "visitors_last_day": 2161,
      "visitors_7_days": 4468,
      "visitors_30_days": 8669,
      "eu_visitors_last_day": 653,
      "eu_visitors_7_days": 1206,
      "eu_visitors_30_days": 2022,
      "chat_messages_last_day": 72,
      "chat_messages_7_days": 707,
      "chat_messages_30_days": 3015,
      "chat_messages_previous_30_days": 3621,
      "chat_messages_count": 99670,
      "chat_users_last_day": 8,
      "chat_users_7_days": 27,
      "chat_users_30_days": 67,
      "chat_users_previous_30_days": 87,
      "chat_users_count": 925,
      "chat_channels_last_day": 3,
      "chat_channels_7_days": 8,
      "chat_channels_30_days": 39,
      "chat_channels_previous_30_days": 36,
      "chat_channels_count": 3117
    },
    "description": "Learn about and discuss Discourse, the next-generation open-source forum software.",
    "extended_site_description": "<p>A place for the Discourse community to meet, ask questions, provide support to one other, and share much-appreciated feedback.</p>",
    "banner_image": "https://global.discourse-cdn.com/meta/original/4X/8/3/5/835377a3ea23f75e6c6c08ed3d7d606a0f2c3e72.jpeg",
    "site_creation_date": "2016-02-17T07:50:40.228Z",
    "title": "Discourse Meta",
    "locale": "en",
    "version": "3.6.0.beta1-dev",
    "https": true,
    "can_see_about_stats": true,
    "contact_url": "",
    "contact_email": "team@discourse.org",
    "moderator_ids": [
      127856,
      112395,
      8307,
      8571,
      140271
    ],
    "admin_ids": [],
    "category_moderators": []
  }
}

```

the `users_count` number is `61086`.

---

<div class="post-metadata">

### Author: ![zhang\_zhiyuan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zhang_zhiyuan/32/430883_2.png) [@zhang\_zhiyuan](https://meta.discourse.org/u/zhang_zhiyuan)
#### Post date: [September 11, 2025, 9:23am UTC](https://meta.discourse.org/t/api/382295/8 "2025-09-11T09:23:18Z")

</div>

Yes, I am currently using the user data obtained from the API here, but it does not match the total number of `users_count` on Meta: `{site url}/about.json`. I want to analyze the reason.

---

<div class="post-metadata">

### Author: ![zhang\_zhiyuan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zhang_zhiyuan/32/430883_2.png) [@zhang\_zhiyuan](https://meta.discourse.org/u/zhang_zhiyuan)
#### Post date: [September 11, 2025, 9:25am UTC](https://meta.discourse.org/t/api/382295/9 "2025-09-11T09:25:14Z")

</div>

This is to get the total number of users, but I want to get the user list. This is because the number of users I get from [https://docs.discourse.org/#tag/Users/operation/adminListUsers](https://docs.discourse.org/#tag/Users/operation/adminListUsers) is not the same as the `users_count` from `{site url}/about.json`, and many users are missing.

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [September 11, 2025, 9:30am UTC](https://meta.discourse.org/t/api/382295/10 "2025-09-11T09:30:19Z")

</div>

Hi there, what about [this (Discourse Docs)](https://docs.discourse.org/#tag/Users/operation/listUsersPublic) API call? For example, [https://meta.discourse.org/directory\_items.json?period=all&order=likes\_received](https://meta.discourse.org/directory_items.json?period=all&order=likes_received) gets all the users ordered by likes. You can add `&page=2`, `&page=3` at the back for more pages of users.

---

<div class="post-metadata">

### Author: ![Moin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/moin/32/554653_2.png) [@Moin](https://meta.discourse.org/u/Moin)
#### Post date: [September 11, 2025, 9:31am UTC](https://meta.discourse.org/t/api/382295/11 "2025-09-11T09:31:17Z")

</div>

> [@zhang\_zhiyuan](#):
>
> This is because the number of users I get from [Discourse API Docs](https://docs.discourse.org/#tag/Users/operation/adminListUsers) is not the same as the `users_count` from `{site url}/about.json`, and many users are missing.

Did you use the `page` parameter to get all pages?

---

<div class="post-metadata">

### Author: ![zhang\_zhiyuan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zhang_zhiyuan/32/430883_2.png) [@zhang\_zhiyuan](https://meta.discourse.org/u/zhang_zhiyuan)
#### Post date: [September 11, 2025, 10:31am UTC](https://meta.discourse.org/t/api/382295/12 "2025-09-11T10:31:35Z")

</div>

Yes, paginated retrieval continues until no more data is returned. For example, if there are 34,000+ records in total, but only 30,000+ are obtained, I cannot distinguish which users are unobtainable through the API interface.

---

<div class="post-metadata">

### Author: ![NateDhaliwal](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/natedhaliwal/32/313494_2.png) [@NateDhaliwal](https://meta.discourse.org/u/NateDhaliwal)
#### Post date: [September 11, 2025, 10:40am UTC](https://meta.discourse.org/t/api/382295/13 "2025-09-11T10:40:51Z")

</div>

So what if you looped through each page (maybe using something like Python) to increment the page number and fetch the data until there’s no data left to fetch? Would that work?

---

<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: [September 12, 2025, 6:31am UTC](https://meta.discourse.org/t/api/382295/14 "2025-09-12T06:31:30Z")

</div>

I think using a [data explorer](https://meta.discourse.org/t/32566?silent=true) query would be the easiest way to get the whole user list.

---

<div class="post-metadata">

### Author: ![zhang\_zhiyuan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zhang_zhiyuan/32/430883_2.png) [@zhang\_zhiyuan](https://meta.discourse.org/u/zhang_zhiyuan)
#### Post date: [September 17, 2025, 7:03am UTC](https://meta.discourse.org/t/api/382295/15 "2025-09-17T07:03:34Z")

</div>

Yes, it has been processed. The previous discrepancy was due to using default conditions when retrieving data via the API, which only fetched active users.
