A REST API wrapper around youtube-transcript-api Python package. This API allows you to fetch YouTube video transcripts (subtitles) in various formats.
- Get transcripts in multiple formats (JSON, Text, WebVTT, SRT)
- List available transcripts for a video
- Optional API key protection
- Docker ready
One-liner to run with Docker:
docker run -p 8000:8000 yoanbernabeu/youtubetranscriptapi:latest
# Without API key protection
docker compose up -d
# With API key protection
API_KEY=your_secret_key_here docker compose up -d
# Clone repository
git clone https://github.com/yourusername/YoutubeTranscriptApi.git
cd YoutubeTranscriptApi
# Install dependencies
pip install -r requirements.txt
# Run server
uvicorn main:app --reload
# JSON format (default)
curl "http://localhost:8000/transcript?video_id=VIDEO_ID&language=en"
# Other formats (text, webvtt, srt)
curl "http://localhost:8000/transcript?video_id=VIDEO_ID&language=en&format=srt"
curl "http://localhost:8000/transcripts?video_id=VIDEO_ID"
curl -H "X-API-Key: your_secret_key_here" "http://localhost:8000/transcript?video_id=VIDEO_ID"
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
- OpenAPI JSON: http://localhost:8000/openapi.json
API_KEY
: Optional. If set, will require this key for protected endpoints.
This project is licensed under the MIT License - see the LICENSE file for details.
This project is a REST API wrapper around the excellent youtube-transcript-api Python package.