Back to blog

YouTubeTranscriptApi has no attribute 'get_transcript': the fix, and why pinning an old version can fail

youtube-transcript-api 1.2.0 removed get_transcript. The new calls, the errors you hit after the first fix, and what happened when we pinned old versions.

TL;DR: youtube-transcript-api removed get_transcript in version 1.2.0. Replace YouTubeTranscriptApi.get_transcript(video_id) with YouTubeTranscriptApi().fetch(video_id).to_raw_data() and most old code works again, because that returns the same kind of list of dictionaries. Don't pin 0.6.3 to get the old method back: the method exists there, but it failed in our test. If the code runs on a server, TranscriptFetch's YouTube Transcript API is the hosted route, and it's ours.

We ran the youtube-transcript-api calls below on 2026-11-23 with Python 3.12 on Linux, from a home connection. The current release was 1.2.5.

Troubleshooting

Why the error appears

The full message is:

text
AttributeError: type object 'YouTubeTranscriptApi' has no attribute 'get_transcript'

The library moved from static methods on the class to ordinary methods on an instance. In 1.1.0 and 1.1.1, get_transcript still ran and printed a DeprecationWarning. In 1.2.0, published in July 2025, it's gone. Older tutorials still show the old call, and an AI assistant that learned from them can write it too.

These are the variations we got on 1.2.5:

CodeError
YouTubeTranscriptApi.get_transcript(id)type object 'YouTubeTranscriptApi' has no attribute 'get_transcript'
YouTubeTranscriptApi().get_transcript(id)'YouTubeTranscriptApi' object has no attribute 'get_transcript'
YouTubeTranscriptApi.list_transcripts(id)type object 'YouTubeTranscriptApi' has no attribute 'list_transcripts'
YouTubeTranscriptApi.get_transcripts([id])type object 'YouTubeTranscriptApi' has no attribute 'get_transcripts'
youtube_transcript_api.get_transcript(id)module 'youtube_transcript_api' has no attribute 'get_transcript'
Guide

The fix

python
from youtube_transcript_api import YouTubeTranscriptApi

api = YouTubeTranscriptApi()
rows = api.fetch("dQw4w9WgXcQ", languages=["en"]).to_raw_data()

print(rows[0])
# {'text': '[♪♪♪]', 'start': 1.36, 'duration': 1.68}

Here is how the old calls map to the new ones:

OldNew
YouTubeTranscriptApi.get_transcript(id)YouTubeTranscriptApi().fetch(id).to_raw_data()
get_transcript(id, languages=["de", "en"])fetch(id, languages=["de", "en"])
YouTubeTranscriptApi.list_transcripts(id)YouTubeTranscriptApi().list(id)
get_transcripts([id1, id2])Loop over the IDs and call fetch
proxies={...}YouTubeTranscriptApi(proxy_config=GenericProxyConfig(...))

Pass the video ID, not the URL. A full URL raised InvalidVideoId.

Troubleshooting

Errors you hit right after the fix

Changing the method name is often only half of it, because fetch returns an object, not a list.

ErrorCauseFix
YouTubeTranscriptApi.fetch() missing 1 required positional argument: 'video_id'Called fetch on the classAdd parentheses: YouTubeTranscriptApi().fetch(id)
'FetchedTranscriptSnippet' object is not subscriptableOld code reads row["text"]Use row.text, or add .to_raw_data()
'FetchedTranscriptSnippet' object has no attribute 'get'Old code reads row.get("text")Add .to_raw_data()
Object of type FetchedTranscript is not JSON serializablejson.dumps on the objectjson.dumps(fetched.to_raw_data())
'dict' object has no attribute 'text'Passed to_raw_data() to a formatterPass the fetched object to TextFormatter
fetch() got an unexpected keyword argument 'proxies'Proxies moved to the constructorUse proxy_config
__init__() got an unexpected keyword argument 'cookies'There is no cookies argument in 1.2.5The constructor accepts your own requests.Session as http_client; we didn't test signed-in cookies

The two rows about to_raw_data() pull in opposite directions. Your own code that expects dictionaries needs it, and the library's formatters need the object without it.

For plain text, you don't need either:

python
text = " ".join(snippet.text for snippet in api.fetch("dQw4w9WgXcQ"))
Guide

Why you shouldn't pin an old version

Installing an older release is the tempting shortcut. We tried the same video, dQw4w9WgXcQ, on six releases:

Versionget_transcriptfetch
0.6.3ParseError: no element foundDoesn't exist
1.0.3ParseError: no element foundParseError: no element found
1.1.0Worked, with a deprecation warningWorked
1.1.1Worked, with a deprecation warningWorked
1.2.0AttributeErrorWorked
1.2.5AttributeErrorWorked

So pip install youtube-transcript-api==0.6.3 swapped an AttributeError for a ParseError. That's one video and one pass per version. It shows the old releases can fail today, not how often they do.

If you need a stopgap, 1.1.1 was the newest release we tried where the old call ran. It dates from July 2025, so treat it as temporary. The lasting fix is to upgrade and change the call:

bash
python -m pip install -U youtube-transcript-api
Troubleshooting

If it now says IpBlocked

Your code is fixed, and you've met the next problem. We met it too: after the clean pass we started a second test over more videos, and YouTube blocked our home address before it finished. Versions 1.1.1, 1.2.0 and 1.2.5 all raised IpBlocked. We left that second run out of the table above.

The library's own message says most cloud provider addresses are blocked. The production troubleshooting guide covers proxies and how to tell a block from a missing caption track.

If you'd rather not run proxies, the hosted call takes a URL or an ID. We checked this against the method signature in SDK 2.5.0 and didn't run it as part of today's test:

python
# pip install transcriptfetch-sdk, and set TRANSCRIPTFETCH_API_KEY
from transcriptfetch import TranscriptFetch

with TranscriptFetch(timeout=60) as tf:
    result = tf.transcripts.video("dQw4w9WgXcQ", mode="captions")
    print(" ".join(segment.text for segment in result.segments))

You start with 50 free credits, which don't renew. A captioned video costs one, and failed requests are free. There's no language setting on the request, so if you need to choose a track, the open-source library does that and ours doesn't.

FAQ

Version 1.2.0. In our test 1.1.1 still ran get_transcript with a deprecation warning, and 1.2.0 raised AttributeError. The replacement is fetch, called on an instance.