{
  "openapi": "3.0.1",
  "info": {
    "title": "Twitch Scraper — Channels, Streams, VODs, Clips, Games & Search",
    "description": "HTTP-only, no-login Twitch scraper via public GraphQL. Channel profiles, live streams, VODs, clips, top games, search, VOD chapters & chat replay, schedule. Adds analytics, bio lead enrichment, HLS URLs & monitoring.",
    "version": "0.0",
    "x-build-id": "yNl4kQJhaxtLVUBPk"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/brilliant_gum~twitch-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-brilliant_gum-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/brilliant_gum~twitch-scraper/runs": {
      "post": {
        "operationId": "runs-sync-brilliant_gum-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/brilliant_gum~twitch-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-brilliant_gum-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",
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "channel",
              "live-streams",
              "top-games",
              "videos",
              "clips",
              "search",
              "vod-details",
              "vod-comments",
              "schedule",
              "url"
            ],
            "type": "string",
            "description": "What to scrape. 'channel' = full profile (+ optional live/videos/clips/schedule/analytics). 'live-streams' = live streams (all, or in a category via 'Game / category'). 'top-games' = most-watched categories. 'videos' = VODs per channel. 'clips' = top clips per channel. 'search' = channels + games by keyword. 'vod-details' = one VOD + chapters. 'vod-comments' = VOD chat replay. 'schedule' = upcoming stream schedule. 'url' = paste any twitch.tv links.",
            "default": "channel"
          },
          "channels": {
            "title": "Channels (usernames / URLs / IDs)",
            "type": "array",
            "description": "Twitch channels for 'channel', 'videos', 'clips' and 'schedule' modes. Accepts bare logins ('shroud'), '@handle', profile URLs ('https://twitch.tv/pokimane') or numeric user IDs (auto-resolved to logins).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "Keyword for 'search' mode — matched against channels and games/categories."
          },
          "searchType": {
            "title": "Search returns",
            "enum": [
              "all",
              "channels",
              "games"
            ],
            "type": "string",
            "description": "For 'search' mode: which result types to return.",
            "default": "all"
          },
          "gameName": {
            "title": "Game / category name",
            "type": "string",
            "description": "For 'live-streams' mode: exact game/category name (e.g. 'Just Chatting', 'League of Legends') to list only live streams in that category. Leave empty to get the top live streams overall."
          },
          "videoIds": {
            "title": "Video / VOD IDs",
            "type": "array",
            "description": "Numeric VOD IDs or full '/videos/ID' URLs for 'vod-details' and 'vod-comments' modes.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "urls": {
            "title": "URLs (URL mode)",
            "type": "array",
            "description": "For 'url' mode: paste any mix of twitch.tv links — channel pages, '/videos/ID', clip links, and '/directory/category/' pages. Each is routed to the right handler automatically.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "videoType": {
            "title": "Video type",
            "enum": [
              "ALL",
              "ARCHIVE",
              "HIGHLIGHT",
              "UPLOAD",
              "PAST_PREMIERE"
            ],
            "type": "string",
            "description": "For 'videos' mode: filter VODs by type. 'ALL' returns every type.",
            "default": "ARCHIVE"
          },
          "videoSort": {
            "title": "Video sort",
            "enum": [
              "TIME",
              "VIEWS"
            ],
            "type": "string",
            "description": "For 'videos' mode: ordering of returned VODs.",
            "default": "TIME"
          },
          "clipPeriod": {
            "title": "Clip period",
            "enum": [
              "LAST_DAY",
              "LAST_WEEK",
              "LAST_MONTH",
              "ALL_TIME"
            ],
            "type": "string",
            "description": "For 'clips' mode (and channel 'Include top clips'): time window for top clips.",
            "default": "LAST_WEEK"
          },
          "clipSort": {
            "title": "Clip sort",
            "enum": [
              "VIEWS_DESC",
              "TRENDING"
            ],
            "type": "string",
            "description": "For 'clips' mode: ordering of clips within the selected period.",
            "default": "VIEWS_DESC"
          },
          "maxItems": {
            "title": "Max items (total)",
            "minimum": 1,
            "type": "integer",
            "description": "Global cap on records written to the dataset in this run, across all targets and pages.",
            "default": 20
          },
          "maxPerChannel": {
            "title": "Max per channel",
            "minimum": 1,
            "type": "integer",
            "description": "For 'videos' / 'clips' (and channel 'Include' toggles): cap on items fetched per channel. The global 'Max items' still applies.",
            "default": 10
          },
          "maxComments": {
            "title": "Max comments per VOD",
            "minimum": 1,
            "type": "integer",
            "description": "For 'vod-comments' mode: cap on chat-replay messages fetched per VOD.",
            "default": 500
          },
          "includeVideos": {
            "title": "Channel: include recent videos",
            "type": "boolean",
            "description": "For 'channel' mode: attach the channel's recent VODs (up to 'Max per channel') as 'recentVideos'.",
            "default": false
          },
          "includeClips": {
            "title": "Channel: include top clips",
            "type": "boolean",
            "description": "For 'channel' mode: attach the channel's top clips (period from 'Clip period') as 'topClips'.",
            "default": false
          },
          "includeSchedule": {
            "title": "Channel: include schedule",
            "type": "boolean",
            "description": "For 'channel' mode: attach the channel's upcoming stream schedule as 'schedule'.",
            "default": false
          },
          "includeAnalytics": {
            "title": "Channel: include analytics",
            "type": "boolean",
            "description": "For 'channel' mode: compute analytics from recent VODs — average stream duration, streams/week, average VOD views, days since last broadcast, top games and current viewers. Adds an 'analytics' object.",
            "default": false
          },
          "includeMediaUrls": {
            "title": "Include media / download URLs",
            "type": "boolean",
            "description": "Attach direct media URLs. For clips: 'mp4Urls' with ready-to-download .mp4 links per quality (1080/720/480/360) plus 'mp4Qualities' (quality, frameRate, sourceURL). For live streams (channel mode) and VODs (vod-details mode): an HLS '.m3u8' manifest URL. All from Twitch's public no-login data; best-effort. On by default.",
            "default": true
          },
          "includeChapters": {
            "title": "VOD: include chapters",
            "type": "boolean",
            "description": "For 'vod-details' mode: include the VOD's chapter/game markers ('chapters').",
            "default": true
          },
          "enrichLeads": {
            "title": "Enrich leads from bio",
            "type": "boolean",
            "description": "For 'channel' mode: extract emails, links and social handles (Instagram, Twitter/X, TikTok, YouTube, Facebook, Discord, Telegram) from the bio and declared socials into a 'leads' object.",
            "default": true
          },
          "dedup": {
            "title": "Deduplicate",
            "type": "boolean",
            "description": "Drop duplicate records (same type + id) within a run.",
            "default": true
          },
          "monitorMode": {
            "title": "Monitor mode (growth / new only)",
            "type": "boolean",
            "description": "Track state across runs (in a named key-value store). Channel records gain a 'growth' object (follower delta & per-day rate vs the previous run); stream/video/clip/comment records are emitted only when new since the previous run.",
            "default": false
          },
          "stateKey": {
            "title": "Monitor campaign name",
            "type": "string",
            "description": "Optional label to keep a monitoring campaign's state separate (or shared). Used only when 'Monitor mode' is on."
          },
          "outputPreset": {
            "title": "Output preset",
            "enum": [
              "full",
              "compact"
            ],
            "type": "string",
            "description": "Record shape: 'full' (all fields) or 'compact' (the most useful ~20 fields).",
            "default": "full"
          },
          "flattenOutput": {
            "title": "Flatten output",
            "type": "boolean",
            "description": "Dot-flatten nested objects (leads.socials.instagram, analytics.streamsPerWeek, …) for clean CSV/Excel export.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxies are included and configured automatically — leave the default in place. Only switch proxies if you hit rate limits.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}