# How to query gamification score via the API?

**URL:** https://meta.discourse.org/t/how-to-query-gamification-score-via-the-api/251607
**Category:** Support
**Tags:** gamification
**Created:** [December 20, 2022, 12:12pm UTC](https://meta.discourse.org/t/how-to-query-gamification-score-via-the-api/251607 "2022-12-20T12:12:05Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![jamesgreenblue](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jamesgreenblue/32/286480_2.png) [@jamesgreenblue](https://meta.discourse.org/u/jamesgreenblue)
#### Post date: [December 20, 2022, 12:12pm UTC](https://meta.discourse.org/t/how-to-query-gamification-score-via-the-api/251607/1 "2022-12-20T12:12:05Z")

</div>

Phenomenal plugin @Falco 💚

Our community is integrated into a [bespoke platform](https://www.unep.org/news-and-stories/press-release/coral-reef-protection-grow-green-fins-hub) that rewards community engagement as one aspect of an overall membership score, is there any chance that the cheers score could be exposed as part of the [adminGetUser API response](https://docs.discourse.org/#tag/Users/operation/adminGetUser)? Is there any alternative way to query this data from the API in the meantime?

We are getting feedback from users that it is hard to discover the leaderboard. I have added a custom hamburger link but it would be great if people could access the leaderboard by clicking on the score listed on their profile (both the popup and profile screen). I understand that a community can have more than one leaderboard but if we could nominate a leaderboard that the link points to that would be a reasonable workaround.

Are these two items something that could be added to the roadmap?

---

<div class="post-metadata">

### Author: ![not-ethan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/not-ethan/32/282617_2.png) [@not-ethan](https://meta.discourse.org/u/not-ethan)
#### Post date: [December 20, 2022, 12:14pm UTC](https://meta.discourse.org/t/how-to-query-gamification-score-via-the-api/251607/2 "2022-12-20T12:14:59Z")

</div>

You can make a theme component to add a `onclick` function onto the elements to change the URL of the page to the leaderboard.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [December 20, 2022, 6:37pm UTC](https://meta.discourse.org/t/how-to-query-gamification-score-via-the-api/251607/3 "2022-12-20T18:37:55Z")

</div>

> [@jamesgreenblue](#):
>
> is there any chance that the cheers score could be exposed as part of the [adminGetUser API response](https://docs.discourse.org/#tag/Users/operation/adminGetUser)?

It’s already exposed at the public user info endpoint

```plaintext
 curl https://meta.discourse.org/u/falco.json -s | jq . | grep score
    "gamification_score": 83015,

```

> [@jamesgreenblue](#):
>
> it would be great if people could access the leaderboard by clicking on the score listed on their profile (both the popup and profile screen)

That’s a great suggestion, added to roadmap.

---

<div class="post-metadata">

### Author: ![mswanholm](https://avatars.discourse-cdn.com/v4/letter/m/2bfe46/32.png) [@mswanholm](https://meta.discourse.org/u/mswanholm)
#### Post date: [January 23, 2023, 11:04pm UTC](https://meta.discourse.org/t/how-to-query-gamification-score-via-the-api/251607/4 "2023-01-23T23:04:06Z")

</div>

I see that I can get a users All Time gamification score via the /u/[username].json API - but what about for a specific period? Also - is there anyway to get the DETAILS of the score (how may likes vs reads vs Solutions etc.)

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [January 23, 2023, 11:46pm UTC](https://meta.discourse.org/t/how-to-query-gamification-score-via-the-api/251607/5 "2023-01-23T23:46:45Z")

</div>

> [@mswanholm](#):
>
> I see that I can get a users All Time gamification score via the /u/[username].json API - but what about for a specific period?

That’s not possible at the moment. A possible workaround is creating a custom endpoint using [data explorer](https://meta.discourse.org/t/32566?silent=true) that receives a user and a time period and returns the score of the user from that period.

See [Run Data Explorer queries with the Discourse API](https://meta.discourse.org/t/run-data-explorer-queries-with-the-discourse-api/120063)

> [@mswanholm](#):
>
> Also - is there anyway to get the DETAILS of the score (how may likes vs reads vs Solutions etc.)

That’s not possible at the moment but something we plan on adding long term.

---

<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: [February 22, 2023, 11:47pm UTC](https://meta.discourse.org/t/how-to-query-gamification-score-via-the-api/251607/6 "2023-02-22T23:47:04Z")

</div>

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