{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok & YouTube Transcript API - Video to Text, Captions & OCR",
    "description": "Turn TikTok and YouTube videos and Shorts into text. Uses captions when present and speech recognition when not, so every video gets a transcript. Adds on-screen text (OCR), timed segments and the opening hook.",
    "version": "0.1",
    "x-build-id": "EPKz2URKAGT9MyPqc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/headply~tiktok-youtube-transcript-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-headply-tiktok-youtube-transcript-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/headply~tiktok-youtube-transcript-scraper/runs": {
      "post": {
        "operationId": "runs-sync-headply-tiktok-youtube-transcript-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/headply~tiktok-youtube-transcript-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-headply-tiktok-youtube-transcript-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",
        "required": [
          "startUrls"
        ],
        "properties": {
          "startUrls": {
            "title": "Video, channel or playlist URLs",
            "type": "array",
            "description": "TikTok video URLs (tiktok.com/@user/video/...), YouTube video or Shorts URLs, or YouTube channel and playlist URLs (expanded to their recent videos).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxVideos": {
            "title": "Max videos",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Upper bound on how many videos to process, including videos expanded from a channel or playlist URL.",
            "default": 100
          },
          "transcriptSource": {
            "title": "Transcript source",
            "enum": [
              "caption",
              "caption-and-speech"
            ],
            "type": "string",
            "description": "How the transcript is produced, which sets what you pay. <b>Captions only</b> (default) returns the platform's own caption track — cheapest and fastest; a video with no caption is skipped and not charged. <b>Captions + speech recognition</b> additionally downloads the audio and transcribes it on-device for videos that have no caption; this costs more and is billed as a separate, higher-priced <b>speech-recognition</b> event. Speech recognition and OCR are CPU-intensive; for videos beyond about a minute, raise the Actor's memory (4 GB works well) so the run finishes before the timeout. Captions need no extra memory.",
            "default": "caption"
          },
          "includeOnScreenText": {
            "title": "Read on-screen text (OCR)",
            "type": "boolean",
            "description": "Recognize the text burned into the video frames (titles, captions, callouts) with OCR — text no caption track carries. This downloads the video and runs image recognition, so it is the most expensive option and is billed as a separate <b>on-screen-text</b> event, on top of the transcript. Leave off unless you need it. Speech recognition and OCR are CPU-intensive; for videos beyond about a minute, raise the Actor's memory (4 GB works well) so the run finishes before the timeout. Captions need no extra memory.",
            "default": false
          },
          "language": {
            "title": "Preferred language",
            "type": "string",
            "description": "Two-letter language code for the transcript, for example <b>en</b>. Leave empty to auto-detect and use the video's own caption language."
          },
          "hookSeconds": {
            "title": "Hook length",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "How many opening seconds to pull into a separate hook field, which is what creative teams sort on.",
            "default": 5
          },
          "ocrFrameInterval": {
            "title": "On-screen text: frame interval",
            "minimum": 1,
            "maximum": 15,
            "type": "integer",
            "description": "Seconds between sampled frames when reading on-screen text. Lower catches more text but costs more.",
            "default": 3
          },
          "ocrMaxFrames": {
            "title": "On-screen text: max frames",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Safety cap on frames read per video.",
            "default": 10
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 12,
            "type": "integer",
            "description": "How many videos to fetch in parallel.",
            "default": 4
          },
          "maxDurationSecs": {
            "title": "Max duration for speech recognition / OCR",
            "minimum": 0,
            "type": "integer",
            "description": "Skip the costly paths (speech recognition and on-screen-text OCR) for videos longer than this many seconds. The caption is still returned when one exists. This protects against a single long video running up a large download and compute bill, which for speech recognition and OCR grows with video length. Set 0 to disable the cap.",
            "default": 600
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}