DEV Community

CleanScrape
CleanScrape

Posted on

Turning podcasts into text: a 52-minute NASA episode, 8,022 words, and the bugs real audio found

A podcast holds a lot of useful information, and almost none of it can be searched, quoted or passed to another tool. So I built a podcast transcription tool on Apify. You paste a feed, an Apple Podcasts link or a link to an audio file, and you get the text back with timestamps and subtitle files.

The input

One link is enough. This is the run from the video, an episode of NASA's Houston We Have a Podcast:

{
  "sources": ["https://podcasts.apple.com/us/podcast/the-moon-base/id1262594123?i=1000789048885"],
  "quality": "accurate"
}
Enter fullscreen mode Exit fullscreen mode

It also accepts an RSS feed, a podcast's website, or a direct link to an MP3, M4A, WAV or MP4 file. Standard quality uses the Whisper base model and Accurate uses Whisper small. Both run inside the Actor, so there's no OpenAI key to bring.

The output

The 52:18 episode became 8,022 words in 23 minutes on Accurate. Each row has the show, the title, the date, the length, the detected language, the full text and timestamped segments:

{
  "title": "The Moon Base",
  "duration": "00:52:18",
  "language": "en",
  "wordCount": 8022,
  "segments": [
    { "start": 80.5, "text": "a home for astronauts on another celestial body." }
  ]
}
Enter fullscreen mode Exit fullscreen mode

You also get TXT, SRT and VTT files, so the transcript can go straight onto a video or into a search index.

What real audio taught me

The first version passed its tests on short clean clips. Real podcasts found the interesting bugs.

Memory grows with the audio. Whisper's memory use went up by about 55 MB per minute of audio. A 5-minute test looked fine, and a 5-hour file crashed a 4 GB run. The fix was to feed it 5-minute chunks, each cut at the quietest tenth of a second near the boundary so no word gets split. A 5-hour file now peaks at 1.75 GB.

The first 30 seconds can lie. Whisper detects the language from the start of the file. Podcasts often start with an ad, and one Finnish episode opened with an English ad, so the whole episode was transcribed as English. It now takes short samples across the file and lets them vote, weighted by confidence.

The same show, pasted twice, cost double. A feed link and an Apple link for one show are different links to the same audio. Episodes already in the run are now skipped, whichever link they came from.

Real speech costs more than a test sample. My first benchmark used a clean narration. Real conversation ran about 25% slower, and Finnish was the slowest of the languages I tried. That changed the price of the Accurate tier before launch.

Following a show

Give a run a watch name and put it on a schedule. The first run takes the newest episode, and each later run transcribes only what has appeared since. A check with nothing new costs $0.003.

What it can't do

It doesn't label speakers. It works on one language per file. Some podcast hosts refuse automated downloads: in a test of 134 shows, the newest episode of 127 could be reached. The rest are reported in the run and their audio isn't charged. YouTube, TikTok and Spotify links aren't supported.

Try it

https://apify.com/cleanscrape/podcast-transcription

$6 per 1,000 audio minutes on Standard and $15 on Accurate, less on paid Apify plans. The episode above cost $0.80. You can export to Excel, CSV or JSON, or call it from your own code or an AI agent through Apify's MCP server.

Niko, CleanScrape developer

Top comments (0)