N8N Tools - YouTube Enhanced icon

N8N Tools - YouTube Enhanced

Comprehensive YouTube Data API v3 and Analytics integration for N8N workflows

Actions83

Overview

The node provides enhanced integration with YouTube's Data API v3 and Analytics API, enabling users to retrieve detailed analytics data for YouTube channels. Specifically, the "Get Channel Analytics" operation fetches various performance metrics and dimensions for a specified YouTube channel over a defined date range. This is useful for content creators, marketers, and analysts who want to monitor channel performance, understand audience behavior, and optimize content strategy.

Practical examples include:

  • Tracking total views and watch time of a channel within a specific period.
  • Analyzing subscriber growth or loss.
  • Understanding demographic breakdowns or traffic sources.
  • Monitoring revenue-related metrics like estimated revenue or CPM.

Properties

Name Meaning
Channel ID The unique identifier of the YouTube channel for which analytics data is requested.
Start Date The beginning date for the analytics data range (inclusive).
End Date The ending date for the analytics data range (inclusive).
Metrics The specific analytics metrics to include in the report. Options include:
- Views, Estimated Minutes Watched, Average View Duration, Average View Percentage, Subscribers, Subscribers Gained, Subscribers Lost, Likes, Dislikes, Comments, Shares, Estimated Revenue, Ad Revenue, Gross Revenue, CPM, CPC, Impressions, Monetized Playbacks, Playback Based CPM, Annotation Impressions, Annotation Clicks, Annotation Clickable Impressions, Annotation Closable Impressions, Annotation Closes, Annotation Close Rate, Card Impressions, Card Clicks, Card Click Rate, Card Teaser Impressions, Card Teaser Clicks, Card Teaser Click Rate, Audience Watch Ratio, Relative Retention Performance
Dimensions Optional grouping dimensions for the analytics data. Options include:
- Date, Month, Year, Video, Playlist, Channel, Age Group, Gender, Country, Province, Continent, Sub Continent, Device Type, Operating System, Browser, Traffic Source Type, Revenue Source Type, Ad Type, Subscribed Status, Playback Location Type, Annotation Type, Card Type, Sharing Service, Live or On Demand, Content Type, Elapsed Video Time Ratio
Sort Optional string to specify sort order of results, e.g., "-views" for descending by views.
Filters Optional filters to apply to the analytics data query.
Max Results Maximum number of results to return (1 to 1000). Default is 100.
Start Index Index of the first result to return (minimum 1).

Output

The output JSON contains the analytics data retrieved from YouTube for the specified channel and parameters. The structure depends on the selected metrics and dimensions but generally includes:

  • Rows of analytics data grouped by the chosen dimensions.
  • Values corresponding to each requested metric.
  • Metadata about the query such as start/end dates, total results, etc.

No binary data output is produced by this operation.

Dependencies

  • Requires an active subscription and valid API key credential for the external N8N Tools API service that validates usage.
  • Requires OAuth2 credentials for YouTube API access.
  • The node internally uses helper classes to interact with YouTube's Analytics API endpoints.

Troubleshooting

  • Invalid subscription or API key error: If the node throws an error indicating invalid subscription or API key, verify that the API key credential is correct and has an active subscription.
  • Permission errors: Ensure the OAuth2 credentials have sufficient permissions/scopes to access YouTube Analytics data.
  • Invalid Channel ID: Providing an incorrect or non-existent channel ID will result in no data or errors.
  • Date range issues: The start date must be before or equal to the end date; otherwise, the API may reject the request.
  • Exceeding max results: Requesting more than 1000 results may cause errors; keep maxResults within allowed limits.

Links and References

Discussion