{
  "openapi": "3.0.1",
  "info": {
    "title": "Twitch Scraper",
    "description": "Scrape Twitch, search channels/categories/videos/clips, fetch top live streams, channel info, top games, VOD metadata, and clip details. No login or API key required.",
    "version": "1.0",
    "x-build-id": "YvVhirKj7bwvfjK09"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~twitch-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-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/crawlerbros~twitch-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-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/crawlerbros~twitch-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-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": "What to fetch.",
            "default": "topStreams"
          },
          "searchQuery": {
            "title": "Search query (mode=search)",
            "type": "string",
            "description": "Free-text query for `mode=search` — matches channels, games, and videos.",
            "default": "lirik"
          },
          "searchType": {
            "title": "Search result type (mode=search)",
            "enum": [
              "all",
              "channel",
              "game",
              "video"
            ],
            "type": "string",
            "description": "Restrict search results to a single result type. `all` returns channels + games + videos.",
            "default": "all"
          },
          "channelName": {
            "title": "Channel login / name (mode=byChannel)",
            "type": "string",
            "description": "Twitch channel login (the part after twitch.tv/, e.g. `lirik`, `shroud`, `pokimane`)."
          },
          "categorySlug": {
            "title": "Category slug (mode=byCategory or topClips)",
            "type": "string",
            "description": "Twitch category (game) slug, e.g. `just-chatting`, `league-of-legends`, `valorant`. Find it from the URL: twitch.tv/directory/category/<slug>."
          },
          "videoId": {
            "title": "Video ID (mode=byVideo)",
            "type": "string",
            "description": "Twitch VOD ID, e.g. `2766365638`. Find it from twitch.tv/videos/<id>."
          },
          "clipSlug": {
            "title": "Clip slug (mode=byClip)",
            "type": "string",
            "description": "Twitch clip slug, e.g. `AcceptablePleasantAuberginePanicVis-EVdxDQ1vsQAQZpBS`. Find it from twitch.tv/<channel>/clip/<slug>."
          },
          "twitchUrls": {
            "title": "Twitch URLs (mode=byUrl)",
            "type": "array",
            "description": "Direct Twitch URLs to resolve. Supports channel pages (twitch.tv/<channel>), VOD pages (twitch.tv/videos/<id>), clip pages (twitch.tv/<channel>/clip/<slug>), and category pages (twitch.tv/directory/category/<slug>).",
            "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 live streams (and search results) to a specific broadcast language. Applies to `topStreams`, `byCategory`, and `search`. Leave on `(any)` for no filter.",
            "default": "EN"
          },
          "streamType": {
            "title": "VOD type filter (mode=byChannel)",
            "enum": [
              "",
              "ARCHIVE",
              "HIGHLIGHT",
              "UPLOAD",
              "PAST_PREMIERE",
              "PREMIERE_UPLOAD"
            ],
            "type": "string",
            "description": "Restrict the VOD list returned for a channel to a specific broadcast type. Leave blank for all types.",
            "default": ""
          },
          "videoSort": {
            "title": "Video sort order (mode=byChannel)",
            "enum": [
              "TIME",
              "VIEWS"
            ],
            "type": "string",
            "description": "How to sort the channel's VODs.",
            "default": "TIME"
          },
          "clipPeriod": {
            "title": "Clip time window",
            "enum": [
              "LAST_DAY",
              "LAST_WEEK",
              "LAST_MONTH",
              "ALL_TIME"
            ],
            "type": "string",
            "description": "For `topClips` and `byChannel` clip lists: time window over which clips were created.",
            "default": "LAST_WEEK"
          },
          "includeChannelClips": {
            "title": "Include clips (mode=byChannel)",
            "type": "boolean",
            "description": "When `mode=byChannel`, also fetch and emit top clips for the channel.",
            "default": true
          },
          "includeChannelVideos": {
            "title": "Include VODs (mode=byChannel)",
            "type": "boolean",
            "description": "When `mode=byChannel`, also fetch and emit recent VODs for the channel.",
            "default": true
          },
          "minViewersCount": {
            "title": "Min concurrent viewers (live streams filter)",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Drop live streams with fewer concurrent viewers than this. Applies to `topStreams` and `byCategory`."
          },
          "minViewCount": {
            "title": "Min total views (videos / clips filter)",
            "minimum": 0,
            "maximum": 100000000,
            "type": "integer",
            "description": "Drop VODs and clips with fewer total views than this."
          },
          "containsKeyword": {
            "title": "Title contains keyword",
            "type": "string",
            "description": "Substring filter applied case-insensitively to stream/video/clip titles."
          },
          "authToken": {
            "title": "Twitch OAuth token (optional)",
            "type": "string",
            "description": "Optional Twitch OAuth user-token (the value of the `auth-token` cookie on twitch.tv when logged in). Increases rate limits and can unlock subscriber-only data. Not required for any mode."
          },
          "useApifyProxy": {
            "title": "Use Apify proxy",
            "type": "boolean",
            "description": "Route requests through the Apify proxy from the start. When OFF the actor still auto-engages the proxy if the first direct attempt emits zero records, so leaving this OFF saves cost on most runs.",
            "default": false
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Hard cap on emitted records.",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}