So currently the only way to find the total number of bits that a user has given to a channel is by listening via PubSub and getting an event.
Was wondering if there were plans to add it anywhere else such as an endpoint for channels to get a list of those who’ve given bits and how much, similarly to how you can get subscribers and their level for a channel?
But this is only accessible with a cookie called “persistent” in the format of “user id:unknown:unknown” (and URI encoded). You can get your own by opening the developer console in your browser, opening it to the Network tab, and then load a Twitch page. You’ll need to defeat the scroll as there will be many requests and select the first one in the list. Once you click it you’ll get a new panel. Click the “Headers” tab and then look at the “Request Headers” section for “cookie:” and the big wall of text. These are your cookies. Read through the “cookie” header’s value and you’ll find a cookie labeled “persistent=…” – this is your “persistent” cookie that you can use.
Here’s an example request in cURL with a randomized cookie checking “Alca” (me) in ScufJumpn’s channel:
Further the method Alca mentions is only possible from a self perspective. The original request is for a channel to list bit totals for all users who’ve cheered in the channel.
As I said, “unfortunately this is not practical to get other users’ data.” You would have to update a DB with the PubSub channel-bits-events-v1.xxxx topic’s “total_bits_used” value.