YouTube Transcript Cleaner using RapidAPI - n8n Workflow

Automate extracting and cleaning YouTube video transcripts using this powerful n8n workflow. Integrates RapidAPI for reliable data extraction and custom n8n code.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Content marketers needing clean transcripts for blog posts.

  • Researchers analyzing video content at scale.

  • Developers looking for a reliable n8n templates for API integration and data manipulation.

  • Automation enthusiasts seeking advanced examples of the n8n Function node.

Overview

Extracting clean, ready-to-use transcripts from video content is essential for SEO and content repurposing. This specialized n8n workflow solves the problem of unreliable transcript fetching and messy raw data by integrating with a robust RapidAPI service. Starting with a simple form input, this n8n automation reliably pulls the transcript data. Crucially, it then uses an n8n Function node to normalize punctuation, remove extraneous whitespace, and handle various API response formats, delivering a consistently clean final transcript. This efficient approach means less manual cleanup and faster time-to-content. If you are looking for ready-made n8n templates for data extraction, this is an excellent reference implementation.

How it Works

This comprehensive n8n workflow operates in four main stages:


  1. Triggering the Automation: The n8n trigger is a specialized Form Trigger node that presents a simple web form, requiring the user to input the desired YouTube video URL.

  2. API Extraction: The URL is immediately passed to the extractTranscript n8n node (an HTTP Request node). This node calls the RapidAPI endpoint (youtube-transcript3.p.rapidapi.com) using the provided URL, securely retrieving the raw transcript data.

  3. Data Cleaning: The raw output is routed to the processTranscript n8n node (a Function node). This custom code block iterates over the transcript segments, handles different data structures, aggregates the text, and applies critical cleaning logic. This logic removes excessive spacing and ensures punctuation is correctly formatted.

  4. Final Output: The cleanedTranscript n8n node, a Set node, takes the perfectly formatted text and sets it as the final output variable (transcript), concluding the execution of the n8n workflow and providing the user with the clean data.

Installation Guide

To install and utilize this powerful n8n template, follow these steps:


  1. Import: Copy the provided JSON code and import it directly into your self-hosted or cloud n8n instance.

  2. RapidAPI Key Setup: Obtain an API key for the youtube-transcript3 API on RapidAPI.

  3. Credential Configuration: Open the extractTranscript n8n node (HTTP Request).

* Locate the header parameters x-rapidapi-key and replace the placeholder value ("yourapikey") with your actual RapidAPI key.

  1. Activate: Ensure all credentials are set, and then activate the n8n workflow using the toggle switch. The automation is now ready to be run via the webhook URL generated by the n8n trigger node.

Node Details

This n8n workflow leverages several key n8n node types to achieve its goal:

YoutubeVideoURL (n8n Form Trigger): This serves as the initial n8n trigger. It creates a user-friendly form interface that captures the single necessary input: the 'Youtube Video Url'. This node initiates the entire n8n workflow execution.
extractTranscript (n8n HTTP Request): This is the core data extraction n8n node. It is configured to send a POST request to the RapidAPI endpoint. Key configurations include setting the url parameter in the body dynamically using the input ={{ $json['Youtube Video Url'] }} and passing the required x-rapidapi-host and x-rapidapi-key header credentials.
processTranscript (n8n Function): A crucial custom code n8n node responsible for data transformation. Its function is to consolidate array-based transcript segments into a single string and apply regex cleaning (/\s+/g and /\s([.,!?])/g) to ensure the resulting cleanedTranscript is perfectly readable and normalized.
cleanedTranscript (n8n Set Node): This final n8n node defines the structure of the output payload, mapping the cleaned transcript text to a clear variable named transcript for downstream use or final viewing.

Related n8n Workflows

Free

Nodes: 4 Nodes
Updated: December 26 2025
View all
Created by

Automation expert specializing in building smart, scalable workflows using tools like n8n, Make, and Airtable. I help businesses save time, reduce manual work, and grow faster with tailored automation solutions. Feel free to reach out at [email protected] to discuss your project.

Featured*