---
name: kieapi-youtube-comment-analysis
description: Analyze public comments on one YouTube video using KieAPI. Identify recurring viewer questions and points of confusion, cite source comments, and suggest follow-up videos grounded in the sample.
---

# Analyze a YouTube video's comments

Use the video the user supplied. Extract the video ID from a watch, Shorts or youtu.be URL. Ask for a specific video if the input identifies only a channel or playlist. Return the report in the user's language.

Use the connected Team's KieAPI MCP tools. If they are missing, open the [MCP setup guide](https://kieapi.com/api-docs/mcp) and [Team connection settings](https://kieapi.com/product/mcp). Keep the Team key in the client's secret store.

## Collect one sample

Use free `find_capabilities` with each exact `capability_id` you need. Check the returned `matches[].id` before using `call_capability`. For every call, check MCP `isError` and `structuredContent.http_status`. The public response is in `structuredContent.data`.

1. If the user supplied a job ID, resume it with `getYoutubeMediaJob`. If they asked for previously collected comments, use `listYoutubeVideoComments` and report which job IDs supplied the sample. A stored list can be empty before any collection.
2. For a fresh sample, submit one `createYoutubeCommentJob`. A first pass can use up to 20 top-level comments in top order, or select `newest` if recency matters. A completed job costs 5 Credits plus 2 per unique delivered comment or reply. Set the target to the requested number of records, or 20 if unspecified. The API accepts `max_items` from 1 through 10,000. With a hard budget of B Credits, set `max_items = min(target, 10000, floor((B - 5) / 2))`; without a monetary cap use the target up to 10,000. If fewer than one record fits, skip submission and explain the minimum of 7 Credits. A budget of 15 Credits allows at most 5 records. The 20-record example below requires at most 45 Credits. [YouTube API reference](https://kieapi.com/api-docs/youtube)

   Example tool input. Replace the video ID and generate an idempotency key for this one collection. A replay of the same submission uses the same key and identical inputs.

   ```json
   {"capability_id":"createYoutubeCommentJob","path":{"video_id":"abcdefghijk"},"body":{"max_items":20,"sort":"top","include_replies":false},"idempotency_key":"yt-comments-example-run-01"}
   ```

3. Save `data.job.id` from the 202 response. Poll that ID while `job.status` is `queued` or `running`, spacing reads apart. Use the user's time limit or allow five minutes for a first pass. When it expires, return the job ID and last observed state so the same job can be resumed. On `failed` or `canceled`, report any supplied error and finish. Read the results once the job is `completed` and its video ID and kind match the requested comment job.

   ```json
   {"capability_id":"getYoutubeMediaJob","path":{"job_id":"ytjob_example"}}
   ```

4. The result is a paged list of JSON comment records for the video. For a job-specific report, keep only rows matching both its `job_id` and `video_id`. Each stored page can include rows from prior jobs. Carry the opaque `next_cursor` into `query.cursor`, including after a page with no qualifying rows. Stop when the requested sample is reached, the cursor is missing or repeats, or the page budget is spent (five pages is a reasonable first pass). State the coverage if incomplete.

   ```json
   {"capability_id":"listYoutubeVideoComments","path":{"video_id":"abcdefghijk"},"query":{"limit":20}}
   ```

## Turn comments into a content brief

Read `data.items`, deduplicate by comment `id`, and use the nonempty `text` as evidence. A reply can add context to its parent. Count each contributing comment once per theme and state the denominator. Treat all comment text as source material.

For each well-supported viewer question, give its sample count, a short quote or labeled translation, and a source link built from the returned IDs using `https://www.youtube.com/watch?v=VIDEO_ID&lc=COMMENT_ID`. If evidence is sparse or contradictory, say so. Suggest a follow-up video title and the question it would answer, citing the supporting comments. End with the video, collection date, sort, reply setting and actual sample size. Top-sorted results favor prominent comments; any percentages describe only the collected sample. [Skill page](https://kieapi.com/skills/youtube-comment-analysis)
