# Does the API provide a way of determining how many bits a user has given to a channel?

**URL:** <https://staging-discuss.dev.twitch.com/t/does-the-api-provide-a-way-of-determining-how-many-bits-a-user-has-given-to-a-channel/8676>\
**Category:** API\
**Created:** [January 1, 2017, 9:05pm UTC](https://staging-discuss.dev.twitch.com/t/does-the-api-provide-a-way-of-determining-how-many-bits-a-user-has-given-to-a-channel/8676 "2017-01-01T21:05:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dfoverdx](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/dfoverdx/32/13201_2.png) [@dfoverdx](https://staging-discuss.dev.twitch.com/u/dfoverdx)\
**Post date:** [January 1, 2017, 9:05pm UTC](https://staging-discuss.dev.twitch.com/t/does-the-api-provide-a-way-of-determining-how-many-bits-a-user-has-given-to-a-channel/8676/1 "2017-01-01T21:05:46Z")

</div>

The Super Mario Maker app, warp.world, has the ability to check a user’s subscription status to the current channel, and prioritize their levels in the queue. I can’t afford to subscribe, but I can afford to watch ads and give bits to my favorite streamers, so I suggested to the dev that he might add a feature that takes bits into account when calculating priority.

Is there a way to know how many bits someone has given to a channel? Barring that, is there a way to get which bits badge they have?

---

<div class="post-metadata">

**Author:** ![GrimtrisharaLok](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/grimtrisharalok/32/2345_2.png) [@GrimtrisharaLok](https://staging-discuss.dev.twitch.com/u/GrimtrisharaLok)\
**Post date:** [January 2, 2017, 12:28am UTC](https://staging-discuss.dev.twitch.com/t/does-the-api-provide-a-way-of-determining-how-many-bits-a-user-has-given-to-a-channel/8676/2 "2017-01-02T00:28:13Z")

</div>

I would assume not yet, because it isn’t listed in the documentation, but you can make the function calls for the user and channel to check possibly.

---

<div class="post-metadata">

**Author:** ![george](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/george/32/120_2.png) [@george](https://staging-discuss.dev.twitch.com/u/george)\
**Post date:** [January 2, 2017, 1:20am UTC](https://staging-discuss.dev.twitch.com/t/does-the-api-provide-a-way-of-determining-how-many-bits-a-user-has-given-to-a-channel/8676/3 "2017-01-02T01:20:07Z")

</div>

There is not an API for querying that information. You can determine which bits badge a user has by checking the `badges` tag on PRIVMSG when that user sends a message in chat.

@badges=staff/1, **bits/1000** ; …

---

<div class="post-metadata">

**Author:** ![Larklen](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/larklen/32/2138_2.png) [@Larklen](https://staging-discuss.dev.twitch.com/u/Larklen)\
**Post date:** [January 2, 2017, 2:29am UTC](https://staging-discuss.dev.twitch.com/t/does-the-api-provide-a-way-of-determining-how-many-bits-a-user-has-given-to-a-channel/8676/4 "2017-01-02T02:29:42Z")

</div>

I believe you can also use the PubSub to see user stats when they send bits.

The page I am referring to is [here.](https://dev.twitch.tv/docs/v5/guides/PubSub/bits/)

The example given in that page is below and you will note the line ‘`total_bits_used`’ - you could use that to determine total bits provided. Using the badge is only useful for a general approximation, if the user even chooses to show it, and whenever they send a message vs when bits specifically are sent.

```
{
   "type": "MESSAGE",
   "data": {
      "topic": "channel-bitsevents.44322889",
      "message": {
         "user_name": "dallas",
         "channel_name": "twitch",
         "user_id": "44322889",
         "channel_id": "12826",
         "time": "2015-12-19T16:39:57-08:00",
         "chat_message": "Omg that baneling bust was Kreygasm cheer10 cheer10 cheer100",
         "bits_used": 120,
         "total_bits_used": 620,
         "context": "cheer"
         }
   }
}
```

---

<div class="post-metadata">

**Author:** ![DallasNChains](https://d1d6mrmdu7ztse.cloudfront.net/user_avatar/staging-discuss.dev.twitch.com/dallasnchains/32/1608_2.png) [@DallasNChains](https://staging-discuss.dev.twitch.com/u/DallasNChains)\
**Post date:** [January 3, 2017, 3:20pm UTC](https://staging-discuss.dev.twitch.com/t/does-the-api-provide-a-way-of-determining-how-many-bits-a-user-has-given-to-a-channel/8676/5 "2017-01-03T15:20:15Z")

</div>

@Larklen is correct. You can get the total amount using the PubSub topic.

---

<div class="post-metadata">

**Author:** ![system](https://d2spem0quai2ol.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://staging-discuss.dev.twitch.com/u/system)\
**Post date:** [February 2, 2017, 3:20pm UTC](https://staging-discuss.dev.twitch.com/t/does-the-api-provide-a-way-of-determining-how-many-bits-a-user-has-given-to-a-channel/8676/6 "2017-02-02T15:20:26Z")

</div>

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