{
  "openapi": "3.0.1",
  "info": {
    "title": "Douyin 抖音视频转文字 Transcript Scraper - Speech to Text for AI",
    "description": "Spoken words of any public Douyin video as plain text plus a timed transcript.",
    "version": "0.2",
    "x-build-id": "ihaJFSmdIdbnVMFMv"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lanternlab318~douyin-transcript/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lanternlab318-douyin-transcript",
        "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/lanternlab318~douyin-transcript/runs": {
      "post": {
        "operationId": "runs-sync-lanternlab318-douyin-transcript",
        "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/lanternlab318~douyin-transcript/run-sync": {
      "post": {
        "operationId": "run-sync-lanternlab318-douyin-transcript",
        "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": [
          "videoUrls"
        ],
        "properties": {
          "videoUrls": {
            "title": "Douyin videos",
            "type": "array",
            "description": "Public Douyin videos, one per line: a video link (https://www.douyin.com/video/7...), a share link (https://v.douyin.com/...), a link carrying modal_id=..., or the bare numeric video ID. Keyword search is not supported here - use the Douyin Search Scraper to find videos first.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max transcripts per run",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Stop after this many videos. Input lines past the limit are reported as not collected rather than silently dropped.",
            "default": 1000
          },
          "includeSegments": {
            "title": "Include the timed transcript",
            "type": "boolean",
            "description": "Add segments[{start, end, text}] - the transcript line by line with a start and end second for each line. Turn it off if you only want the plain text; the row is then smaller but says nothing about timing.",
            "default": true
          },
          "allowAsr": {
            "title": "Transcribe the audio when Douyin has no caption",
            "type": "boolean",
            "description": "Most Douyin videos carry no caption track. With this on, the Actor downloads the lowest-bitrate rendition and recognizes the speech inside the Actor container with an open-source model - no speech API and no key. With it off, a video without a platform caption comes back with text: null and the reason, and costs nothing.",
            "default": true
          },
          "language": {
            "title": "Spoken language",
            "type": "string",
            "description": "Leave empty and the model names the language itself, which is what you usually want on Douyin: Mandarin, Cantonese, English, Japanese and Korean come back labelled as what they are. Set a code (zh, yue, en, ja, ko) and that code is reported on every transcribed row instead of the model's own answer; it does not change how the audio is read.",
            "default": ""
          },
          "maxDurationSec": {
            "title": "Longest video to transcribe (seconds)",
            "minimum": 1,
            "maximum": 7200,
            "type": "integer",
            "description": "Videos longer than this are skipped: the row carries the video's metadata, text: null and partialReason transcript:longer_than_maxDurationSec, and is not charged. A video whose length Douyin does not state is treated as over the limit.",
            "default": 600
          },
          "maxAudioMb": {
            "title": "Largest audio download (MB)",
            "minimum": 1,
            "maximum": 120,
            "type": "integer",
            "description": "Ceiling on one download. The lowest-bitrate rendition of a Douyin video is a few megabytes, so this only catches an outlier.",
            "default": 40
          },
          "maxUpstreamRequests": {
            "title": "Max Douyin requests per run",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard ceiling on requests sent to Douyin in this run, retries included. Leave it empty and the Actor works one out from the number of videos you gave it, so a run is never unbounded; 0 sends no request at all. RUN_SUMMARY reports which ceiling was in force."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Proxy for all requests. Off by default: Douyin answers guests without a proxy.",
            "default": {
              "useApifyProxy": false
            }
          },
          "residentialFallback": {
            "title": "Retry refused videos through a residential proxy",
            "type": "boolean",
            "description": "When Douyin refuses the request for a video (captcha, empty answer), retry that video once through an Apify residential proxy exiting in China. Residential traffic costs more than direct requests. A video Douyin does answer about - taken down, private, withheld - is never retried: no exit changes that answer.",
            "default": true
          },
          "maxFallbackVideos": {
            "title": "Max videos retried through the residential proxy",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Upper limit per run on videos moved to the residential proxy. 0 turns the fallback off.",
            "default": 3
          },
          "requestDelaySecs": {
            "title": "Delay between requests (seconds)",
            "minimum": 0.2,
            "maximum": 30,
            "type": "number",
            "description": "Minimum pause between two requests from the same guest identity.",
            "default": 1
          },
          "maxIdentityRotations": {
            "title": "Max guest identities per run",
            "minimum": 0,
            "maximum": 30,
            "type": "integer",
            "description": "How many times a refused request may be retried on a freshly minted guest identity before the video is reported as blocked.",
            "default": 6
          },
          "msTokenWaitSecs": {
            "title": "Wait for the page's security token (seconds)",
            "minimum": 0,
            "maximum": 180,
            "type": "integer",
            "description": "How long a new guest page may take to receive its security token (msToken) before requests start. Longer waits make requests more likely to be answered.",
            "default": 20
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}