Twitch Streams API

Retrieve stream information and markers

Documentation

Specifications

Other Resources

OpenAPI Specification

twitch-streams-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Twitch Drops Ads Streams 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: Streams
  description: Retrieve stream information and markers
paths:
  /streams:
    get:
      operationId: getStreams
      summary: Twitch Get Streams
      description: Gets a list of all streams matching the provided filters.
      tags:
      - Streams
      parameters:
      - $ref: '#/components/parameters/clientId'
      - name: user_id
        in: query
        schema:
          type: string
      - name: user_login
        in: query
        schema:
          type: string
      - name: game_id
        in: query
        schema:
          type: string
      - name: type
        in: query
        schema:
          type: string
          enum:
          - all
          - live
      - name: language
        in: query
        schema:
          type: string
      - $ref: '#/components/parameters/first'
      - $ref: '#/components/parameters/after'
      - $ref: '#/components/parameters/before'
      responses:
        '200':
          description: Streams returned successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Stream'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
  /streams/followed:
    get:
      operationId: getFollowedStreams
      summary: Twitch Get Followed Streams
      description: Gets the list of streams that the authenticated user follows.
      tags:
      - Streams
      parameters:
      - $ref: '#/components/parameters/clientId'
      - name: user_id
        in: query
        required: true
        schema:
          type: string
      - $ref: '#/components/parameters/first'
      - $ref: '#/components/parameters/after'
      responses:
        '200':
          description: Followed streams returned successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Stream'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
  /streams/markers:
    get:
      operationId: getStreamMarkers
      summary: Twitch Get Stream Markers
      description: Gets a list of markers from the user's most recent stream or from a specific VOD.
      tags:
      - Streams
      parameters:
      - $ref: '#/components/parameters/clientId'
      - name: user_id
        in: query
        schema:
          type: string
      - name: video_id
        in: query
        schema:
          type: string
      - $ref: '#/components/parameters/first'
      - $ref: '#/components/parameters/after'
      - $ref: '#/components/parameters/before'
      responses:
        '200':
          description: Stream markers returned successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/StreamMarkerGroup'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
    post:
      operationId: createStreamMarker
      summary: Twitch Create Stream Marker
      description: Creates a marker in the stream at the current timestamp.
      tags:
      - Streams
      parameters:
      - $ref: '#/components/parameters/clientId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - user_id
              properties:
                user_id:
                  type: string
                description:
                  type: string
                  maxLength: 140
      responses:
        '200':
          description: Stream marker created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/StreamMarker'
  /streams/key:
    get:
      operationId: getStreamKey
      summary: Twitch Get Stream Key
      description: Gets the broadcaster's stream key.
      tags:
      - Streams
      parameters:
      - $ref: '#/components/parameters/clientId'
      - name: broadcaster_id
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Stream key returned successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        stream_key:
                          type: string
  /tags/streams:
    get:
      operationId: getStreamTags
      summary: Twitch Get Stream Tags
      description: Gets the list of stream tags for the specified broadcaster.
      tags:
      - Streams
      parameters:
      - $ref: '#/components/parameters/clientId'
      - name: broadcaster_id
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Stream tags returned
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/StreamTag'
components:
  schemas:
    StreamMarker:
      type: object
      properties:
        id:
          type: string
        created_at:
          type: string
          format: date-time
        description:
          type: string
        position_seconds:
          type: integer
    Pagination:
      type: object
      properties:
        cursor:
          type: string
          description: Cursor value for pagination
    StreamTag:
      type: object
      properties:
        tag_id:
          type: string
        is_auto:
          type: boolean
        localization_names:
          type: object
          additionalProperties:
            type: string
        localization_descriptions:
          type: object
          additionalProperties:
            type: string
    Stream:
      type: object
      properties:
        id:
          type: string
        user_id:
          type: string
        user_login:
          type: string
        user_name:
          type: string
        game_id:
          type: string
        game_name:
          type: string
        type:
          type: string
          enum:
          - live
          - ''
        title:
          type: string
        viewer_count:
          type: integer
        started_at:
          type: string
          format: date-time
        language:
          type: string
        thumbnail_url:
          type: string
        tags:
          type: array
          items:
            type: string
        is_mature:
          type: boolean
    StreamMarkerGroup:
      type: object
      properties:
        user_id:
          type: string
        user_name:
          type: string
        user_login:
          type: string
        videos:
          type: array
          items:
            type: object
            properties:
              video_id:
                type: string
              markers:
                type: array
                items:
                  $ref: '#/components/schemas/StreamMarker'
  parameters:
    after:
      name: after
      in: query
      schema:
        type: string
      description: Cursor for forward pagination
    before:
      name: before
      in: query
      schema:
        type: string
      description: Cursor for backward pagination
    first:
      name: first
      in: query
      schema:
        type: integer
        default: 20
        maximum: 100
      description: Maximum number of items to return
    clientId:
      name: Client-Id
      in: header
      required: true
      schema:
        type: string
      description: Your registered application's client ID
  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/