DEV Community

clement-melkior
clement-melkior

Posted on

How to get a transcript of any Spotify podcast episode (3 ways, with and without code)

I wanted the text of a few podcast episodes so I could search them and feed them to an LLM. Spotify shows a transcript in its app for some shows, but there is no export button, and many shows have no transcript at all.

Here are the three ways I found to get one, with the trade-offs of each.

1. Read it in the Spotify app

Open the episode, scroll down, and if the show has transcripts enabled you will see a Transcript section.

  • Good for: reading along.
  • Not good for: anything else. You can't copy the whole thing, download it, or get it for shows that don't have one.

2. Do it yourself with the RSS feed and Whisper

Almost every podcast on Spotify is also published through a public RSS feed, and the feed links to the actual audio file. So you can download the audio and transcribe it on your own machine.

Find the feed. Apple runs a free lookup API:

curl "https://itunes.apple.com/search?media=podcast&term=lex+fridman+podcast"
Enter fullscreen mode Exit fullscreen mode

The feedUrl field in the response is the RSS feed. Open it, find the episode you want, and copy the URL in its <enclosure> tag. That is the audio file.

Transcribe it with OpenAI's open-source Whisper:

pip install -U openai-whisper
curl -L -o episode.mp3 "PASTE_THE_ENCLOSURE_URL"
whisper episode.mp3 --model small --output_format txt
Enter fullscreen mode Exit fullscreen mode
  • Good for: occasional use, full control, no account anywhere.
  • Not good for: long episodes on a laptop without a GPU (it is slow), or doing this for many episodes. Matching a Spotify link to the right feed and the right episode by hand also gets old quickly.

Shows that are exclusive to Spotify have no public feed, so this route does not work for them.

3. Paste the Spotify link into a tool

I got tired of step 2, so I built a small tool that does the same thing automatically: Spotify Podcast Transcript on Apify.

You paste the link you get from Spotify's Share → Copy link, and it finds the show's public feed, matches the episode, and transcribes the audio with Whisper large-v3. It also accepts Apple Podcasts links, RSS feeds and direct audio URLs.

From Python:

from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")

run = client.actor("spokentext/spotify-podcast-transcript").call(run_input={
    "urls": ["https://open.spotify.com/episode/4IpeKxxTTa6vw4lRbqH0lg"],
})

for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item["episodeTitle"])
    print(item["text"][:500])
Enter fullscreen mode Exit fullscreen mode

Each result has the plain text, timestamped segments, and optionally an SRT subtitle file. Paste a show link instead of an episode link and it takes the most recent episodes.

Some numbers from my own runs: a 50-minute episode took about 40 seconds and cost $0.15 (it is priced at $0.003 per audio minute). Apify's free plan includes $5 of credit a month, which covers roughly 27 hours of audio.

  • Good for: many episodes, automation, pipelines that start from a Spotify or Apple link.
  • Not good for: Spotify-exclusive shows (same limit as the manual route: no public audio), and it does not label who is speaking.

Which one should you use?

You want to... Use
Read along once The Spotify app
Transcribe an episode now and then, for free RSS feed + Whisper
Transcribe many episodes or automate it The tool, through its API

One reminder: a transcript is a copy of someone else's work. Using it for your own notes, search or analysis is one thing; republishing it needs the publisher's permission.


Disclosure: I built the tool described in section 3. This article was drafted with AI assistance and checked by me.

Top comments (1)

Collapse
 
clem616 profile image
clement-melkior •

One thing I couldn't solve: Spotify-exclusive shows. There's no public feed, so none of the three routes works for them. Has anyone found a legitimate way to get the audio or text for those, or is it just a dead end? Also curious what people do with transcripts once they have them: search, summaries, something else?