Sign inSign up

subipranuvem/youtube_transcript_api

By subipranuvem

•Updated over 1 year ago

A simple Python API that can obtain an YouTube Video transcription given an Video ID or an URL.

Image
Languages & frameworks
Developer tools
0

290

subipranuvem/youtube_transcript_api repository overview

⁠Basic Documentation for Docker Image of FastAPI YouTube Transcript API

This Docker image contains an API built in Python using FastAPI, allowing users to retrieve transcripts from YouTube videos given a video ID or URL.


⁠Running the Container

By default, the API runs on port 8000. To start the container with default settings:

docker run -d -p 8000:8000 subipranuvem/youtube_transcript_api:latest

To change the default port, set the PORT environment variable:

docker run -d -p 8001:8001 -e PORT=8001 subipranuvem/youtube_transcript_api:latest

⁠Using the API

⁠Available Endpoint:

GET /youtube/transcript

⁠Query Parameters:
ParameterTypeDescriptionExample
video_idOptional (str)YouTube video IDdQw4w9WgXcQ
video_urlOptional (str)Full YouTube video URLhttps://www.youtube.com/watch?v=dQw4w9WgXcQ
preferred_languagesOptional (list)Preferred languages for transcript (default: ["en"])["pt", "es"]

Note: At least one of the parameters (video_id or video_url) must be provided.


⁠Interactive Documentation

After running the container, access the interactive Swagger UI documentation at the /docs route:

http://localhost:8000/docs

(or replace with your configured port)


⁠Request Example

curl -X GET "http://localhost:8000/youtube/transcript?video_url=https://www.youtube.com/watch?v=dQw4w9WgXcQ&preferred_languages=pt" -H "accept: application/json"

Tag summary

Content type

Image

Digest

sha256:1ee70f89c…

Size

155.6 MB

Last updated

over 1 year ago

docker pull subipranuvem/youtube_transcript_api