YouTube Transcript API logo

YouTube Transcript API

by minhleathvn

A Python service that provides APIs to fetch and transcribe YouTube video content. It supports both REST API (Flask) and MCP server implementations.

View on GitHub

Last updated: N/A

What is YouTube Transcript API?

This is a Python service that provides APIs to fetch and transcribe YouTube video content. It offers both REST API (using Flask) and MCP server implementations for accessing and processing YouTube transcripts.

How to use YouTube Transcript API?

To use the REST API, start the Flask server using python apps/flask_server.py. Available endpoints include fetching transcripts, video information, and a health check. For the MCP server, start it with python apps/mcp_server.py and use the provided tools like get_transcript, extract_transcript, and search_youtube_video.

Key features of YouTube Transcript API

  • Fetch YouTube video transcripts in multiple languages

  • Auto-detect and use available transcripts

  • Fallback to audio transcription using Whisper

  • Support for both REST API and MCP server interfaces

  • Automatic language detection

  • Temporary file cleanup

  • Progress reporting

Use cases of YouTube Transcript API

  • Generating transcripts for YouTube videos

  • Analyzing video content through text

  • Creating subtitles for videos

  • Building applications that require access to YouTube video transcripts

  • Searching for specific content within YouTube videos

FAQ from YouTube Transcript API

What languages are supported?

English and Vietnamese are explicitly supported, with auto-detection for other languages.

What happens if a transcript is not available?

The service falls back to audio transcription using Whisper.

What are the dependencies?

Dependencies include youtube-transcript-api, pytube, whisper, torch, langdetect, flask (for REST API), and mcp (for MCP server).

How do I install the required dependencies?

Run pip install -r requirements.txt.

What is the license?

The project is licensed under the MIT License.