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, allowing users to retrieve detailed analytics data about their YouTube channels. Specifically, the "Get Device Data" operation under the "Analytics" resource fetches analytics related to the types of devices viewers use to watch content on a specified YouTube channel within a given date range.

This node is beneficial for YouTube content creators, marketers, and analysts who want to understand how their audience accesses their videos across different device types (e.g., mobile, desktop, tablet). Such insights can help optimize content delivery, advertising strategies, and user engagement by tailoring experiences to the most popular devices.

Practical example:
A YouTube channel owner wants to analyze whether their viewers primarily watch videos on mobile devices or desktops over the last month. Using this node, they specify the channel ID, date range, and desired metrics (like views and estimated minutes watched) to get a breakdown of device usage, enabling them to adjust video formats or promotional efforts accordingly.

Properties

Name Meaning
Channel ID The unique identifier of the YouTube channel for which to retrieve device analytics data.
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
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 for the specified channel and date range, focused on device-related metrics. The structure typically includes:

  • Time series or aggregated data points corresponding to the selected metrics.
  • Breakdown by device type (e.g., mobile, desktop, tablet).
  • Additional metadata such as dates or pagination info depending on the query parameters.

If multiple results are returned, they are provided as an array of JSON objects, each representing a data segment or record.

The node does not output binary data for this operation.

Dependencies

  • Requires a valid API key credential for the external service providing enhanced YouTube API access.
  • Requires OAuth2 credentials for YouTube API access.
  • The node validates the subscription and API key against the external service before making requests.
  • No additional environment variables are explicitly required beyond these credentials.

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 correctly configured and active.
  • Permission errors: Ensure that the OAuth2 credentials have sufficient permissions/scopes to access YouTube Analytics data.
  • Date range issues: Providing an invalid or future date range may cause empty or error responses; ensure start and end dates are valid and logical.
  • Max results limits: Requesting more than the allowed maximum (1000) may cause errors; keep max results within the allowed range.
  • Network or API downtime: Temporary failures in the external API or network connectivity issues can cause request failures; retry after some time.

Links and References

Discussion