automations / GitHub Actions · updated 2026-07-20

YouTube comments batch (GitHub Actions)

One video's comments fetched from a manual GitHub Actions run: dispatch with a URL or 11-character ID, get the dataset as an artifact plus a delivered-vs-failed job summary. A video with comments disabled is a typed $0 row, not a failed job.

200 comments cost $0.08; a video with comments off costs $0.

What's inside

  1. 1.Fetch the comments (curl → run-sync-get-dataset-items; dispatch inputs for the video and maxComments)
  2. 2.Summarize delivered vs failed (job summary line)
  3. 3.Upload the dataset (actions/upload-artifact — comments.json)

Set it up

Copy the file from GitHub (button above) into your repository's .github/workflows/ directory, then add an APIFY_TOKEN repository secret (Settings → Secrets and variables → Actions). Copy the file into .github/workflows/, add an APIFY_TOKEN repository secret, then dispatch it from the Actions tab with a video URL or 11-character ID. The token comes from Apify Console → Settings → API tokens; the free tier works, and the run bills per delivered row on your Apify account.

Ways to extend it

  • Flip includeReplies to true in the jq input to capture reply threads.
  • Run a matrix over a checked-in list of video IDs for a channel-wide comments pull.
  • Add a sentiment job that consumes the artifact and posts the verdict back to the job summary.

Going deeper: the error-code reference — every code a failure row can carry. Actor pricing: what a YouTube Comments Scraper run costs. Error codes the failure branch can carry: the error-code reference.