{
  "openapi": "3.0.1",
  "info": {
    "title": "TikTok Transcript Scraper: videos, profiles, hashtags & search",
    "description": "Get the transcript of TikTok videos as text, timestamped segments or SRT/VTT subtitles, from video URLs, whole profiles, hashtags or search: the captions TikTok has, in any language, and Whisper speech-to-text for videos without. With each video's hook, views, likes, date and author. No login.",
    "version": "0.1",
    "x-build-id": "DlvdfpIAq8UvBeNip"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pikoulas~tiktok-transcripts/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pikoulas-tiktok-transcripts",
        "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/pikoulas~tiktok-transcripts/runs": {
      "post": {
        "operationId": "runs-sync-pikoulas-tiktok-transcripts",
        "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/pikoulas~tiktok-transcripts/run-sync": {
      "post": {
        "operationId": "run-sync-pikoulas-tiktok-transcripts",
        "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": {
          "videos": {
            "title": "Videos",
            "type": "array",
            "description": "Video URLs (tiktok.com/@user/video/...), vm.tiktok.com and vt.tiktok.com short links, or video IDs.",
            "items": {
              "type": "string"
            }
          },
          "profiles": {
            "title": "Profiles",
            "type": "array",
            "description": "Usernames, @handles or profile URLs (tiktok.com/@nasa). Takes the profile's videos, newest first, as far back as it goes.",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerProfile": {
            "title": "Max videos per profile",
            "minimum": 1,
            "type": "integer",
            "description": "Videos from each profile, newest first.",
            "default": 20
          },
          "hashtags": {
            "title": "Hashtags",
            "type": "array",
            "description": "Hashtags, with or without the #, or hashtag URLs (tiktok.com/tag/cooking).",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerHashtag": {
            "title": "Max videos per hashtag",
            "minimum": 1,
            "type": "integer",
            "description": "TikTok shows a few hundred videos per hashtag to visitors who aren't logged in.",
            "default": 20
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Keywords searched on TikTok, videos in TikTok's order.",
            "items": {
              "type": "string"
            }
          },
          "maxVideosPerSearch": {
            "title": "Max videos per search",
            "minimum": 1,
            "type": "integer",
            "description": "TikTok shows about 270 videos per search to visitors who aren't logged in.",
            "default": 20
          },
          "publishedAfter": {
            "title": "Published after",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Only videos posted on or after this date (YYYY-MM-DD). A profile's videos stop once they get past it."
          },
          "onlyNewVideos": {
            "title": "Only new videos from profiles",
            "type": "boolean",
            "description": "For a scheduled run: each profile gives only the videos posted since the last run with this on, and those a run couldn't finish. The first run takes the latest ones as usual. Kept per profile in your account's key-value store tiktok-transcripts-memory; delete it to start over. Set the max videos per profile above what a profile posts between runs.",
            "default": false
          },
          "skipVideosWithoutTranscript": {
            "title": "Skip videos without a transcript",
            "type": "boolean",
            "description": "Leaves out the videos without a transcript (no captions, or with speech-to-text on, nothing said), so the counts above count transcripts. Otherwise they come with their details and the reason, free.",
            "default": false
          },
          "speechToText": {
            "title": "Speech-to-text for videos without captions",
            "type": "boolean",
            "description": "Transcribes the videos TikTok has no captions for (about half of a search's or hashtag's) with OpenAI's Whisper, run inside the actor, in the language spoken. Charged per started minute of the video: $0.003 with Whisper base, $0.008 with Whisper small (twice on Apify's free plan); videos with nothing said stay free. Runs get 4 GB of memory with it on.",
            "default": false
          },
          "speechModel": {
            "title": "Speech-to-text model",
            "enum": [
              "base",
              "small"
            ],
            "type": "string",
            "description": "Whisper base is fast and good on clear speech. Whisper small is more accurate on accents, noise, names and languages other than English, and takes about three times as long.",
            "default": "base"
          },
          "languages": {
            "title": "Preferred languages",
            "type": "array",
            "description": "Language codes in order of preference: en, es, de... Most videos have one track, in the language spoken; some have the creator's own captions or translations too. Empty, or none of these there: the video's own.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeTimestamps": {
            "title": "Include timestamps",
            "type": "boolean",
            "description": "Adds the transcript as segments with their start and end in seconds, next to the plain text.",
            "default": false
          },
          "includeVtt": {
            "title": "Include WebVTT",
            "type": "boolean",
            "description": "Adds the transcript as a WebVTT subtitle file.",
            "default": false
          },
          "includeSrt": {
            "title": "Include SRT",
            "type": "boolean",
            "description": "Adds the transcript as an SRT subtitle file, ready for video editors.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed for most runs. When TikTok refuses the run's IP on Apify, the run switches to Apify's residential proxy by itself.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}