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 playlists among other resources. Specifically, the Get Playlist Analytics operation fetches various performance metrics for a specified YouTube playlist over a defined date range. This is useful for content creators, marketers, and analysts who want to monitor playlist engagement, viewer behavior, and revenue-related statistics.

Practical examples include:

  • Tracking total views and watch time of a playlist during a marketing campaign.
  • Analyzing subscriber gains or losses attributed to playlist content.
  • Monitoring monetization metrics like estimated revenue or CPM for playlists.
  • Grouping analytics by dimensions such as date or country to understand audience distribution.

Properties

Name Meaning
Playlist ID The unique identifier of the YouTube playlist to retrieve analytics for.
Start Date The start date (inclusive) for the analytics data period.
End Date The end date (inclusive) for the analytics data period.
Metrics The list of metrics to include in the analytics 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. Default is "Date".
Sort Optional sort order string for the results, e.g., -views to sort 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 (pagination). Minimum is 1.

Output

The node outputs JSON data containing the requested playlist analytics. The structure typically includes:

  • The requested metrics aggregated or grouped by the specified dimensions.
  • Metadata about the playlist and the queried date range.
  • Pagination information if applicable.

The exact JSON structure depends on the YouTube Analytics API response but generally contains rows of data with metric values and dimension labels.

No binary data output is produced by this operation.

Dependencies

  • Requires an active subscription and valid API key credential for the external service providing enhanced YouTube API access.
  • Requires OAuth2 credentials for YouTube API access configured in n8n.
  • The node internally validates the API key subscription before making requests.
  • No additional environment variables are required beyond standard n8n credential setup.

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.
  • Missing or incorrect Playlist ID: Ensure the Playlist ID is provided and correctly formatted.
  • Date range errors: The Start Date and End Date must be valid ISO date strings, and the End Date should not precede the Start Date.
  • Exceeded max results: If requesting too many results, reduce the Max Results parameter to within allowed limits (max 1000).
  • API quota limits: YouTube API quotas may limit the number of requests; consider optimizing queries or checking quota usage.
  • Filters and sorting syntax: Incorrect filter or sort strings may cause API errors; consult YouTube Analytics API documentation for correct syntax.

Links and References

Discussion