{
  "openapi": "3.0.1",
  "info": {
    "title": "Twitch Live Stream Intelligence",
    "description": "Monitor Twitch streams, detect viewer growth, track live channels, discover rising categories, and collect structured Twitch intelligence automatically — from public data only.",
    "version": "0.1",
    "x-build-id": "yjvranDRC6WKF1cLU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tuhin~twitch-live-stream-intelligence/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tuhin-twitch-live-stream-intelligence",
        "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/tuhin~twitch-live-stream-intelligence/runs": {
      "post": {
        "operationId": "runs-sync-tuhin-twitch-live-stream-intelligence",
        "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/tuhin~twitch-live-stream-intelligence/run-sync": {
      "post": {
        "operationId": "run-sync-tuhin-twitch-live-stream-intelligence",
        "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": {
          "channels": {
            "title": "Twitch channels",
            "type": "array",
            "description": "Twitch channel usernames or URLs to monitor (e.g. \"xqc\" or \"https://twitch.tv/xqc\"). Provide one or many.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Categories / games",
            "type": "array",
            "description": "Optional. Discover currently-live channels in these Twitch categories/games (e.g. \"Just Chatting\", \"League of Legends\"). Combined with any channels above.",
            "items": {
              "type": "string"
            }
          },
          "languages": {
            "title": "Language filter",
            "type": "array",
            "description": "Optional. Only keep streams in these languages (Twitch 2-letter codes, e.g. \"EN\", \"DE\", \"ES\").",
            "items": {
              "type": "string"
            }
          },
          "liveOnly": {
            "title": "Live channels only",
            "type": "boolean",
            "description": "If enabled, offline channels are skipped and only currently-live streams are recorded.",
            "default": false
          },
          "minimumViewers": {
            "title": "Minimum viewers",
            "minimum": 0,
            "type": "integer",
            "description": "Only keep live streams with at least this many viewers. 0 = no minimum.",
            "default": 0
          },
          "maximumViewers": {
            "title": "Maximum viewers",
            "minimum": 0,
            "type": "integer",
            "description": "Only keep live streams with at most this many viewers. 0 = no maximum.",
            "default": 0
          },
          "minimumStreamDurationSeconds": {
            "title": "Minimum stream duration (seconds)",
            "minimum": 0,
            "type": "integer",
            "description": "Only keep live streams that have been live for at least this long. 0 = no minimum.",
            "default": 0
          },
          "monitoringIntervalSeconds": {
            "title": "Monitoring interval (seconds)",
            "minimum": 0,
            "type": "integer",
            "description": "If greater than 0, the Actor re-checks the channels every N seconds within a single run to build a short observation series. Leave 0 for a single snapshot (recommended for scheduled runs).",
            "default": 0
          },
          "maximumMonitoringDurationSeconds": {
            "title": "Maximum monitoring duration (seconds)",
            "minimum": 0,
            "type": "integer",
            "description": "Upper bound on how long a monitoring run keeps polling (only used when a monitoring interval is set). 0 = single snapshot.",
            "default": 0
          },
          "maximumChannels": {
            "title": "Maximum channels per cycle",
            "minimum": 0,
            "type": "integer",
            "description": "Safety cap on how many channels are processed per cycle (after category discovery). 0 = no cap.",
            "default": 0
          },
          "categoryStreamsPerGame": {
            "title": "Streams discovered per category",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many currently-live streams to pull from each category/game in the discovery step.",
            "default": 30
          },
          "enableAnalysis": {
            "title": "Enable intelligence analysis",
            "type": "boolean",
            "description": "Compute growth metrics, category intelligence, streamer intelligence, and brand/sponsorship signals. Disable for a leaner raw snapshot.",
            "default": true
          },
          "previousDatasetId": {
            "title": "Previous dataset ID (for cross-run comparison)",
            "type": "string",
            "description": "Optional. The dataset ID of a previous run of this Actor. Its most recent observation per channel is used as the baseline so viewer changes and stream events are detected across scheduled runs."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy used for requests to Twitch's public API. Apify Proxy (datacenter) is recommended.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}