Is it possible to search YouTube subtitles?

user42459 picture user42459 · May 3, 2017 · Viewed 10.4k times · Source

Suppose I want to find list of videos which have the phrase "French presidential election" in its subtitle.

Can I do this using YouTube API?

It will be perfect if it can even search within both human-generated and auto-generated subtitles. But it will be good enough if it can search either of the two types of subtitles.

Answer

abielita picture abielita · May 3, 2017

You may refer with this documentation. You can use Captions: list which returns a list of caption tracks that are associated with a specified video.

Note that the API response does not contain the actual captions and that the captions.download method provides the ability to retrieve a caption track.

You need to provide the videoId parameter that specifies the YouTube video ID of the video for which the API should return caption tracks.

Here's a related thread: How to add Subtitles to Youtube video using Youtube API?