Skip to main content
YouTube logo

Overview

Add YouTube to any ModuleX agent or workflow. Search videos, inspect channels and playlists, read trending videos and video categories, and fetch public comments against the YouTube Data API v3 (www.googleapis.com/youtube/v3).
Categories: Social Media · Marketing · Content Management · Auth: API Key · Actions: 9

Authentication

API Key Authentication

Authenticate using your YouTube Data API v3 key
1

Step 1

Go to https://console.cloud.google.com and create or select a project
2

Step 2

Open ‘APIs & Services’ > ‘Library’ and enable the ‘YouTube Data API v3’
3

Step 3

Open ‘APIs & Services’ > ‘Credentials’ and create an API key
4

Step 4

Restrict the key to the YouTube Data API v3 (recommended) and copy it
5

Step 5

Paste the API key below

Required Credentials

FieldDescriptionRequiredFormat
YouTube API KeyYour YouTube Data API v3 key from Google Cloud ConsoleYesAIzaSyXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Available Actions

Parameters

query
string
required
Search query for YouTube videos
max_results
integer
Maximum number of videos to return (1-50) (Default: 5)
page_token
string
Page token for pagination (from a previous nextPageToken)
channel_id
string
Filter results to a specific channel ID (starts with ‘UC’)
published_after
string
Only return videos published after this RFC 3339 date (e.g. 2024-01-01T00:00:00Z)
published_before
string
Only return videos published before this RFC 3339 date (e.g. 2024-12-31T23:59:59Z)
video_duration
string
Filter by length: ‘short’ (<4 min), ‘medium’ (4-20 min), ‘long’ (>20 min), ‘any’
order
string
Sort by: ‘date’, ‘rating’, ‘relevance’ (default), ‘title’, ‘videoCount’, ‘viewCount’
video_category_id
string
Filter by category ID (e.g. ‘10’ Music). Use video_categories to list IDs.
video_definition
string
Filter by quality: ‘high’ (HD), ‘standard’, ‘any’
video_caption
string
Filter by captions: ‘closedCaption’ (has captions), ‘none’ (no captions), ‘any’
event_type
string
Filter by live status: ‘live’, ‘upcoming’, ‘completed’
region_code
string
ISO 3166-1 alpha-2 country code (e.g. ‘US’, ‘GB’, ‘JP’)
relevance_language
string
ISO 639-1 language code for relevance (e.g. ‘en’, ‘es’)
Content filtering: ‘moderate’ (default), ‘none’, ‘strict’

Response

{
  "$defs": {
    "SearchItem": {
      "additionalProperties": false,
      "description": "A single video row in ``search``.",
      "properties": {
        "video_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Video Id"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Description"
        },
        "thumbnail": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Thumbnail"
        },
        "channel_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Channel Id"
        },
        "channel_title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Channel Title"
        },
        "published_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Published At"
        },
        "live_broadcast_content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Live Broadcast Content"
        }
      },
      "title": "SearchItem",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "items": {
      "items": {
        "$ref": "#/$defs/SearchItem"
      },
      "title": "Items",
      "type": "array"
    },
    "total_results": {
      "default": 0,
      "title": "Total Results",
      "type": "integer"
    },
    "next_page_token": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Next Page Token"
    }
  },
  "required": [
    "success"
  ],
  "title": "SearchOutput",
  "type": "object"
}

Parameters

video_id
string
required
YouTube video ID (11-character string)

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "video_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Video Id"
    },
    "title": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Title"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Description"
    },
    "channel_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Channel Id"
    },
    "channel_title": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Channel Title"
    },
    "published_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Published At"
    },
    "duration": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Duration"
    },
    "view_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "View Count"
    },
    "like_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Like Count"
    },
    "comment_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Comment Count"
    },
    "favorite_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Favorite Count"
    },
    "thumbnail": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Thumbnail"
    },
    "tags": {
      "items": {
        "type": "string"
      },
      "title": "Tags",
      "type": "array"
    },
    "category_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Category Id"
    },
    "definition": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Definition"
    },
    "caption": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Caption"
    },
    "licensed_content": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Licensed Content"
    },
    "privacy_status": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Privacy Status"
    },
    "live_broadcast_content": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Live Broadcast Content"
    },
    "default_language": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Default Language"
    },
    "default_audio_language": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Default Audio Language"
    },
    "is_live_content": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Is Live Content"
    },
    "scheduled_start_time": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Scheduled Start Time"
    },
    "actual_start_time": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Actual Start Time"
    },
    "actual_end_time": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Actual End Time"
    },
    "concurrent_viewers": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Concurrent Viewers"
    },
    "active_live_chat_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Active Live Chat Id"
    }
  },
  "required": [
    "success"
  ],
  "title": "VideoDetailsOutput",
  "type": "object"
}

Parameters

channel_id
string
Channel ID starting with ‘UC’ (use either channel_id or username)
username
string
Channel username (use either channel_id or username)

Response

{
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "channel_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Channel Id"
    },
    "title": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Title"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Description"
    },
    "subscriber_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Subscriber Count"
    },
    "video_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Video Count"
    },
    "view_count": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "View Count"
    },
    "published_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Published At"
    },
    "thumbnail": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Thumbnail"
    },
    "custom_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Custom Url"
    },
    "country": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Country"
    },
    "uploads_playlist_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Uploads Playlist Id"
    },
    "banner_image_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Banner Image Url"
    },
    "hidden_subscriber_count": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Hidden Subscriber Count"
    }
  },
  "required": [
    "success"
  ],
  "title": "ChannelInfoOutput",
  "type": "object"
}

Parameters

channel_id
string
required
YouTube channel ID starting with ‘UC’ to get videos from
max_results
integer
Maximum number of results to return (1-50) (Default: 10)
order
string
Sort order: ‘date’, ‘rating’, ‘relevance’, ‘title’, ‘viewCount’ (default ‘date’)
page_token
string
Page token for pagination (from a previous nextPageToken)

Response

{
  "$defs": {
    "ChannelVideoItem": {
      "additionalProperties": false,
      "description": "A single video row in ``channel_videos``.",
      "properties": {
        "video_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Video Id"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Description"
        },
        "thumbnail": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Thumbnail"
        },
        "published_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Published At"
        },
        "channel_title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Channel Title"
        }
      },
      "title": "ChannelVideoItem",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "items": {
      "items": {
        "$ref": "#/$defs/ChannelVideoItem"
      },
      "title": "Items",
      "type": "array"
    },
    "total_results": {
      "default": 0,
      "title": "Total Results",
      "type": "integer"
    },
    "next_page_token": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Next Page Token"
    }
  },
  "required": [
    "success"
  ],
  "title": "ChannelVideosOutput",
  "type": "object"
}

Parameters

channel_id
string
required
YouTube channel ID starting with ‘UC’ to get playlists from
max_results
integer
Maximum number of results to return (1-50) (Default: 10)
page_token
string
Page token for pagination (from a previous nextPageToken)

Response

{
  "$defs": {
    "PlaylistSummary": {
      "additionalProperties": false,
      "description": "A single playlist row in ``channel_playlists``.",
      "properties": {
        "playlist_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Playlist Id"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Description"
        },
        "thumbnail": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Thumbnail"
        },
        "item_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Item Count"
        },
        "published_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Published At"
        },
        "channel_title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Channel Title"
        }
      },
      "title": "PlaylistSummary",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "items": {
      "items": {
        "$ref": "#/$defs/PlaylistSummary"
      },
      "title": "Items",
      "type": "array"
    },
    "total_results": {
      "default": 0,
      "title": "Total Results",
      "type": "integer"
    },
    "next_page_token": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Next Page Token"
    }
  },
  "required": [
    "success"
  ],
  "title": "ChannelPlaylistsOutput",
  "type": "object"
}

Parameters

playlist_id
string
required
YouTube playlist ID. Use uploads_playlist_id from channel_info to get all channel videos.
max_results
integer
Maximum number of results to return (1-50) (Default: 10)
page_token
string
Page token for pagination (from a previous nextPageToken)

Response

{
  "$defs": {
    "PlaylistItem": {
      "additionalProperties": false,
      "description": "A single video row in ``playlist_items``.",
      "properties": {
        "video_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Video Id"
        },
        "title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Description"
        },
        "thumbnail": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Thumbnail"
        },
        "published_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Published At"
        },
        "channel_title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Channel Title"
        },
        "position": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Position"
        },
        "video_owner_channel_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Video Owner Channel Id"
        },
        "video_owner_channel_title": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Video Owner Channel Title"
        }
      },
      "title": "PlaylistItem",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "items": {
      "items": {
        "$ref": "#/$defs/PlaylistItem"
      },
      "title": "Items",
      "type": "array"
    },
    "total_results": {
      "default": 0,
      "title": "Total Results",
      "type": "integer"
    },
    "next_page_token": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Next Page Token"
    }
  },
  "required": [
    "success"
  ],
  "title": "PlaylistItemsOutput",
  "type": "object"
}

Parameters

video_id
string
required
YouTube video ID (11-character string)
max_results
integer
Maximum number of comments to return (1-100) (Default: 20)
order
string
Order of comments: ‘time’ (newest first) or ‘relevance’ (most relevant first) (Default: relevance)
page_token
string
Page token for pagination (from a previous nextPageToken)

Response

{
  "$defs": {
    "CommentItem": {
      "additionalProperties": false,
      "description": "A single top-level comment row in ``comments``.",
      "properties": {
        "comment_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Comment Id"
        },
        "author_display_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Author Display Name"
        },
        "author_channel_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Author Channel Url"
        },
        "author_profile_image_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Author Profile Image Url"
        },
        "text_display": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Text Display"
        },
        "text_original": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Text Original"
        },
        "like_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Like Count"
        },
        "published_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Published At"
        },
        "updated_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Updated At"
        },
        "reply_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Reply Count"
        }
      },
      "title": "CommentItem",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "properties": {
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Error"
    },
    "items": {
      "items": {
        "$ref": "#/$defs/CommentItem"
      },
      "title": "Items",
      "type": "array"
    },
    "total_results": {
      "default": 0,
      "title": "Total Results",
      "type": "integer"
    },
    "next_page_token": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Next Page Token"
    }
  },
  "required": [
    "success"
  ],
  "title": "CommentsOutput",
  "type": "object"
}

Limits & Quotas

  • Quota model: the YouTube Data API allocates a daily quota (10,000 units by default per project). search costs ~100 units per call; most read endpoints cost ~1 unit. Plan calls accordingly.
  • Result caps: list endpoints accept max_results up to 50 (up to 100 for comments). Use page_token / next_page_token to paginate.
  • Error model: the API returns HTTP 200 with an {"error": {...}} envelope on failure; these (and non-2xx responses and timeouts) are caught and returned as success=False + error rather than raising. Plan for retries on the agent side based on the error string.

Brandfetch

Gamma

Hacker News