How to Get YouTube Transcripts with an API (Captions and Subtitles)
A YouTube transcript is the most practical way to turn a video into something a language model, a search index or a blog draft can use. YouTube's official APIs are not a comfortable 'give me the captions' product: you need a project, a key, and the right caption tracks, and many workflows just need the text that already appears in the player. This guide shows how to get YouTube transcripts (captions and subtitles) through a simple API call, including channels and playlists.
You will use the YouTube Transcript Scraper on Apify. It returns the full transcript text, optional timestamped segments, the caption language (human-made or auto-generated), optional translation, and video metadata such as title, channel, views and duration. No official YouTube API key is required.
By the end of this article you will have a CSV or JSON file on your machine, and a short Python snippet you can rerun or schedule. The same Actor is also callable from JavaScript and from AI agents through the Apify MCP server.
What you need
- An Apify account. The Free plan is enough to try a small run.
- A list of inputs for the Actor (URLs, IDs or search terms — details in the steps below).
- Optional: Python 3 with the
apify-clientpackage if you want to automate the run.
Start with a single public video that you know has captions. The first YouTube video, jNQXAC9IVRw ('Me at the zoo'), is a short public example.
How to run it in the Apify Console
Step 1: Open the Actor
Go to https://apify.com/veenkes/veenkes-youtube-transcripts and click Try for free.
Step 2: Paste videos or a channel
A watch URL, youtu.be link, Shorts URL or 11-character ID all work. To process a creator's latest videos, paste a channel @handle or a playlist URL and set how many of the latest videos to take.
Step 3: Choose language and format
Preferred languages are ISO codes such as en or es. You can fall back to the original language, prefer human-made captions, or translate with YouTube's built-in translation. Turn timestamped segments off if you only want a clean text block for an LLM.
Step 4: Run and export
Start the run and download JSON or CSV. Videos with no captions are listed in a summary record and are not charged.
YouTube's public channel feed lists a limited number of recent videos (up to 15). For older videos, paste their URLs directly. Metadata (views, duration, description) is optional but useful for catalogs.
How to run it from Python
Install the official client and call the Actor by its Store id veenkes/veenkes-youtube-transcripts. Replace YOUR_APIFY_TOKEN with a token from Apify Console > Integrations. Do not commit the token to a public repository.
pip install apify-client from apify_client import ApifyClient client = ApifyClient("YOUR_APIFY_TOKEN") run = client.actor("veenkes/veenkes-youtube-transcripts").call(run_input={ "videos": [ "https://www.youtube.com/watch?v=jNQXAC9IVRw" ], "languages": [ "en" ], "includeSegments": True, "includeMetadata": True }) # Write every dataset item, then export from the Console or keep going in code. for item in client.dataset(run["defaultDatasetId"]).iterate_items(): print(item) The JavaScript client (apify-client on npm) uses the same Actor id and the same input object. You can also start the run with a plain HTTP POST to the Apify API if you prefer.
Sample output
Here is a shortened example of one dataset record (field values are illustrative of the schema, taken from a real sample run shape):
{ "videoId": "dQw4w9WgXcQ", "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "title": "Rick Astley - Never Gonna Give You Up (Official Video) (4K Remaster)", "channelName": "Rick Astley", "channelId": "UCuAXFkgsw1L7xaCfnd5JJOw", "transcriptLanguage": "en", "transcriptLanguageName": "English", "isAutoGenerated": false, "translated": false, "availableLanguages": [ { "code": "en", "name": "English", "autoGenerated": false }, { "code": "en", "name": "English (auto-generated)", "autoGenerated": true }, { "code": "de-DE", "name": "German (Germany)", "autoGenerated": false } ], "transcript": "[♪♪♪] ♪ We're no strangers to love ♪ ♪ You know the rules and so do I ♪ ♪ A full commitment's what I'm thinking of ♪ ♪ You wouldn't get this from any other guy ♪ ♪ I just wanna tel…", "wordCount": 487, "segmentCount": 61, "source": "video", "durationSeconds": 213, "viewCount": 1836532905, "publishDate": null, "category": null, "description": "The official video for “Never Gonna Give You Up” by Rick Astley. \n\nNever: The Autobiography 📚 OUT NOW! \nFollow this link to get your copy and listen to Rick’s ‘Never’ playlist ❤️ #…", "keywords": [ "rick astley", "Never Gonna Give You Up", "nggyu" ], "thumbnail": "https://i.ytimg.com/vi/dQw4w9WgXcQ/sddefault.jpg", "isLive": false, "scrapedAt": "2026-11-12T22:06:14.903Z" } Once the run has finished, open the dataset in the Console and use Export > CSV if a spreadsheet is your destination. JSON is usually better for code and for language models.
What to use the data for
AI teams build RAG corpora and training sets from talks and tutorials. Marketers turn webinars into show notes, newsletters and clips. Researchers and SEO teams analyze what competitors say on camera. Students export lectures into searchable notes. Timestamped segments are the right shape for quotes and chapterization; the plain transcript field is the right shape for summarization.
Pricing
Pay-per-result pricing starts at $2.00 per 1,000 transcripts on the Apify Free plan, with lower unit prices on paid Apify plans, plus a small per-run start fee. Videos that have no captions are skipped and are not charged. Always check the live pricing on the Actor page, because plans and unit prices can change. For a first test, keep the input tiny so you can inspect the schema before you scale up.
Scheduling and automations
In the Apify Console you can schedule the Actor (daily or hourly) and leave the same input in place. For incremental jobs, prefer a "since" or "posted after" style filter when the Actor offers one, so you are not paying to re-collect old rows. When a run finishes you can send a webhook, or connect the Actor in Zapier, Make or n8n. AI agents can discover and call veenkes/veenkes-youtube-transcripts through Apify's MCP server using the same input.
Good practices and limits
Transcripts may be copyrighted by the video's creator or rights holder. Use them for analysis, summarization, accessibility or research in line with copyright law and YouTube's terms — not to republish the work. Private, age-restricted or caption-less videos will not return a transcript. The Actor is not affiliated with YouTube or Google.
If a run returns fewer rows than you expected, check the input caps, language or country filters, and the Actor log. A zero-row run is usually a filter or an unavailable source, not a silent crash — read the log before you increase limits.
Next step
Open the Actor and run a small job: YouTube Transcript Scraper: Captions, Subtitles & API.
If you later want this on a schedule, save the input that worked, add a date filter where it applies, and export CSV automatically from the dataset or from the API snippet above.