TwitchBitsRequests
Inherits: TwitchRequestBase < RefCounted < Object
Twitch Bits API for leaderboards, cheermotes, and transactions.
Description
TwitchBitsRequests provides methods for accessing Bits leaderboards, cheermote information, and extension Bits transactions. Requires bits:read OAuth scope for leaderboards. Access through TwitchAPI.get_bits().
Tutorials
Methods
void |
get_bits_leaderboard(params: Dictionary = {}) |
void |
get_cheermotes(broadcaster_id: String = "") |
void |
get_extension_transactions(extension_id: String, params: Dictionary = {}) |
Method Descriptions
void get_bits_leaderboard(params: Dictionary = {}) 🔗
Gets the Bits leaderboard for the authenticated broadcaster. Optional params can include count, period, started_at, and user_id. Results are returned via the TwitchAPI.request_completed signal with signal_name "bits_leaderboard_received".
Response includes: Array of users with user_id, user_login, user_name, rank, score; date_range (started_at, ended_at); total count.
var params = {"count": 10, "period": "week"}
TwitchAPI.get_bits().get_bits_leaderboard(params)
# Response: {"data": [{"user_id": "123", "user_login": "user1", "user_name": "User1", "rank": 1, "score": 5000}], "date_range": {"started_at": "2025-10-10T00:00:00Z", "ended_at": "2025-10-16T23:59:59Z"}, "total": 50}
void get_cheermotes(broadcaster_id: String = "") 🔗
Gets the list of Cheermotes available for Bits donations. Optional broadcaster_id retrieves broadcaster-specific custom cheermotes. Results are returned via the TwitchAPI.request_completed signal with signal_name "cheermotes_received".
Response includes: Array of cheermotes with prefix, type, order, last_updated, is_charitable, tiers (min_bits, id, color, images, can_cheer).
TwitchAPI.get_bits().get_cheermotes("broadcaster_id")
# Response: {"data": [{"prefix": "Cheer", "type": "global_first_party", "order": 1, "tiers": [{"min_bits": 1, "id": "1", "color": "#979797", "images": {...}, "can_cheer": true}]}]}
void get_extension_transactions(extension_id: String, params: Dictionary = {}) 🔗
Gets a list of Bits transactions for the specified extension. Optional params can include id and first. Results are returned via the TwitchAPI.request_completed signal with signal_name "extension_transactions_received".
Response includes: Array of transactions with id, timestamp, broadcaster_id/login/name, user_id/login/name, product_type, product_data (domain, sku, cost).
TwitchAPI.get_bits().get_extension_transactions("extension_id", {"first": 20})
# Response: {"data": [{"id": "txn123", "timestamp": "2025-10-16T12:00:00Z", "broadcaster_id": "456", "user_id": "789", "product_type": "BITS_IN_EXTENSION", "product_data": {"sku": "item1", "cost": {"amount": 100, "type": "bits"}}}]}