{
  "openapi": "3.0.1",
  "info": {
    "title": "YouTube Live Stream & Replay Chat Extractor",
    "description": "Collect chat messages, Super Chats, Super Stickers, and membership events from an active YouTube livestream or an ended stream's saved chat replay, with author and timestamp detail.",
    "version": "1.1",
    "x-build-id": "RX1LgB29gltcaO0El"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dataspryva~youtube-live-stream-and-replay-chat-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dataspryva-youtube-live-stream-and-replay-chat-extractor",
        "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/dataspryva~youtube-live-stream-and-replay-chat-extractor/runs": {
      "post": {
        "operationId": "runs-sync-dataspryva-youtube-live-stream-and-replay-chat-extractor",
        "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/dataspryva~youtube-live-stream-and-replay-chat-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-dataspryva-youtube-live-stream-and-replay-chat-extractor",
        "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": {
          "videoRefs": {
            "title": "Video URLs or IDs",
            "type": "array",
            "description": "YouTube watch, live, shorts or youtu.be links, 11-character video IDs, or a channel live link such as @handle/live.",
            "items": {
              "type": "string"
            }
          },
          "channelRefs": {
            "title": "Channels",
            "type": "array",
            "description": "Channel handles (@name), channel URLs or UC… channel IDs. The actor discovers current live streams and recent stream replays from each channel.",
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "Chat mode",
            "enum": [
              "auto",
              "active",
              "replay"
            ],
            "type": "string",
            "description": "Auto detects live versus replay. Active captures an ongoing live chat. Replay reads the saved chat of an ended stream.",
            "default": "auto"
          },
          "channelDiscoveryMode": {
            "title": "Channel discovery",
            "enum": [
              "current_live",
              "current_live_then_replays",
              "latest_replays"
            ],
            "type": "string",
            "description": "Which streams to pick from each channel. Used with channel references.",
            "default": "current_live_then_replays"
          },
          "maxVideosPerChannel": {
            "title": "Videos per channel",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum streams to process from each channel.",
            "default": 5
          },
          "lookbackDays": {
            "title": "Replay lookback days",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "How far back to include ended streams from a channel. Use 0 for no limit.",
            "default": 30
          },
          "includeUpcomingLives": {
            "title": "Include upcoming streams",
            "type": "boolean",
            "description": "Emit an upcoming status row for scheduled channel streams instead of skipping them.",
            "default": false
          },
          "maxMessagesPerVideo": {
            "title": "Messages per video",
            "minimum": 0,
            "maximum": 200000,
            "type": "integer",
            "description": "Maximum unique chat events collected from each video. Use 0 to collect every available event.",
            "default": 5000
          },
          "maxTotalItems": {
            "title": "Maximum dataset items",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Whole-run cap across all videos and summary rows. Use 0 for no limit.",
            "default": 0
          },
          "maxTimePerVideoSecs": {
            "title": "Time budget per video",
            "minimum": 30,
            "maximum": 86400,
            "type": "integer",
            "description": "Safety limit for replay pagination on one video, in seconds. A run that reaches it reports partial_capture.",
            "default": 600
          },
          "includeNormalMessages": {
            "title": "Include normal messages",
            "type": "boolean",
            "description": "Include standard text chat messages.",
            "default": true
          },
          "includeSuperChats": {
            "title": "Include Super Chats and Stickers",
            "type": "boolean",
            "description": "Include paid Super Chat messages and paid Super Stickers.",
            "default": true
          },
          "includeMembershipEvents": {
            "title": "Include memberships",
            "type": "boolean",
            "description": "Include new and renewed channel membership events.",
            "default": true
          },
          "includeGiftEvents": {
            "title": "Include gifts",
            "type": "boolean",
            "description": "Include gift membership purchases, gift membership redemptions and paid gift messages.",
            "default": true
          },
          "includeSystemEvents": {
            "title": "Include system events",
            "type": "boolean",
            "description": "Include engagement notices, slow-mode changes, restricted participation and other system rows.",
            "default": true
          },
          "includePlaceholders": {
            "title": "Include placeholders",
            "type": "boolean",
            "description": "Include raw placeholder rows that contain only an ID and timestamp.",
            "default": false
          },
          "includeSummary": {
            "title": "Include stream summary",
            "type": "boolean",
            "description": "Add one stream_summary row per video with event counts, per-currency totals, top supporters and completeness.",
            "default": false
          },
          "startOffsetSecs": {
            "title": "Start offset (seconds)",
            "minimum": 0,
            "maximum": 604800,
            "type": "integer",
            "description": "Replay only. Skip events before this video offset. Use 0 to start at the beginning.",
            "default": 0
          },
          "endOffsetSecs": {
            "title": "End offset (seconds)",
            "minimum": 0,
            "maximum": 604800,
            "type": "integer",
            "description": "Replay only. Stop after this video offset. Use 0 to read to the end.",
            "default": 0
          },
          "liveCollectSecs": {
            "title": "Live capture seconds",
            "minimum": 10,
            "maximum": 86400,
            "type": "integer",
            "description": "How long to keep polling an active chat before stopping. Live captures are always partial.",
            "default": 60
          },
          "pollIntervalMs": {
            "title": "Live poll interval (ms)",
            "minimum": 2000,
            "maximum": 30000,
            "type": "integer",
            "description": "Minimum delay between live chat polls. YouTube's own timeout is honoured when it is longer.",
            "default": 2000
          },
          "language": {
            "title": "Language",
            "enum": [
              "en",
              "es",
              "pt",
              "de",
              "fr",
              "it",
              "ja",
              "ko",
              "hi",
              "id"
            ],
            "type": "string",
            "description": "Interface language used when requesting YouTube pages and chat.",
            "default": "en"
          },
          "regionCode": {
            "title": "Region",
            "enum": [
              "US",
              "GB",
              "CA",
              "AU",
              "IN",
              "BR",
              "DE",
              "FR",
              "JP",
              "KR",
              "MX",
              "ID"
            ],
            "type": "string",
            "description": "Region used for YouTube page and chat requests.",
            "default": "US"
          },
          "includeMetadata": {
            "title": "Include stream metadata",
            "type": "boolean",
            "description": "Repeat video and stream metadata on each chat row.",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}