N8N Tools - YouTube Enhanced icon

N8N Tools - YouTube Enhanced

Comprehensive YouTube Data API v3 and Analytics integration for N8N workflows

Actions83

Overview

The node "N8N Tools - YouTube Enhanced" integrates deeply with the YouTube Data API v3 and YouTube Analytics API, providing extensive capabilities to retrieve and manipulate YouTube data within n8n workflows. Specifically, the Analytics > Get Sharing Service Data operation fetches analytics metrics related to how content from a specified YouTube channel is shared across various sharing services over a defined date range.

This operation is beneficial for YouTube content creators, marketers, and analysts who want to understand the distribution and sharing patterns of their videos or channel content on external platforms. For example, it can help identify which social media or sharing services drive the most traffic or engagement, enabling targeted marketing strategies.

Practical use cases include:

  • Tracking shares of your YouTube channel content on different social networks.
  • Measuring the effectiveness of promotional campaigns by analyzing sharing trends.
  • Integrating sharing analytics into broader marketing dashboards or automation workflows.

Properties

Name Meaning
Channel ID The unique identifier of the YouTube channel for which sharing service analytics are requested.
Start Date The start date (inclusive) for the analytics data period.
End Date The end date (inclusive) for the analytics data period.
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
Max Results Maximum number of results to return (default 100, min 1, max 1000).
Start Index Index of the first result to return (default 1, minimum 1).

Output

The output JSON contains the analytics data retrieved from YouTube's Analytics API for the sharing services related to the specified channel and date range. The structure typically includes:

  • Rows of data corresponding to the selected metrics grouped by sharing service.
  • Each row contains metric values such as views, shares, or other selected analytics.
  • Metadata about the query like column headers, totals, and pagination info may also be included depending on the API response.

No binary data is output by this operation.

Example snippet of output JSON might look like:

{
  "kind": "youtubeAnalytics#resultTable",
  "columnHeaders": [
    {"name": "sharingService", "type": "STRING"},
    {"name": "views", "type": "INTEGER"},
    {"name": "shares", "type": "INTEGER"}
  ],
  "rows": [
    ["Facebook", 1234, 56],
    ["Twitter", 789, 34]
  ]
}

Dependencies

  • Requires an active subscription and valid API key credential for the external N8N Tools API service.
  • Requires OAuth2 credentials for YouTube API access.
  • The node internally uses helper classes to interact with YouTube APIs, including the Analytics API.
  • Proper configuration of these credentials in n8n is necessary for successful execution.

Troubleshooting

  • Invalid subscription or API key error: If you receive errors indicating invalid subscription or API key, verify that your API key credential is correct and has the necessary permissions.
  • YouTube API quota limits: Exceeding YouTube API quotas can cause failures; monitor usage and consider applying for higher quota if needed.
  • Missing required parameters: Ensure all required fields such as Channel ID, Start Date, End Date, and Metrics are provided.
  • Date range issues: The Start Date must be before or equal to the End Date; otherwise, the API may reject the request.
  • Empty or unexpected results: Check that the channel has relevant data for the selected metrics and date range.

Links and References

Discussion