YouTube VideoStats

YouTube VideoStats

Certified

Get statistics for YouTube videos

Retrieve detailed statistics for one or more YouTube videos including views, likes, and comments

yaml
type: io.kestra.plugin.youtube.VideoStats

Get statistics for multiple videos

yaml
id: get_video_stats
namespace: company.team

tasks:
  - id: authenticate
    type: io.kestra.plugin.youtube.OAuth2
    clientId: "{{ secret('YOUTUBE_CLIENT_ID') }}"
    clientSecret: "{{ secret('YOUTUBE_CLIENT_SECRET') }}"
    refreshToken: "{{ secret('YOUTUBE_REFRESH_TOKEN') }}"

  - id: get_stats
    type: io.kestra.plugin.youtube.VideoStats
    accessToken: "{{ outputs.authenticate.accessToken }}"
    videoIds:
      - "dQw4w9WgXcQ"
      - "9bZkp7q19f0"
    includeSnippet: true
Properties

Access token

OAuth2 bearer token used for YouTube Data API calls

SubTypestring

Video IDs

List of YouTube video IDs to retrieve statistics for

Defaultkestra-yt-plugin

Application name

Application name sent with YouTube requests; defaults to kestra-yt-plugin

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
Defaultfalse

Include content details

Whether to include channels content details

Defaultfalse

Include snippet data

Whether to include video snippet data (title, description, thumbnail, etc.) in addition to statistics

Default5

Maximum results per video

Maximum number of items that should be returned in the result set – acceptable values are 1 to 50, inclusive.

Total comments across all videos

Total likes across all videos

Total number of videos processed

Total views across all videos

Video statistics data

Definitions
channelIdstring
channelTitlestring
commentCountinteger
definitionstring
descriptionstring
dimensionstring
dislikeCountinteger
durationstring
favoriteCountinteger
likeCountinteger
publishedAtstring
thumbnailUrlstring
titlestring
videoIdstring
viewCountinteger