YouTube Comments API
The YouTube Comments API lets a product list YouTube comments, reply to YouTube comment threads, create a top-level comment, and delete YouTube comment entries through one shared comments endpoint.
curl -X GET "{{API_BASE_URL}}/v1/comments/?platform=youtube&accountId=acc_yt_123&postId=VIDEO_ID&limit=25" \
-H "x-access-key: your-api-key"curl -X GET "{{API_BASE_URL}}/v1/comments/?platform=youtube&accountId=acc_yt_123&postId=VIDEO_ID&limit=25" \
-H "x-access-key: your-api-key"
It is designed for SaaS products, agency workflows, and automations that need to read comments, respond as the connected channel, and moderate a video without building a separate YouTube integration for each action.
What the YouTube Comments API does
Use this API when your workflow starts from a video and needs the full comment lifecycle in one place. Listing is the right first step when you need to show a thread, triage questions, or find the commentId you will later reply to or delete. Creating a top-level comment fits announcements or pinned follow-ups on a video. Replying fits conversation, where the parent commentId determines placement. Deleting fits moderation, where a single commentId identifies the entry to remove. Keeping all four actions on the same endpoint simplifies routing, authentication, and error handling in your product.
Contract at a glance
The contract uses three operations on the comments resource. Listing uses GET /v1/comments/ with platform=youtube, accountId for the connected channel, postId for the YouTube video ID, and limit for page size; the captured list example shows status 202. Creating or replying uses POST /v1/comments/, switching between postId for a top-level comment and commentId for a reply to an existing comment. Deleting uses DELETE /v1/comments/{commentId}. The list example in the request and response examples below shows the captured field structure for listing. For create, reply, and delete, only the method, path, and the postId or commentId distinction stated above are treated as captured contract; request and response bodies beyond that were not captured.
List comments and replies
To list YouTube comments, send a GET request with platform set to youtube, accountId set to the connected account, postId set to the YouTube video ID, and limit set to the number of comments you want in the page. The response contains success, a comments array, and nextCursor for pagination. Each comment contains id, text, author with id and name, timestamp, likeCount, hidden, and replies. Use author and timestamp to render the thread, likeCount for sorting or prioritization, and replies to render nested conversation. The captured example returns nextCursor alongside the comments; the source does not capture the request parameter name used to pass that cursor back, so confirm that parameter from the reference before implementing continuation.
Create a top-level comment or reply to a comment
Use POST /v1/comments/ for both creating and replying. Supply postId with the video ID when you want a new top-level comment on the video. Supply commentId with the parent comment ID when you want to reply to an existing comment. Reply text posts as the connected channel, so verify accountId before sending so the reply appears from the intended channel. Each call that creates a comment or a reply uses 1 credit, so batch or queue replies where your workflow allows it. The exact request body fields for this operation were not captured in the source example, so do not treat any body shape as confirmed contract until it is verified against the reference.
Delete a comment
Use DELETE /v1/comments/{commentId} to delete YouTube comment entries by comment ID. This is the moderation path for spam or abuse: list first to confirm the exact commentId, then delete that single comment. Listing and deleting follow standard API usage for credits, unlike create and reply calls which use 1 credit each. The delete response body and status were not captured, so handle the result based on verified reference behavior rather than an assumed shape.
Limitations and failure checks
Hide and unhide are not available for YouTube through this API, so do not design a moderation queue around a hide action for YouTube comments. YouTube access tokens expire hourly, and token refresh and rotation are handled on every call so comment workflows do not need separate refresh logic in your code. Comments can be read and moderated on any video on the connected channel, not only videos published through this API. No Google Cloud setup is required on your side because the YouTube OAuth flow requests the youtube.force-ssl scope that comments require.
Failure checks before you ship
Before listing, confirm that accountId belongs to a connected YouTube channel and that postId is a valid video ID for that channel; a wrong postId may return an empty or unhelpful thread even if the request succeeds. Before replying, confirm commentId came from a recent list response for the same video, and treat stale or already-removed identifiers as a risk to verify in testing rather than a guaranteed outcome. Before deleting, confirm commentId is the exact entry you intend to remove, since this contract describes deletion as a single call. If a workflow breaks mid-session, check token refresh handling and reconnect the channel rather than retrying with a new Google Cloud project. These checks are editorial guidance derived from the contract, not additional captured behavior.
| Operation | Method and path | Key inputs | Use when |
|---|---|---|---|
| List comments | GET /v1/comments/ | platform=youtube, accountId, postId (video ID), limit; captured status 202 | Reading a thread or finding a commentId |
| Create comment | POST /v1/comments/ | postId (video ID); body not captured | Posting a top-level comment on a video |
| Reply to comment | POST /v1/comments/ | commentId (parent comment ID); body not captured | Replying to an existing comment as the connected channel |
| Delete comment | DELETE /v1/comments/{commentId} | commentId in path; response not captured | Removing spam or abusive comment |
Parity draft from captured contract; not a tested live call. List status 202 is from the captured example; other statuses were not captured.
| Field | Location | Meaning |
|---|---|---|
| platform | Query parameter | Set to youtube |
| accountId | Query parameter | Connected account identifier, e.g. acc_yt_123 |
| postId | Query parameter | YouTube video ID |
| limit | Query parameter | Page size, e.g. 25 |
| success | Response | Request success flag |
| comments | Response | Array of comment objects |
| comments[].id | Response | Comment identifier |
| comments[].text | Response | Comment text |
| comments[].author.id | Response | Author identifier |
| comments[].author.name | Response | Author display name |
| comments[].timestamp | Response | Comment timestamp |
| comments[].likeCount | Response | Like count for the comment |
| comments[].hidden | Response | Hidden value as returned, e.g. null |
| comments[].replies | Response | Nested replies array |
| nextCursor | Response | Pagination cursor returned with the page; request parameter name not captured |
Fields taken from captured list example; types not invented beyond evidence. Request parameter for passing nextCursor back was not captured.
| Situation | Expected behavior | Check |
|---|---|---|
| Hide or unhide a YouTube comment | Unsupported | Use delete instead; do not expose a hide action |
| Access token near hourly expiry | Refresh and rotation handled on every call | Reconnect channel if workflow still fails |
| Video not published through this API | Readable and moderatable if on connected channel | Confirm accountId matches the channel that owns the video |
| No Google Cloud project | OAuth flow requests youtube.force-ssl scope | Connect the channel; no separate Google Cloud setup |
Based on captured source statements; failure-check guidance is editorial, not captured behavior.
Frequently asked questions
What do I pass as the postId for YouTube?
Use the video identifier itself. When you call the listing operation for YouTube, supply that identifier through postId alongside the platform and connected-account values, and the returned thread will belong to that video.
Can I reply to and delete YouTube comments?
Both are supported. Sending to the comments collection with a parent commentId creates a reply, while sending a delete request to the comments collection with a commentId in the path removes that entry. Replies appear under the connected channel identity.
Can I hide or unhide YouTube comments?
That action is not offered for YouTube here. The available operations are reading a thread, adding a comment, responding within a thread, and removing an entry.
Do I need my own Google Cloud project or API key?
You do not need to set one up yourself. Channel connection goes through the YouTube OAuth flow, which asks for youtube.force-ssl, the permission comments need.
How much does the YouTube Comments API cost?
Adding a comment and adding a reply each consume 1 credit. Reading and removing comments are covered under standard API usage.
What can I build with the YouTube Comments API?
It suits creator-facing products, agency dashboards, and automated workflows that need to inspect viewer discussion, answer it from the channel, and tidy up individual entries through a single connected-account setup.
{
"success": true,
"comments": [
{
"id": "Ugx...AaABAg",
"text": "An example comment.",
"author": { "id": "UCabc123", "name": "Sam" },
"timestamp": "2026-10-05T14:22:10Z",
"likeCount": 3,
"hidden": null,
"replies": []
}
],
"nextCursor": "QURTSl9..."
}curl -X POST "{{API_BASE_URL}}/v1/comments/" \
-H "x-access-key: your-api-key"curl -X DELETE "{{API_BASE_URL}}/v1/comments/Ugx...AaABAg" \
-H "x-access-key: your-api-key"