Youtube Transcript API icon

Youtube Transcript API

Get the transcript of a youtube video

Overview

This n8n node retrieves the transcript of a YouTube video. Given a YouTube video URL or ID, it fetches the video's transcript in the specified language, returning both the plain text and SRT (SubRip Subtitle) format. This node is useful for automating workflows that require extracting spoken content from YouTube videos, such as generating summaries, performing sentiment analysis, or archiving subtitles.

Example scenarios:

  • Automatically transcribing educational videos for further text analysis.
  • Extracting subtitles for accessibility or translation purposes.
  • Archiving transcripts of company webinars hosted on YouTube.

Properties

Name Type Meaning
Youtube URL String The ID or full URL of the YouTube video to transcribe.
Language String The language code (e.g., "en") specifying which transcript to retrieve.

Output

The node outputs a JSON object with the following fields:

Field Type Description
videoId String The extracted YouTube video ID.
transcript String The full transcript of the video as plain text.
srt String The transcript formatted as an SRT subtitle file (SubRip format).

Dependencies

  • External Service: Requires access to YouTube (publicly available videos with transcripts).
  • npm Packages:
    • youtube-transcript (for fetching transcripts)
    • n8n-workflow (n8n internal)
  • No API key is required for public videos with available transcripts.

Troubleshooting

  • No Transcript Available: If the video does not have a transcript (e.g., auto-generated captions are disabled), the node will throw an error.
  • Invalid URL/ID: If the provided YouTube URL or ID is invalid, the node will fail to extract the video ID and return an error.
  • Language Not Supported: If the requested language is not available for the video, the transcript may not be returned or may default to another language.
  • Error Handling: If an error occurs and "Continue On Fail" is enabled, the output will include an error field with details.

Common error messages:

  • "Could not find transcript": The video has no transcript available.
  • "Invalid video ID": The input could not be parsed into a valid YouTube video ID.
  • "Request failed with status code 403": The video is private or restricted.

Links and References

Discussion