N8N Tools - YouTube Enhanced icon

N8N Tools - YouTube Enhanced

Comprehensive YouTube Data API v3 and Analytics integration for N8N workflows

Actions83

Overview

This node provides enhanced integration with YouTube's Data API v3 and Analytics API, allowing users to retrieve detailed analytics data about their YouTube channels, videos, playlists, and content owners. Specifically, the "Get Demographics" operation under the "Analytics" resource fetches demographic information for a specified YouTube channel over a defined date range. This includes metrics such as views broken down by age group and gender.

Use cases include:

  • Understanding the audience composition of a YouTube channel.
  • Tailoring content strategy based on viewer demographics.
  • Reporting and monitoring changes in audience makeup over time.

For example, a content creator can use this node to get demographic insights (age and gender distribution) for their channel between two dates to optimize future video topics or advertising strategies.

Properties

Name Meaning
Channel ID The unique identifier of the YouTube channel for which to retrieve demographic analytics data.
Start Date The start date for the analytics data range (inclusive).
End Date The end date for the analytics data range (inclusive).
Metrics The specific metrics to include in the report. Options include: Views, Estimated Minutes Watched, Average View Duration, Subscribers, Likes, Comments, Shares, Estimated Revenue, CPM, Impressions, and many more. For demographics, relevant metrics typically include views and subscribers.
Max Results Maximum number of results to return (default 100, min 1, max 1000).
Start Index The index of the first result to return (default 1).

Output

The output is a JSON object containing the requested demographic analytics data for the specified channel and date range. The structure typically includes:

  • Breakdown of metrics by demographic categories such as age groups and gender.
  • Time series or aggregated values depending on the query parameters.
  • Numeric values representing counts or rates for each metric.

No binary data is output by this operation.

Example output snippet (conceptual):

{
  "ageGroup": {
    "18-24": 12345,
    "25-34": 23456,
    ...
  },
  "gender": {
    "male": 34567,
    "female": 45678
  },
  "metrics": {
    "views": 78901,
    "subscribersGained": 1234
  }
}

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 that wrap YouTube API endpoints for analytics.
  • No additional environment variables are explicitly required beyond standard n8n credential setup.

Troubleshooting

  • Invalid subscription or API key error: If you receive errors indicating invalid subscription or API key, verify your API key and subscription status with the external N8N Tools API provider.
  • Permission errors from YouTube API: Ensure the OAuth2 credentials have sufficient permissions/scopes to access YouTube Analytics data.
  • Empty or incomplete data: Check that the date range is valid and that the channel has sufficient data for the requested metrics.
  • Max Results limits: The API enforces a maximum number of results; requesting too many may cause errors or truncation.
  • Network or timeout issues: These can occur if the external API is unreachable; retry or check network connectivity.

Links and References

Discussion