New to Kestra?
Use blueprints to kickstart your first workflows.
Snapshot YouTube video stats to JSONL with Kestra. Fetch views and likes, reshape rows with Python, and stage a warehouse-ready file daily.
The YouTube API tells you where a video stands right now; it does not keep history for you. This blueprint builds that history: io.kestra.plugin.youtube.VideoStats snapshots view, like, and comment counts for a tracked catalog, a small Python step reshapes the per-video array into snake_case JSONL rows stamped with the capture time, and the file lands in Kestra's internal storage ready for any warehouse loader. Run it daily and you get the time series YouTube Studio never exports.
fetch_stats (io.kestra.plugin.youtube.VideoStats) pulls statistics and snippet metadata for every video in the video_ids input, outputting a videos array plus aggregate totals.reshape_to_jsonl (io.kestra.plugin.scripts.python.Script on the Process task runner, no container required) receives the array through inputFiles rendered with toJson, flattens each video into a snake_case row, stamps every row with a UTC captured_at, and declares videos.jsonl as an output file.notify posts the aggregate scalars to Discord; the JSONL extract stays attached to the execution.errors block posts a distinct Discord alert on failure, protecting the continuity of the time series.Schedule trigger captures one snapshot every day at 05:00.A snapshot pipeline is only as good as its regularity, one missed day is a permanent hole in the series. Kestra provides the schedule, retries, a durable file per run in internal storage, execution history to audit exactly what was captured when, and an alert the morning a token expires instead of a gap discovered weeks later.
YOUTUBE_ACCESS_TOKEN: OAuth2 bearer token for the YouTube Data API.DISCORD_WEBHOOK_URL: Discord incoming webhook URL.video_ids with your tracked catalog.videos.jsonl from the execution's Outputs tab to inspect the rows.disabled: false on the daily trigger.io.kestra.plugin.jdbc.duckdb.Query reading the output file URI, following the pattern in the dlt REST API to DuckDB blueprint.includeContentDetails: true and extend the Python rows with duration and definition.