Twitch Bits API

Retrieve Bits leaderboard and Cheermote information

Documentation

Specifications

Other Resources

OpenAPI Specification

twitch-bits-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Twitch Drops Ads Bits API
  description: APIs for game developers to create and manage Drops campaigns that grant in-game rewards to Twitch viewers watching streamers play their game. Drops campaigns are managed through the Twitch Developer Console and fulfilled via the Helix API entitlements endpoints.
  version: '1.0'
  contact:
    name: Twitch Developer Support
    url: https://dev.twitch.tv/support/
  termsOfService: https://www.twitch.tv/p/legal/terms-of-service/
servers:
- url: https://api.twitch.tv/helix
  description: Twitch Helix API Production
security:
- oauth2: []
tags:
- name: Bits
  description: Retrieve Bits leaderboard and Cheermote information
paths:
  /bits/leaderboard:
    get:
      operationId: getBitsLeaderboard
      summary: Twitch Get Bits Leaderboard
      description: Gets the Bits leaderboard for the authenticated broadcaster.
      tags:
      - Bits
      parameters:
      - $ref: '#/components/parameters/clientId'
      - name: count
        in: query
        schema:
          type: integer
          default: 10
          maximum: 100
        description: Number of results to return
      - name: period
        in: query
        schema:
          type: string
          enum:
          - day
          - week
          - month
          - year
          - all
        description: Time period for the leaderboard
      - name: started_at
        in: query
        schema:
          type: string
          format: date-time
        description: Start date for the leaderboard period
      - name: user_id
        in: query
        schema:
          type: string
        description: Filter by specific user ID
      responses:
        '200':
          description: Bits leaderboard returned successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/BitsLeaderboardEntry'
                  date_range:
                    type: object
                    properties:
                      started_at:
                        type: string
                        format: date-time
                      ended_at:
                        type: string
                        format: date-time
                  total:
                    type: integer
        '401':
          $ref: '#/components/responses/Unauthorized'
  /bits/cheermotes:
    get:
      operationId: getCheermotes
      summary: Twitch Get Cheermotes
      description: Gets a list of Cheermotes that users can use to cheer Bits.
      tags:
      - Bits
      parameters:
      - $ref: '#/components/parameters/clientId'
      - name: broadcaster_id
        in: query
        schema:
          type: string
        description: The ID of the broadcaster whose Cheermotes to retrieve
      responses:
        '200':
          description: Cheermotes returned successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Cheermote'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  parameters:
    clientId:
      name: Client-Id
      in: header
      required: true
      schema:
        type: string
      description: Your registered application's client ID
  schemas:
    BitsLeaderboardEntry:
      type: object
      properties:
        user_id:
          type: string
        user_login:
          type: string
        user_name:
          type: string
        rank:
          type: integer
        score:
          type: integer
    Error:
      type: object
      properties:
        error:
          type: string
        status:
          type: integer
        message:
          type: string
    Cheermote:
      type: object
      properties:
        prefix:
          type: string
        tiers:
          type: array
          items:
            type: object
            properties:
              min_bits:
                type: integer
              id:
                type: string
              color:
                type: string
              can_cheer:
                type: boolean
              show_in_bits_card:
                type: boolean
        type:
          type: string
        order:
          type: integer
        last_updated:
          type: string
          format: date-time
        is_charitable:
          type: boolean
  responses:
    Unauthorized:
      description: Authentication required or token is invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://id.twitch.tv/oauth2/token
          scopes: {}
externalDocs:
  description: Twitch Drops Documentation
  url: https://dev.twitch.tv/docs/drops/