Skip to content

A powerful and efficient Node.js service for transcribing YouTube videos. This service leverages the high-speed Groq API with Whisper models for rapid and accurate transcription, and can also fall back to a local whisper.cpp instance.

Notifications You must be signed in to change notification settings

devtitus/YouTube-Transcripts-Using-Whisper

Repository files navigation

🎥 YouTube Transcription Service

🚀 Turn YouTube videos into accurate text transcripts with AI!

A powerful backend service that automatically generates transcripts for any YouTube video using the lightning-fast Groq API. Perfect for developers, researchers, and content creators who need to extract textual content from videos programmatically.

✨ Key Features

  • 🌩️ Blazing Fast: Powered by Groq API with Whisper models for near real-time transcription
  • 🔀 Smart Audio Processing: Automatic chunking for large files, intelligent format conversion
  • 🐳 Easy Deployment: One-command Docker setup, ready in minutes
  • 📄 Multiple Formats: JSON, SRT, VTT, and TXT output formats
  • 🚦 Built-in Rate Limiting: Prevents API quota issues automatically
  • 🔧 Flexible API: Supports both query parameters and JSON requests
  • 📊 Comprehensive Logging: Detailed logs for monitoring and debugging

🚀 Quick Start with Docker

Get your transcription service running in just 3 simple steps!

1️⃣ Clone & Configure

git clone https://github.com/devtitus/YouTube-Transcripts-Using-Whisper.git
cd transcripts_project
cp .env.docker .env

Edit .env and add your Groq API key (get one from Groq Console):

# Required: Your Groq API key
GROQ_API_KEY=your_groq_api_key_here

# Optional: Secure your API endpoint
API_KEY=your_secret_api_key

# Optional: Customize port (default: 5687)
PORT=5687

⚠️ Important: The GROQ_API_KEY is required for transcription to work.

2️⃣ Launch the Service

docker-compose up --build -d

Your service is now live at http://localhost:5687! 🎉

3️⃣ Try It Out

# Health check
curl "http://localhost:5687/healthz"

# Transcribe a YouTube video
curl "http://localhost:5687/v1/transcripts?url=https://www.youtube.com/watch?v=dQw4w9WgXcQ"

You'll receive a JSON response with the full transcript! 📝

🔧 API Reference

Endpoint

POST /v1/transcripts

Input Methods

Option 1: Query Parameters (Simple)

curl "http://localhost:5687/v1/transcripts?url=<YOUTUBE_URL>&model=whisper-large-v3"

Option 2: JSON Body (Advanced)

curl -X POST http://localhost:5687/v1/transcripts \
  -H "Content-Type: application/json" \
  -d '{
    "youtubeUrl": "<YOUTUBE_URL>",
    "options": {
      "model": "whisper-large-v3",
      "language": "en"
    }
  }'

Parameters

Parameter Location Description Example
youtubeUrl/url Body/Query Required - YouTube video URL https://youtube.com/watch?v=...
model Body/Query Whisper model to use whisper-large-v3
language Body/Query Language hint (e.g., "en", "es") en

Available Models

  • whisper-large-v3-turbo (default) - Fastest option 🏃
  • whisper-large-v3 - Most accurate option 🎯
  • distil-whisper-large-v3-en - English optimized option 🇬🇧

🐳 Docker Deployment

For detailed Docker setup instructions, see Docker Guide.

📚 Documentation

🤝 Contributing

Found a bug or have an idea? Open an issue or submit a pull request! 🚀

📜 License

This project is open source and available under the MIT License.

About

A powerful and efficient Node.js service for transcribing YouTube videos. This service leverages the high-speed Groq API with Whisper models for rapid and accurate transcription, and can also fall back to a local whisper.cpp instance.

Topics

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •