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.
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?
If you want to just search the subtitles from a particular video that is open on youtube.com you can view all the subtitles by selecting 'Open Transcript' from the ...
button which is displayed below the main video window and to the right of the title (to the right of SAVE
) - then you can just search them using the browser's page search functionality (i.e. Mac: ⌘+F, Win: Ctrl+F)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With