On this page
To get the transcript of a YouTube Short, paste its link into the playground or send it in one request. You get the full text, and its first line is the hook.
curl -G https://api.cleanscript.ai/v1/transcript \
-H "Authorization: Bearer $CLEANSCRIPT_API_KEY" \
--data-urlencode "url=https://www.youtube.com/shorts/VgSFtZ7UGCE"# pip install cleanscript-ai
from cleanscript_ai import CleanScript
client = CleanScript()
result = client.transcript("https://www.youtube.com/shorts/VgSFtZ7UGCE")
print(result.text)Every form of the link works: youtube.com/shorts/VgSFtZ7UGCE, youtu.be/VgSFtZ7UGCE, youtube.com/watch?v=VgSFtZ7UGCE, or just VgSFtZ7UGCE.
An example #
NASA's #PassThePhone with NASA and CSA's Artemis II Lunar Flyby Astronauts runs 38 seconds. NASA wrote its own captions, so they come back as written (source: "creator"). The text starts:
I'm passing the phone to someone with an infectious smile, who has done four spacewalks. I'm passing the phone to someone who is a great surfer. I'm passing the phone to a great friend and Mr. Cool, Calm, and Collected Canadian astronaut.
The hook is the first sentence, and the whole Short repeats its pattern: "I'm passing the phone to". Seeing that structure without watching again is what a transcript is for.
Many Shorts have only automatic captions. This one's automatic track reads and Mr cool calm and collected Canadian; that is what CleanScript corrects when there is nothing better (source: "auto"). See how auto captions get cleaned.
What's different about a Short #
The opening is most of it. Read the first line as the hook. For its exact times, add include=["lines"] and look at the first line's start and end. A Short usually comes back as one section.
It can run longer than you think. YouTube allows Shorts up to three minutes. post.duration has the length.
On-screen text isn't in the captions. Many Shorts print the hook over the first frames. When a Short has no speech, the text on screen comes back in on_screen_text automatically. When it has speech, add include=["on_screen_text"] to get both; that adds 1 credit.
No captions isn't an error. Without usable captions, we transcribe the audio (source: "transcribed"). A Short with only music returns empty text and a no_speech warning.
Go further #
- Break a Short down as an ad: hook, offer and call to action.
- Get the hook's exact times: YouTube transcript as JSON with timestamps.
- Short videos elsewhere: TikTok transcripts and Instagram Reels.
Sources
Spot something wrong? Tell us.