Whisper API Transcription Notebook: Bulk Audio, Long Files and SRT Captions
Podcasts, interviews, webinars and videos are full of material you could turn into posts, captions or research notes, once they are text. This free Google Colab notebook transcribes audio with OpenAI’s Whisper API: one file, several files in bulk, files over the API’s 25 MB upload limit, and SRT captions with correct timestamps.
Who it’s for
Content marketers, SEOs and video teams repurposing spoken content, and anyone who followed the original 2024 tutorial and hit errors from the old OpenAI SDK. Transcripts are also a starting point for show notes, quotes for social posts and the raw text for topic or entity analysis. You need an OpenAI API key on an account with credits.
How to use it
- Open the notebook in Colab, add your key as a Colab secret named
OPENAI_API_KEYand switch on notebook access. - Upload one audio or video file and print its transcript. Check a few names and terms against the recording before you go further.
- For files over 25 MB, run the chunking helper, which splits the audio into 10-minute pieces with pydub and transcribes them in order.
- Generate an .srt captions file from the segment timestamps.
- Use the bulk cell to upload several files and download one .txt per file.
What you get
- Plain-text transcripts saved as UTF-8, so non-English text saves correctly
- SRT captions with timestamps corrected across chunks
- A command-line script for any number of files, with automatic chunking
- Notes on the newer gpt-4o-transcribe models, which return text or JSON only, so SRT captions need whisper-1
What changed in the 2026 refresh
The original notebook mixed the retired openai.api_key pattern with the new client and failed with a NameError. The refresh uses the current SDK, reads the key from a secret instead of the notebook, returns the transcript text, and gives a clear message for files over 25 MB.
Limits and privacy
You pay OpenAI for every transcription, so try a short file first. Audio is uploaded to OpenAI, so don’t send recordings with confidential or personal information unless your agreement covers it. Automatic transcripts need a human check for names, brand terms and jargon before you publish them. The chunking and SRT logic was tested on generated audio, with the API mocked.
Follow the walkthrough in How to transcribe audio with OpenAI’s Whisper API in Google Colab (Python). Content transformation with machine learning, turning one format into another, is a module of Introduction to Machine Learning for SEO.
What’s included
- Transcribe one file or many, with one .txt per file
- Files over 25 MB split into 10-minute chunks with pydub and transcribed in order
- SRT captions from segment timestamps, corrected across chunks
- Current OpenAI SDK, key read from a Colab secret
- Command-line version and offline tests included
Where this resource is used on MLforSEO
Walkthroughs on the blog
More video and visual resources
- Coding Script or NotebookImage Clustering by Color with Three Machine Learning Approaches for Visual Content Organization
- Coding Script or NotebookYouTube Channel Benchmark Notebook with AI Transcript Audit
- Coding Script or NotebookYouTube Keyword and Tag Research Notebook (Autocomplete + Competitor Tags)
- Coding Script or NotebookImage SEO Audit and Bulk AI Alt Text Generator (Colab Notebook)
- ChecklistYouTube SEO Checklist: Improve Video Visibility and Channel Health (Checklist)
- Content analysis · Coding Script or NotebookTopic Modelling with BERTopic in Python: Pages and Short Text (Notebook)
See all 6 video and visual resources →See all 29 content analysis resources →See all 73 coding script or notebook resources →
