{
  "openapi": "3.0.1",
  "info": {
    "title": "Twitch Public Streams, Channels, Videos and Clips Scraper",
    "description": "Extract public Twitch streams, games, channels, videos, clips, and search results through Twitch's anonymous web GraphQL surface with bounded pagination and request pacing.",
    "version": "1.2",
    "x-build-id": "XvsUZVxGyWXQXzYdH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/w3crawler~twitch-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-w3crawler-twitch-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/w3crawler~twitch-scraper/runs": {
      "post": {
        "operationId": "runs-sync-w3crawler-twitch-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/w3crawler~twitch-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-w3crawler-twitch-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "topStreams",
              "topGames",
              "search",
              "byChannel",
              "byCategory",
              "topClips",
              "byVideo",
              "byClip",
              "byUrl"
            ],
            "type": "string",
            "description": "Choose the public Twitch resource to extract.",
            "default": "topStreams"
          },
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "Required for search mode.",
            "default": "lirik"
          },
          "searchType": {
            "title": "Search result type",
            "enum": [
              "all",
              "channel",
              "game",
              "video"
            ],
            "type": "string",
            "description": "Return all supported search types or only channels, games, or videos.",
            "default": "all"
          },
          "channelName": {
            "title": "Channel name",
            "type": "string",
            "description": "Channel login, for example lirik."
          },
          "categorySlug": {
            "title": "Category slug",
            "type": "string",
            "description": "The value after /directory/category/, for example just-chatting."
          },
          "videoId": {
            "title": "Video ID",
            "type": "string",
            "description": "Numeric Twitch VOD identifier for byVideo mode."
          },
          "clipSlug": {
            "title": "Clip slug",
            "type": "string",
            "description": "Public Twitch clip slug for byClip mode."
          },
          "twitchUrls": {
            "title": "Twitch URLs",
            "type": "array",
            "description": "Public channel, category, VOD, or clip URLs for byUrl mode.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "language": {
            "title": "Broadcast language",
            "enum": [
              "",
              "EN",
              "ES",
              "DE",
              "FR",
              "PT",
              "RU",
              "JA",
              "KO",
              "ZH",
              "IT",
              "TR",
              "PL",
              "AR",
              "TH",
              "ID",
              "VI",
              "NL",
              "SV",
              "FI",
              "DA",
              "NO",
              "CS",
              "HU",
              "EL",
              "RO",
              "BG",
              "UK",
              "HE",
              "MS",
              "TL",
              "ASL",
              "OTHER"
            ],
            "type": "string",
            "description": "Filter stream queries by Twitch broadcast language. Select Any for no language filter.",
            "default": "EN"
          },
          "videoSort": {
            "title": "Channel VOD sort",
            "enum": [
              "TIME",
              "VIEWS"
            ],
            "type": "string",
            "description": "Sort channel VODs by publication time or public view count.",
            "default": "TIME"
          },
          "streamType": {
            "title": "Channel VOD type",
            "enum": [
              "",
              "ARCHIVE",
              "HIGHLIGHT",
              "UPLOAD",
              "PAST_PREMIERE",
              "PREMIERE_UPLOAD"
            ],
            "type": "string",
            "description": "Optionally keep only a specific channel video broadcast type.",
            "default": ""
          },
          "clipPeriod": {
            "title": "Clip time window",
            "enum": [
              "LAST_DAY",
              "LAST_WEEK",
              "LAST_MONTH",
              "ALL_TIME"
            ],
            "type": "string",
            "description": "Time window used for channel and category clip queries.",
            "default": "LAST_WEEK"
          },
          "includeChannelVideos": {
            "title": "Include channel VODs",
            "type": "boolean",
            "description": "Include recent public videos when using byChannel mode.",
            "default": true
          },
          "includeChannelClips": {
            "title": "Include channel clips",
            "type": "boolean",
            "description": "Include public clips when using byChannel mode.",
            "default": true
          },
          "minViewersCount": {
            "title": "Minimum live viewers",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Discard live streams below this current viewer count.",
            "default": 0
          },
          "minViewCount": {
            "title": "Minimum VOD / clip views",
            "minimum": 0,
            "maximum": 100000000,
            "type": "integer",
            "description": "Discard videos and clips below this public view count.",
            "default": 0
          },
          "containsKeyword": {
            "title": "Title contains",
            "type": "string",
            "description": "Case-insensitive stream, VOD, or clip title filter."
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 300,
            "type": "integer",
            "description": "Hard cap on unique dataset records.",
            "default": 50
          },
          "pageSize": {
            "title": "Results per request",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Number of connection items requested from Twitch per page.",
            "default": 30
          },
          "maxPages": {
            "title": "Maximum pages",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum pages fetched from each paginated Twitch connection.",
            "default": 5
          },
          "minDelayMs": {
            "title": "Minimum request delay (milliseconds)",
            "minimum": 100,
            "maximum": 5000,
            "type": "integer",
            "description": "Minimum delay between public Twitch GraphQL requests.",
            "default": 350
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 10,
            "maximum": 90,
            "type": "integer",
            "description": "Abort an individual Twitch request after this many seconds.",
            "default": 30
          },
          "maxResponseBytes": {
            "title": "Maximum response bytes",
            "minimum": 100000,
            "maximum": 10000000,
            "type": "integer",
            "description": "Maximum size of an individual Twitch GraphQL response or fixture response.",
            "default": 2000000
          },
          "fixtureFile": {
            "title": "Local fixture file",
            "pattern": "^(?!/)(?!.*\\\\)(?!.*\\.\\.).*\\.json$",
            "maxLength": 180,
            "type": "string",
            "description": "Optional Actor-relative JSON fixture with a responses array; when set, no network request is made."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}