Twitch Games API

Retrieve game/category information

Documentation

Specifications

Other Resources

OpenAPI Specification

twitch-games-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Twitch Drops Ads Games 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: Games
  description: Retrieve game/category information
paths:
  /games:
    get:
      operationId: getGames
      summary: Twitch Get Games
      description: Gets information about one or more games/categories.
      tags:
      - Games
      parameters:
      - $ref: '#/components/parameters/clientId'
      - name: id
        in: query
        schema:
          type: string
        description: The game/category ID
      - name: name
        in: query
        schema:
          type: string
        description: The game/category name
      - name: igdb_id
        in: query
        schema:
          type: string
        description: The IGDB ID of the game
      responses:
        '200':
          description: Games returned successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Game'
        '400':
          $ref: '#/components/responses/BadRequest'
    post:
      operationId: queryGames
      summary: Twitch Query Games
      description: Query the games endpoint using Apicalypse query language. Send the query as the request body in plain text format.
      tags:
      - Games
      parameters:
      - $ref: '#/components/parameters/clientId_2'
      requestBody:
        required: true
        content:
          text/plain:
            schema:
              type: string
              example: fields name,rating,summary,genres.name; where rating > 90; sort rating desc; limit 10;
      responses:
        '200':
          description: Games returned successfully
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Game_2'
        '400':
          description: Invalid query syntax
        '401':
          $ref: '#/components/responses/Unauthorized'
  /games/top:
    get:
      operationId: getTopGames
      summary: Twitch Get Top Games
      description: Gets games sorted by number of current viewers, most popular first.
      tags:
      - Games
      parameters:
      - $ref: '#/components/parameters/clientId'
      - $ref: '#/components/parameters/first'
      - $ref: '#/components/parameters/after'
      - $ref: '#/components/parameters/before'
      responses:
        '200':
          description: Top games returned successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Game'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
  /games/count:
    post:
      operationId: countGames
      summary: Twitch Count Games
      description: Returns the count of games matching the query.
      tags:
      - Games
      parameters:
      - $ref: '#/components/parameters/clientId_2'
      requestBody:
        content:
          text/plain:
            schema:
              type: string
      responses:
        '200':
          description: Count returned
          content:
            application/json:
              schema:
                type: object
                properties:
                  count:
                    type: integer
  /release_dates:
    post:
      operationId: queryReleaseDates
      summary: Twitch Query Release Dates
      description: Query game release dates across platforms and regions.
      tags:
      - Games
      parameters:
      - $ref: '#/components/parameters/clientId_2'
      requestBody:
        required: true
        content:
          text/plain:
            schema:
              type: string
      responses:
        '200':
          description: Release dates returned
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ReleaseDate'
components:
  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
    clientId_2:
      name: Client-ID
      in: header
      required: true
      schema:
        type: string
      description: Twitch application client ID
    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
  schemas:
    Pagination:
      type: object
      properties:
        cursor:
          type: string
          description: Cursor value for pagination
    Game:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        box_art_url:
          type: string
        igdb_id:
          type: string
    Game_2:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        slug:
          type: string
        summary:
          type: string
        storyline:
          type: string
        rating:
          type: number
          format: double
        rating_count:
          type: integer
        aggregated_rating:
          type: number
          format: double
        aggregated_rating_count:
          type: integer
        total_rating:
          type: number
          format: double
        total_rating_count:
          type: integer
        first_release_date:
          type: integer
          description: Unix timestamp
        category:
          type: integer
          description: 0=main_game, 1=dlc_addon, 2=expansion, 3=bundle, 4=standalone_expansion, 5=mod, 6=episode, 7=season, 8=remake, 9=remaster, 10=expanded_game, 11=port, 12=fork, 13=pack, 14=update
        status:
          type: integer
          description: 0=released, 2=alpha, 3=beta, 4=early_access, 5=offline, 6=cancelled, 7=rumored, 8=delisted
        genres:
          type: array
          items:
            type: integer
        platforms:
          type: array
          items:
            type: integer
        themes:
          type: array
          items:
            type: integer
        cover:
          type: integer
        screenshots:
          type: array
          items:
            type: integer
        artworks:
          type: array
          items:
            type: integer
        videos:
          type: array
          items:
            type: integer
        involved_companies:
          type: array
          items:
            type: integer
        franchises:
          type: array
          items:
            type: integer
        collection:
          type: integer
        similar_games:
          type: array
          items:
            type: integer
        url:
          type: string
        created_at:
          type: integer
        updated_at:
          type: integer
    Error:
      type: object
      properties:
        error:
          type: string
        status:
          type: integer
        message:
          type: string
    ReleaseDate:
      type: object
      properties:
        id:
          type: integer
        game:
          type: integer
        platform:
          type: integer
        date:
          type: integer
          description: Unix timestamp
        region:
          type: integer
          description: 1=Europe, 2=North America, 3=Australia, 4=New Zealand, 5=Japan, 6=China, 7=Asia, 8=Worldwide, 9=Korea, 10=Brazil
        category:
          type: integer
          description: 0=YYYYMMMMDD, 1=YYYYMMMM, 2=YYYY, 3=YYYYQ1, 4=YYYYQ2, 5=YYYYQ3, 6=YYYYQ4, 7=TBD
        human:
          type: string
          description: Human-readable date string
        created_at:
          type: integer
        updated_at:
          type: integer
  responses:
    Unauthorized:
      description: Authentication required or token is invalid
    BadRequest:
      description: The request was 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/