π Extract YouTube Video Metadata and Save to Google Docs using RapidAPI
β‘ 276 views Β· π Market Research & Insights
π‘ Pro Tip β YouTubeβs API quotas can be a bottleneck when youβre pulling data at scale. ScraperNode is a community node with dedicated scrapers for channels, videos, and comments β no quota limits, just structured data.
Description
πΊ Automated YouTube Video Metadata Extraction Workflow
Description: This workflow leverages the YouTube Metadata API to automatically extract detailed video information from any YouTube URL. It uses n8n to automate the entire process and stores the metadata in a neatly formatted Google Docs document.
Perfect for content creators, marketers, and researchers who need quick, organized YouTube video insights at scale.
βοΈ Node-by-Node Explanation
1. β On Form Submission
This node acts as the trigger. When a user submits a form containing a YouTube video URL, the workflow is activated.
- Input: YouTube Video URL
- Platform:
Webhookorn8n Form Trigger
2. π YouTube Metadata API (HTTP Request)
This node sends the video URL to the YouTube Metadata API via HTTP request.
-
Action:
GETrequest -
Headers:
-H "X-RapidAPI-Key: YOUR_API_KEY" -H "X-RapidAPI-Host: youtube-metadata1.p.rapidapi.com" -
Endpoint Example:
https://youtube-metadata1.p.rapidapi.com/video?url=YOUTUBE_VIDEO_URL -
Output: JSON with metadata like:
- Title
- Description
- Views, Likes, Comments
- Duration
- Upload Date
- Channel Info
- Thumbnails
3. π§ Reformat Metadata (Code Node)
This node reformats the raw metadata into a clean, human-readable text block.
-
Example Output Format:
π¬ **Title:** How to Build Workflows with n8n π§Ύ **Description:** This tutorial explains how to build... π€ **Channel:** n8n Tutorials π **Published On:** 2023-05-10 β±οΈ **Duration:** 10 minutes, 30 seconds ποΈ **Views:** 45,678 π **Likes:** 1,234 π¬ **Comments:** 210 π **URL:** https://youtube.com/watch?v=abc123
4. π Append to Google Docs
This node connects to your Google Docs and appends the formatted metadata into a selected document.
-
Document Format Example:
## π Video Entry β [Date] π¬ **Title:** π§Ύ **Description:** π€ **Channel:** π **Published On:** β±οΈ **Duration:** ποΈ **Views:** π **Likes:** π¬ **Comments:** π **URL:** ---
π Use Cases
- Content Creators: Quickly analyze competitor content or inspirations.
- Marketers: Collect campaign video performance data.
- Researchers: Compile structured metadata across videos.
- Social Media Managers: Create content briefs effortlessly.
β Benefits
- π Time-saving: Automates manual video data extraction
- π Accurate: Uses reliable, updated YouTube API
- π Organized: Formats and stores data in Google Docs
- π Scalable: Handles unlimited YouTube URLs
- π― User-friendly: Simple setup and clean output
π How to Get Your API Key for YouTube Metadata API
- Go to the YouTube Metadata API on RapidAPI.
- Sign up or log in to your RapidAPI account.
- Click Subscribe to Test and choose a pricing plan (free or paid).
- Copy your API Key shown in the βX-RapidAPI-Keyβ section.
- Use it in your HTTP request headers.
π§° Google Docs Integration β Full Setup Instructions
π Step 1: Enable Google Docs API
- Go to the Google Cloud Console.
- Create a new project or select an existing one.
- Navigate to APIs & Services > Library.
- Search for Google Docs API and click Enable.
- Also enable Google Drive API (for document access).
π Step 2: Create OAuth Credentials
- Go to APIs & Services > Credentials.
- Click Create Credentials > OAuth Client ID.
- Select Web Application or Desktop App.
- Add authorized redirect URIs if needed (e.g., for n8n OAuth).
- Save your Client ID and Client Secret.
π Step 3: Connect n8n to Google Docs
- In n8n, go to Credentials > Google Docs API.
- Add new credentials using the Client ID and Secret from above.
- Authenticate with your Google account and allow access.
π Step 4: Create and Format Your Google Document
-
Go to Google Docs and create a new document.
-
Name it (e.g.,
YouTube Metadata Report). -
Optionally, add a title or table of contents.
-
Copy the Document ID from the URL:
https://docs.google.com/document/d/DOCUMENT_ID/edit
π Step 5: Use Append Content to Document Node in n8n
-
Use the
Google Docsnode in n8n with:- Operation:
Append Content - Document ID: Your copied Google Doc ID
- Content: The formatted video summary string
- Operation:
π¨ Customization Options
- π‘ Add Tags: Insert hashtags or categories based on video topics.
- π Organize by Date: Create headers for each day or weekβs entries.
- πΈ Embed Thumbnails: Use
thumbnail_urlto embed preview images. - π Spreadsheet Export: Use Google Sheets instead of Docs if preferred.
π Troubleshooting Tips
| Issue | Solution |
|---|---|
| β Auth Error (Google Docs) | Ensure correct OAuth redirect URI and permissions. |
| β API Request Fails | Check API key and request structure; test on RapidAPIβs playground. |
| π Doc Not Updating | Verify Document ID and sharing permissions. |
| π§Ύ Bad Formatting | Debug the code node output using logging or console in n8n. |
| π n8n Timeout | Consider using Wait or Split In Batches for large submissions. |
π Ready to Launch?
You can deploy this workflow in just minutes using n8n.
π Start Automating with n8n
π Nodes Used
HTTP Request, Google Docs, n8n Form Trigger
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File