N8N Tools - YouTube Enhanced icon

N8N Tools - YouTube Enhanced

Comprehensive YouTube Data API v3 and Analytics integration for N8N workflows

Actions83

Overview

The "Get Comments" operation of the YouTube Enhanced node retrieves comments associated with a specified parent ID, which can be either a video ID or a parent comment ID. This operation is useful for workflows that need to fetch user comments on videos or replies to specific comments for analysis, moderation, or display purposes.

Practical examples include:

  • Collecting all top-level comments on a particular YouTube video for sentiment analysis.
  • Fetching replies to a specific comment to monitor discussion threads.
  • Integrating comment data into dashboards or reports.

Properties

Name Meaning
Parent ID The ID of the parent comment or video from which to retrieve comments. This can be a video ID to get top-level comments or a comment ID to get replies.

Output

The output is a JSON array where each item contains the retrieved comments data from YouTube's API response. The structure corresponds to the standard YouTube Data API v3 comments list response, typically including fields such as comment text, author details, like count, published date, and reply count.

No binary data is output by this operation.

Example snippet of output JSON structure (simplified):

{
  "items": [
    {
      "id": "commentId",
      "snippet": {
        "textDisplay": "Comment text",
        "authorDisplayName": "Author name",
        "likeCount": 5,
        "publishedAt": "2023-01-01T00:00:00Z",
        "parentId": "parentCommentOrVideoId"
      }
    }
  ],
  "nextPageToken": "token_for_pagination",
  "pageInfo": {
    "totalResults": 100,
    "resultsPerPage": 20
  }
}

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 uses internal helper classes to interact with YouTube APIs, specifically a Comments API helper class.
  • No additional environment variables are explicitly required beyond these credentials.

Troubleshooting

  • Invalid subscription or API key error: If the node throws an error about invalid subscription or API key, verify that the provided API key credential is correct and has an active subscription.
  • YouTube API quota limits: Frequent or large requests may hit YouTube API quota limits, resulting in errors. Consider reducing max results or adding delays.
  • Parent ID missing or incorrect: Ensure the Parent ID property is correctly set to a valid video ID or comment ID; otherwise, no comments will be returned or an error may occur.
  • Pagination handling: If many comments exist, use the pageToken parameter (not shown here but available) to paginate through results.

Links and References

Discussion