See llms.txt for all machine-readable content.

Back to Templates

Extract and clean YouTube video transcripts with RapidAPI

Here is your refined template description with detailed step-by-step instructions, markdown formatting, and customization guidance.

YouTube Transcript Extraction Workflow

This n8n workflow extracts and processes transcripts from YouTube videos using the YouTube Transcript API on RapidAPI. It allows users to retrieve subtitles from YouTube videos, clean them up, and return structured transcript data for further processing.

Table of Contents

Problem Statement & Target Audience

Who is this for?

This workflow is ideal for content creators, researchers, and developers who need to:

  • Extract subtitles from YouTube videos automatically.
  • Format and clean transcript data for readability.
  • Use transcripts for summarization, content repurposing, or language analysis.

Pre-conditions & API Requirements

API Required

n8n Setup Prerequisites

  • A running n8n instance (Installation Guide)
  • A RapidAPI account to access the YouTube Transcript API
  • An API key from RapidAPI to authenticate requests

Step-by-Step Workflow Explanation

1. Input YouTube Video URL (Trigger)

  • This step provides a simple input form where users enter a YouTube video URL.

2. HTTP Request Node (Retrieve Transcript Data)

  • Makes a GET request to the YouTube Transcript API via RapidAPI.
  • Validates the submitted YouTube URL and sends its video ID as the videoId query parameter.
  • Uses an n8n Header Auth credential for x-rapidapi-key.

3. Code Node (Process Transcript)

  • Receives the API response containing the raw transcript.
  • Processes and cleans the transcript:
    • Collapses repeated whitespace and fixes spacing before punctuation.
    • Formats text for readability.
  • Handles errors when no transcript is available.
  • Outputs both the raw and cleaned transcript for further use.

4. Set Field Node (Response Formatting)

  • Structures the processed transcript data into a user-friendly format.
  • The Form Ending displays the cleaned transcript or explains why it is unavailable. The workflow output also retains the raw transcript.

Customization Guide

1. Modify Transcript Cleaning Rules

  • Update the Code Node to apply custom text processing, such as:
    • Removing timestamps.
    • Changing the output format (e.g., JSON, plain text).

2. Store Transcripts in a Database

  • Add a Database Node (e.g., MySQL, PostgreSQL, or Firebase) to save transcripts.

3. Generate Summaries from Transcripts

  • Integrate AI services (e.g., OpenAI, Google Gemini) to summarize transcripts.

4. Convert Transcripts into Speech

  • Use ElevenLabs API to generate an AI-powered voiceover from transcripts.

How to Set Up This Workflow

Step 1: Import the Workflow into n8n

  • Download or copy the workflow JSON file.
  • Import it into your n8n instance.

Step 2: Set Up the API Key

  • Sign up for the YouTube Transcript API.
  • Subscribe to the api.
  • Create a Header Auth credential named for this service. Set its header name to x-rapidapi-key and its value to your RapidAPI key. Select that credential in extractTranscript.

Step 3: Activate the Workflow

  • Start the workflow in n8n.
  • Enter a YouTube video URL in the input form.
  • The workflow will return a cleaned transcript.

This workflow ensures seamless YouTube transcript extraction and processing with minimal manual effort. 🚀