TikTok Transcripts Scraper avatar

TikTok Transcripts Scraper

Pricing

from $0.09 / 1,000 videos

Go to Apify Store
TikTok Transcripts Scraper

TikTok Transcripts Scraper

🔥 ~$0.1/1K videos 🔥 Scrape TikTok video transcripts: captions and auto subtitles with timestamps, per language, plus video details and stats.

Pricing

from $0.09 / 1,000 videos

Rating

0.0

(0)

Developer

Kai

Kai

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

1

Monthly active users

19 hours ago

Last modified

Features

Limited permissions

Share

TikTok Transcripts Scraper - Captions and Subtitles

Get the captions of TikTok videos as subtitle files and plain text. Every video is one Dataset item with links to the files, the video details, and the counts of views, likes, comments, shares, and saves.

Read every language that a video offers, or only the languages you choose. Run many videos in one run.

The Actor reads the captions that a video already has. It does not create captions. A video without captions gives an item with no subtitle files.

Use cases

Search what creators say

Find the videos where a word or a phrase appears.

{
"videoUrls": [
"https://www.tiktok.com/@nasa/video/7702504724049743117",
"https://www.tiktok.com/@nasa/video/7700397098994273549"
]
}

Use videoId, videoUrl, and transcriptUrl. Open the link to get the words of the video. Use the .vtt file in subtitles to find the moment where a word starts.

Turn videos into text

Get the words of each video as plain text. Use the result for summaries, notes, articles, or text analysis.

{
"videoUrls": ["https://www.tiktok.com/@nasa/video/7702504724049743117"],
"languages": ["eng-US"]
}

Use transcriptUrl. The file holds one line for each caption.

Build subtitle files

Get one subtitle file for each language of a video. Leave languages empty to get every language that the video offers.

{
"videoUrls": ["https://www.tiktok.com/@nasa/video/7700397098994273549"]
}

Use subtitles. Each entry has the languageCode, the source, and the url of a .vtt file with the timing of each caption.

Compare what is said with how a video performs

Pair the words of a video with its counts. Find the topics and the hooks of the videos that get the most views.

{
"videoUrls": [
"https://www.tiktok.com/@nasa/video/7702504724049743117",
"https://www.tiktok.com/@nasa/video/7700397098994273549"
]
}

Use stats, hashtags, and transcriptUrl.

Check caption coverage

Find out which of your videos have captions in a language.

{
"videoUrls": [
"https://www.tiktok.com/@nasa/video/7702504724049743117",
"https://www.tiktok.com/@nasa/video/7700397098994273549"
],
"languages": ["eng-US"]
}

A video with subtitles set to [] has no captions in the language. An item with an errorCode is a video that the Actor could not read.

Choose what to collect

Starting pointInputUse it for
One or more videosvideoUrlsGet the subtitle files, the text, and the details of each
Videos in chosen languagesvideoUrls and languagesKeep only the subtitle files in the languages you need

What each video includes

  • Video: ID, link, the URL from your input, description, description language, creation time, country of creation, topic labels, hashtags, mentions, effects, caption languages, and the image links of a photo post
  • Video file facts: duration, size in pixels, quality, format, codec, bitrate, and the cover links
  • Flags: ad, AI generated, and whether duets, stitches, and shares are allowed
  • Stats: views, likes, comments, shares, saves, and reposts
  • Author: ID, handle, display name, bio, verified, private, and seller flags, account creation time, avatar link, and the counts of followers, accounts it follows, likes, videos, and likes it gave
  • Music: ID, title, author, album, duration, audio link, and cover link
  • Caption facts: the spoken language, whether the video has its own audio, whether automatic captions are on, and a reason code when captions are missing
  • Subtitle files: one .vtt file for each caption set, with its language, source code, version, kind, and whether it is automatic and original
  • Transcript file: the words of the first caption set as plain text

Read the captions of videos

Start with the video URLs:

{
"videoUrls": ["https://www.tiktok.com/@nasa/video/7702504724049743117"]
}

The Actor saves one item for each video. It saves a subtitle file for every language that the video offers, and a transcript file.

Each entry is a full video URL. It must contain /video/ and the video ID. Short links do not work. An entry without /video/ and the video ID gives an error item with the code NOT_A_VIDEO_URL.

Add several video URLs to read them in input order.

Download the files

The links in subtitles and transcriptUrl open the files. The files are in the default key-value store of the run, and the Storage tab of the run lists them.

  • A subtitle file is named subtitle-<video ID>-<language>-<source>.vtt.
  • The transcript file is named transcript-<video ID>.txt.

Apify removes the storage of a run after the retention time of your plan. Download the files that you need to keep.

Choose languages

Set languages to keep some languages only:

{
"videoUrls": ["https://www.tiktok.com/@nasa/video/7702504724049743117"],
"languages": ["eng-US"]
}

The Actor keeps the captions whose language code matches. Letter case does not matter: eng-us and eng-US both match. A video that does not offer the language still gives its item. subtitles is [], and transcriptUrl is null.

Leave languages empty to read every language. To find the codes, run once with languages empty and read languageCode in subtitles.

How results are ordered and limited

Order. The Actor reads the videos in input order. Each entry gives one item, so the items follow the input. In subtitles, the caption sets follow the order that the video gives them.

Limit. The Actor sets no limit on videos. The number of files depends on the video.

Same video twice. A video that is twice in videoUrls is read twice. It has two items, and each item has its own files.

Input

Provide at least one video URL.

Input reference

ParameterTypeDefaultEffect
videoUrlsstring[]requiredTikTok video URLs. The Actor reads the captions of each video.
languagesstring[]emptyLanguage codes to keep, such as eng-US. Empty keeps every language.
proxyConfigurationobject{"useApifyProxy":true}Connection settings for the run. Keep the default.
  • Use full URLs. A video URL looks like https://www.tiktok.com/@handle/video/<ID>.
  • An entry that is not a video URL gives an error item.
  • The Actor does not check language codes. A code that no video offers gives an item with no subtitle files.
  • Unknown input fields are ignored.

Output

Each Dataset item is one video. An entry that the Actor could not read gives one error item in the Errors dataset, not in the Dataset. Every documented field is present in every video item. When a value is not available, a text field is an empty string, a count of the video is 0, and the other fields are null or [].

Sample video

This item comes from a saved run on a video of @nasa. The video has five caption lines. Values in square brackets are placeholders for links.

The subtitle file holds the timing of each caption:

WEBVTT
00:00:00.140 --> 00:00:01.540
Alright, hello everybody.
00:00:01.541 --> 00:00:03.620
Welcome to the air show.

The transcript file holds the words, one line for each caption:

Alright, hello everybody.
Welcome to the air show.

Sample error item

An entry that the Actor cannot read gives an item with an error code in the Errors dataset. The run goes on with the next entry.

{
"inputUrl": "https://www.tiktok.com/@nasa/video/7000000000000000001",
"error": "The video is removed or private.",
"errorCode": "VIDEO_UNAVAILABLE"
}

Field reference

A field with null is not available for the video. A count of the video is 0 when it is not available.

FieldType and contents
videoIdstring. The video ID.
videoUrlstring. The link to the video.
inputUrlstring. The URL from your input that gave this video.
descstring. The description of the video, with its hashtags. It is not the spoken text. Empty when the video has none.
descLanguagestring or null. The language of the description, such as en.
createTimestring or null. The creation time in Unix seconds, such as "1792888427".
locationCreatedstring or null. The country code where the video was made, such as US.
categoriesstring[]. The topic labels of the video. Empty when there is none.
hashtagsstring[]. The hashtags of the description, without #, once each. Empty when there is none.
mentionsstring[]. The accounts that the description mentions, without @.
effectsstring[]. The names of the effects that the video uses.
isAdboolean or null. true for an ad.
isAiGeneratedboolean or null. true when the video is marked as AI generated.
isPinnednull. This Actor always gives null.
duetEnabledboolean or null. true when other users can make a duet with the video.
stitchEnabledboolean or null. true when other users can stitch the video.
shareEnabledboolean or null. true when users can share the video.
captionLanguagesstring[]. The caption languages that the video offers, such as eng-US.
imagesstring[]. The image links of a photo post. Empty for a video.
originalLanguagestring or null. The spoken language of the video, such as eng-US. null when the video has none.
hasOriginalAudioboolean or null. true when the video has its own audio.
autoCaptionEnabledboolean or null. true when automatic captions are on for the video.
noCaptionReasonnumber or null. The code that the video gives for missing captions. null when the video has captions.
videoobject. The facts of the video file.
video.durationnumber. The duration in seconds. It is 0 for a photo post.
video.widthnumber or null. The width in pixels.
video.heightnumber or null. The height in pixels.
video.ratiostring or null. The resolution label, such as 720p.
video.definitionstring or null. The quality label, such as 720p.
video.formatstring or null. The file format, such as mp4.
video.codecstring or null. The video codec, such as h264.
video.bitratenumber or null. The bitrate in bits per second.
video.sizenumber or null. The file size in bytes. It is always null.
video.coverstring or null. A link to the cover image. The link expires.
video.originCoverstring or null. A link to the original cover image. The link expires.
video.dynamicCoverstring or null. A link to the animated cover. The link expires.
authorobject. The author of the video.
author.idstring. The ID of the author.
author.uniqueIdstring. The author handle, without @.
author.nicknamestring. The author display name.
author.verifiedboolean or null. true for a verified author.
author.signaturestring or null. The bio of the author.
author.createTimestring or null. The creation time of the account in Unix seconds.
author.privateboolean or null. true for a private account.
author.sellerboolean or null. true for an account with a shop.
author.avatarstring or null. A link to the avatar. The link expires.
author.followersnumber or null. The follower count of the author.
author.followingnumber or null. The count of accounts that the author follows.
author.likesnumber or null. The likes on all videos of the author.
author.videosnumber or null. The count of videos of the author.
author.likesGivennumber or null. The count of videos that the author liked.
statsobject. The counts of the video. Each count is 0 when not available.
stats.viewsnumber. The play count.
stats.likesnumber. The like count.
stats.commentsnumber. The comment count.
stats.sharesnumber. The share count.
stats.savesnumber. The count of users who saved the video.
stats.repostsnumber. The repost count.
musicobject. The music of the video.
music.idstring or null. The ID of the music.
music.titlestring or null. null when the video has no music.
music.authorstring or null. null when the video has no music.
music.albumstring or null. The album of the music.
music.durationnumber or null. The length of the music in seconds.
music.playUrlstring or null. A link to the audio file.
music.coverstring or null. A link to the sound cover image.
subtitlesarray. One entry for each caption set. Empty when the video has no captions in your languages.
subtitles[].languageCodestring. The language code of the set, such as eng-US.
subtitles[].sourcestring. The short code that the video gives for the origin of the set, such as ASR or MT.
subtitles[].versionstring or null. The version of the set, as the video gives it.
subtitles[].variantstring or null. The kind of caption, such as default or big_caption.
subtitles[].isAutoGeneratedboolean or null. true for a caption that was made automatically.
subtitles[].isOriginalboolean or null. true for a caption in the spoken language, not a translation.
subtitles[].urlstring. The link of the .vtt file of the set.
transcriptUrlstring or null. The link of the plain text file of the first set. null when there is no set.

The Actor keeps the source code as the video gives it. It does not explain the codes. Use isAutoGenerated and isOriginal to tell automatic captions, added captions, and translations apart.

The error item has these fields:

FieldType and contents
inputUrlstring. The entry from your input.
errorstring. What went wrong.
errorCodestring. NOT_A_VIDEO_URL for an entry that is not a full video URL. VIDEO_UNAVAILABLE for a removed or private video. READ_FAILED for a video that the Actor could not read.
  • The Actor saves the subtitle file as the video gives it. It does not correct the text, so it can contain mistakes.
  • The transcript file has no markup. A caption of two or more rows becomes one line, and the rows join with a space. The file has no empty lines.
  • The counts of the video and of the author are the values at the time of the run. They change over time.
  • The links video.cover, video.originCover, video.dynamicCover, and author.avatar expire after some time. Download the images if you need them later.

Limits and field notes

Which videos have captions?

Only videos that offer captions give subtitle files. The Actor reads public data only. A private or removed video gives an error item.

Why does a video give no subtitle files?

There are two reasons:

  • The video has no captions.
  • The video has no captions in the languages that you chose.

For the first reason, read noCaptionReason, hasOriginalAudio, and originalLanguage. In a test, a video without spoken audio gave hasOriginalAudio false, no originalLanguage, and noCaptionReason 3.

A video without subtitle files still has its item, with its details and counts. A caption file that the Actor cannot read is left out, and the log shows a warning.

What does the transcript file hold?

It holds the words of the first caption set in subtitles. A video with captions in more than one language has one transcript file only. Set languages to choose the language. The .vtt file of each set has the words of that set.

Can one language appear twice?

If a video offers more than one caption set for a language, subtitles has one entry for each set. Use source, variant, and isOriginal to tell them apart.

What happens when a video fails?

The Actor writes an item with an error code, adds a message to the log, and continues with the next entry. The items that it already saved stay in the Dataset.

If no entry can be read, the run fails with the message "No video could be read. Check the URLs and try again." A video without captions is not a failure.

Can captions change after I collect them?

Yes. A creator can edit or remove captions, or delete the video. Compare runs of the same input to find the changes.

Similar Actors