{
  "openapi": "3.0.1",
  "info": {
    "title": "Douyin Live Recorder - Real-Time Chat, Gifts & MP4 Capture",
    "description": "Extract real-time chats, gifts, likes, joins, follows, and viewer counts from Douyin (抖音) live broadcasts. Save the stream as MP4 segments. Polymorphic JSON dataset, one row per event. SD to Full HD recording. Free tier included.",
    "version": "0.0",
    "x-build-id": "2OpbNEdRtgIeauoTu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/zen-studio~douyin-live-recorder/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-zen-studio-douyin-live-recorder",
        "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/zen-studio~douyin-live-recorder/runs": {
      "post": {
        "operationId": "runs-sync-zen-studio-douyin-live-recorder",
        "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/zen-studio~douyin-live-recorder/run-sync": {
      "post": {
        "operationId": "run-sync-zen-studio-douyin-live-recorder",
        "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": [
          "liveUrl"
        ],
        "properties": {
          "liveUrl": {
            "title": "🎥 Douyin live URL (抖音直播链接)",
            "type": "string",
            "description": "A Douyin live broadcast (直播间) to record.<br><br>Accepted formats:<ul><li>Browser address bar (浏览器地址栏): <code>https://live.douyin.com/376034101029</code></li><li>Bare numeric web id: <code>376034101029</code></li><li>App share link (app 分享链接): <code>https://v.douyin.com/iAbc123/</code></li><li>Profile URL of a live broadcaster (主播主页): <code>https://www.douyin.com/user/MS4w...</code></li><li>UserSecID: <code>MS4wLjABAAAA...</code></li><li>Numeric user id (用户 ID): <code>1929015166249580</code></li></ul><i>Tip: paste <code>auto</code> to pick a currently-live demo room.</i>"
          },
          "runTime": {
            "title": "⏱ Run time (录制时长, minutes)",
            "minimum": 0,
            "maximum": 240,
            "type": "integer",
            "description": "How long to stay connected to the broadcast.<br><br><ul><li><code>0</code> (default) — until the broadcaster (主播) ends the stream.</li><li>Range: <code>0–240</code>.</li></ul><i>Apify run timeout is set to 4 hours regardless; this field bounds the connection earlier.</i>",
            "default": 0
          },
          "captureEvents": {
            "title": "Capture events (实时事件)",
            "type": "boolean",
            "description": "When enabled (default), every chat (聊天), gift (礼物), like (点赞), join (进入直播间), follow (关注), and viewer-count (在线人数) update is streamed into the dataset as one row per event.<br><br>Turn this off to run in <b>recording-only mode (仅录制)</b> — the actor skips the event stream entirely and just saves the MP4. <i>Record video</i> below must be on. You only pay for recording time, and the dataset only carries <code>room_info</code> and <code>summary</code> rows.",
            "default": true
          },
          "excludeEvents": {
            "title": "🚫 Event types to skip (要跳过的事件类型)",
            "uniqueItems": true,
            "type": "array",
            "description": "Event types to drop from the dataset. Use this to trim the output to only what you need (for example, exclude <code>like</code> (点赞) if you only care about chats (聊天) and gifts (礼物)).<br><br>Wire-level signals (<code>system</code>, <code>stream_adaptation</code>) and lifecycle markers (<code>connection_state</code>) are always filtered internally — they're never in the dataset. Ignored when <i>Capture events</i> is off.",
            "items": {
              "type": "string",
              "enum": [
                "chat",
                "gift",
                "like",
                "member",
                "social",
                "viewer_count",
                "fansclub",
                "emoji_chat",
                "control",
                "room_stats",
                "room_rank",
                "room_message"
              ],
              "enumTitles": [
                "chat (聊天) — viewer chat messages",
                "gift (礼物) — virtual gifts and tips",
                "like (点赞) — like / tap events",
                "member (进入直播间) — viewer joined the room",
                "social (关注 / 分享) — follow / share actions",
                "viewer_count (在线人数) — running viewer counts",
                "fansclub (粉丝团) — fansclub join / level events",
                "emoji_chat (表情) — emoji-only chat",
                "control (开播 / 下播) — broadcaster control signals",
                "room_stats (人气) — room-stat updates",
                "room_rank (榜单) — top-contributor rankings",
                "room_message (系统消息) — system top messages"
              ]
            },
            "default": []
          },
          "recordVideo": {
            "title": "Record video (录制视频)",
            "type": "boolean",
            "description": "When enabled, the broadcast (直播) is recorded as MP4 segments and uploaded to the run's key-value store. Each segment is at most <b>Upload every</b> minutes long.<br><br><b>Billed separately</b> from event capture — recording seconds accrue only while a segment is actively being written. Disabled by default; events are captured either way.",
            "default": false
          },
          "videoQuality": {
            "title": "Video quality (画质)",
            "enum": [
              "SD1",
              "SD2",
              "HD1",
              "FULL_HD1"
            ],
            "type": "string",
            "description": "Choose the stream resolution (画质).<br><br><ul><li><code>SD1</code> — lowest (流畅), smallest files.</li><li><code>SD2</code> — standard definition (标清).</li><li><code>HD1</code> — default, balanced (高清).</li><li><code>FULL_HD1</code> — highest (超清), largest files.</li></ul>Ignored when <b>Record video</b> is off.",
            "default": "HD1"
          },
          "uploadEvery": {
            "title": "Upload every (每段时长, minutes)",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "Each MP4 segment (视频片段) covers this many minutes before rotating. Smaller values give more, smaller files with better crash resilience; larger values give fewer, bigger files.<br><br><ul><li>Default: <code>5</code>. Range: <code>1–60</code>.</li><li>Set to <code>60</code> (or match your <b>Run time</b>) for one large consolidated file.</li><li>Set to <code>1–2</code> for finer-grained recovery on long runs.</li></ul>Ignored when <b>Record video</b> is off.",
            "default": 5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}