YouTube Comments API

The Comments API from YouTube — 3 operation(s) for comments.

GitHub OpenAPI

Operations 6

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /youtube/v3/comments/markAsSpam Flag comments as spam · Mark as spam comments #
Ask an LLM
“How do I mark a comment as spam?”
“Can I flag several comments as spam at once?”
Tell an agent
Mark comments {ids} as spam.
Flag {ids} as spam.
POST /youtube/v3/comments Post a new comment on YouTube · Insert comments #
Ask an LLM
“How do I post a new comment through the YouTube Data API?”
“What do I need to send in the part parameter when creating a comment?”
Tell an agent
Post a new comment with snippet {snippet} using part {part}.
Create a comment from this snippet {snippet}, returning the {part} part in the response.
GET /youtube/v3/comments List a comment thread · List comments #
Ask an LLM
“Can I see the replies to a video comment?”
“Is it possible to list a single comment by ID?”
Tell an agent
List the replies to comment {parentId}.
Show comment {id}.
DELETE /youtube/v3/comments Delete a comment · Delete comments #
Ask an LLM
“How do I delete a comment?”
“Can I remove a spam comment from a video?”
Tell an agent destructive · confirm first
Delete comment {id}.
Remove the spam comment {id}.
PUT /youtube/v3/comments Edit a comment · Update comments #
Ask an LLM
“Can I change the text of a comment I posted?”
“Will updating a comment require a new ETag?”
Tell an agent
Update comment {id} with snippet {snippet}.
Edit the text of my comment {id} to {snippet}.
POST /youtube/v3/comments/setModerationStatus Set a comment's moderation status · Set moderation status comments #
Ask an LLM
“How do I approve a comment that's waiting for moderation?”
“Can I ban a comment author automatically?”
Tell an agent
Set moderation status {status} on comments {ids}.
Ban author of comments {ids} by setting status {status}.

Documentation

📖
Documentation
https://developers.google.com/youtube/v3/docs/activities/list
📖
GettingStarted
https://developers.google.com/youtube/v3/getting-started
📖
Authentication
https://developers.google.com/youtube/v3/guides/authentication
📖
Documentation
https://developers.google.com/youtube/v3/docs/channels/list
📖
Documentation
https://developers.google.com/youtube/v3/docs/comments/list
📖
Documentation
https://developers.google.com/youtube/v3/docs/commentThreads/list
📖
Documentation
https://developers.google.com/youtube/v3/docs/playlists/list
📖
Documentation
https://developers.google.com/youtube/v3/docs/playlistItems/list
📖
Documentation
https://developers.google.com/youtube/v3/docs/search/list
📖
Documentation
https://developers.google.com/youtube/v3/docs/subscriptions/list
📖
Documentation
https://developers.google.com/youtube/v3/docs/videos/list
📖
Documentation
https://developers.google.com/youtube/v3/docs/captions
📖
Documentation
https://developers.google.com/youtube/v3/docs/videoCategories
📖
Documentation
https://developers.google.com/youtube/v3/docs/i18nLanguages
📖
Documentation
https://developers.google.com/youtube/v3/docs/i18nRegions
📖
Documentation
https://developers.google.com/youtube/analytics
📖
GettingStarted
https://developers.google.com/youtube/reporting/guides/authorization
📖
APIReference
https://developers.google.com/youtube/analytics/reference
📖
Authentication
https://developers.google.com/youtube/reporting/guides/authorization
📖
Documentation
https://developers.google.com/youtube/reporting
📖
APIReference
https://developers.google.com/youtube/reporting/v1/reference/rest
📖
Documentation
https://developers.google.com/youtube/reporting/v1/reports
📖
GettingStarted
https://developers.google.com/youtube/v3/live/getting-started
📖
Documentation
https://developers.google.com/youtube/v3/live/docs
📖
APIReference
https://developers.google.com/youtube/v3/live/docs

Specifications

Code Examples

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/youtube:youtube-comments-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

youtube-comments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: YouTube Data API v3 Comments API
  version: v3
  description: Generated from Google's published Discovery document for YouTube Data API v3 (youtube v3, revision 20261111). 6 operation(s).
  contact:
    name: Google
    url: https://developers.google.com/
  termsOfService: https://developers.google.com/terms
servers:
- url: https://youtube.googleapis.com
tags:
- name: Comments
paths:
  /youtube/v3/comments/markAsSpam:
    post:
      operationId: youtube.comments.markAsSpam
      summary: Mark as spam comments
      description: Expresses the caller's opinion that one or more comments should be flagged as spam.
      parameters:
      - name: id
        in: query
        required: true
        description: Flags the comments with the given IDs as spam in the caller's opinion.
        schema:
          type: array
          items:
            type: string
      responses:
        '200':
          description: Successful response
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/youtube.force-ssl
      - apiKey: []
      tags:
      - Comments
  /youtube/v3/comments:
    post:
      operationId: youtube.comments.insert
      summary: Insert comments
      description: Inserts a new resource into this collection.
      parameters:
      - name: part
        in: query
        required: true
        description: The *part* parameter identifies the properties that the API response will include. Set the parameter value to snippet. The snippet part has a quota cost of 2 units.
        schema:
          type: array
          items:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Comment'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Comment'
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/youtube.force-ssl
      - apiKey: []
      tags:
      - Comments
    get:
      operationId: youtube.comments.list
      summary: List comments
      description: Retrieves a list of resources, possibly filtered.
      parameters:
      - name: id
        in: query
        required: false
        description: Returns the comments with the given IDs for One Platform.
        schema:
          type: array
          items:
            type: string
      - name: maxResults
        in: query
        required: false
        description: The *maxResults* parameter specifies the maximum number of items that should be returned in the result set.
        schema:
          minimum: 1
          default: '20'
          format: uint32
          type: integer
          maximum: 100
      - name: pageToken
        in: query
        required: false
        description: The *pageToken* parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.
        schema:
          type: string
      - name: parentId
        in: query
        required: false
        description: Returns replies to the specified comment. Note, currently YouTube features only one level of replies (ie replies to top level comments). However replies to replies may be supported in the future.
        schema:
          type: string
      - name: part
        in: query
        required: true
        description: The *part* parameter specifies a comma-separated list of one or more comment resource properties that the API response will include.
        schema:
          type: array
          items:
            type: string
      - name: textFormat
        in: query
        required: false
        description: The requested text format for the returned comments.
        schema:
          enum:
          - textFormatUnspecified
          - html
          - plainText
          default: html
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommentListResponse'
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/youtube.force-ssl
      - apiKey: []
      tags:
      - Comments
    delete:
      operationId: youtube.comments.delete
      summary: Delete comments
      description: Deletes a resource.
      parameters:
      - name: id
        in: query
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/youtube.force-ssl
      - apiKey: []
      tags:
      - Comments
    put:
      operationId: youtube.comments.update
      summary: Update comments
      description: Updates an existing resource.
      parameters:
      - name: part
        in: query
        required: true
        description: The *part* parameter identifies the properties that the API response will include. You must at least include the snippet part in the parameter value since that part contains all of the properties that the API request can update.
        schema:
          type: array
          items:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Comment'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Comment'
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/youtube.force-ssl
      - apiKey: []
      tags:
      - Comments
  /youtube/v3/comments/setModerationStatus:
    post:
      operationId: youtube.comments.setModerationStatus
      summary: Set moderation status comments
      description: Sets the moderation status of one or more comments.
      parameters:
      - name: banAuthor
        in: query
        required: false
        description: If set to true the author of the comment gets added to the ban list. This means all future comments of the author will autmomatically be rejected. Only valid in combination with STATUS_REJECTED.
        schema:
          default: 'false'
          type: boolean
      - name: id
        in: query
        required: true
        description: Modifies the moderation status of the comments with the given IDs
        schema:
          type: array
          items:
            type: string
      - name: moderationStatus
        in: query
        required: true
        description: 'Specifies the requested moderation status. Note, comments can be in statuses, which are not available through this call. For example, this call does not allow to mark a comment as ''likely spam''. Valid values: ''heldForReview'', ''published'' or ''rejected''.'
        schema:
          enum:
          - published
          - heldForReview
          - likelySpam
          - rejected
          type: string
      responses:
        '200':
          description: Successful response
        4XX:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: 'Client error (google.rpc.Status: INVALID_ARGUMENT, PERMISSION_DENIED, NOT_FOUND ...)'
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GoogleRpcError'
          description: Error response (google.rpc.Status)
      security:
      - oauth2:
        - https://www.googleapis.com/auth/youtube.force-ssl
      - apiKey: []
      tags:
      - Comments
components:
  schemas:
    GoogleRpcError:
      type: object
      description: The error envelope every Google API returns.
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
            status:
              type: string
            details:
              type: array
              items:
                type: object
    PageInfo:
      description: Paging details for lists of resources, including total number of items available and number of resources returned in a single page.
      properties:
        resultsPerPage:
          format: int32
          description: The number of results included in the API response.
          type: integer
        totalResults:
          description: The total number of results in the result set.
          type: integer
          format: int32
      type: object
    CommentSnippetAuthorChannelId:
      properties:
        value:
          type: string
          description: The id of the author's YouTube channel.
      type: object
      description: Contains the id of the author's YouTube channel, if any.
    CommentListResponse:
      properties:
        nextPageToken:
          description: The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set.
          type: string
        kind:
          type: string
          description: 'Identifies what kind of resource this is. Value: the fixed string "youtube#commentListResponse".'
          default: youtube#commentListResponse
        etag:
          description: Etag of this resource.
          type: string
        tokenPagination:
          $ref: '#/components/schemas/TokenPagination'
        visitorId:
          type: string
          description: The visitorId identifies the visitor.
          deprecated: true
        pageInfo:
          $ref: '#/components/schemas/PageInfo'
          description: General pagination information.
        items:
          items:
            $ref: '#/components/schemas/Comment'
          description: A list of comments that match the request criteria.
          type: array
        eventId:
          type: string
          description: Serialized EventId of the request which produced this response.
          deprecated: true
      type: object
    Comment:
      properties:
        snippet:
          $ref: '#/components/schemas/CommentSnippet'
          description: The snippet object contains basic details about the comment.
        id:
          description: The ID that YouTube uses to uniquely identify the comment.
          type: string
        kind:
          default: youtube#comment
          description: 'Identifies what kind of resource this is. Value: the fixed string "youtube#comment".'
          type: string
        etag:
          type: string
          description: Etag of this resource.
      description: A *comment* represents a single YouTube comment.
      type: object
    TokenPagination:
      properties: {}
      description: Stub token pagination template to suppress results.
      type: object
    CommentSnippet:
      properties:
        channelId:
          description: The id of the corresponding YouTube channel. In case of a channel comment this is the channel the comment refers to. In case of a video or post comment it's the video/post's channel.
          type: string
        canRate:
          type: boolean
          description: Whether the current viewer can rate this comment.
        parentId:
          description: The unique id of the top-level comment, only set for replies.
          type: string
        authorDisplayName:
          description: The name of the user who posted the comment.
          type: string
        authorProfileImageUrl:
          description: The URL for the avatar of the user who posted the comment.
          type: string
        textOriginal:
          type: string
          description: The comment's original raw text as initially posted or last updated. The original text will only be returned if it is accessible to the viewer, which is only guaranteed if the viewer is the comment's author.
        authorChannelUrl:
          description: Link to the author's YouTube channel, if any.
          type: string
        likeCount:
          type: integer
          format: uint32
          description: The total number of likes this comment has received.
        moderationStatus:
          enum:
          - published
          - heldForReview
          - likelySpam
          - rejected
          description: The comment's moderation status. Will not be set if the comments were requested through the id filter.
          type: string
        textDisplay:
          description: The comment's text. The format is either plain text or HTML dependent on what has been requested. Even the plain text representation may differ from the text originally posted in that it may replace video links with video titles etc.
          type: string
        authorChannelId:
          $ref: '#/components/schemas/CommentSnippetAuthorChannelId'
        publishedAt:
          format: date-time
          type: string
          description: The date and time when the comment was originally published.
        updatedAt:
          format: date-time
          description: The date and time when the comment was last updated.
          type: string
        videoId:
          description: The ID of the video the comment refers to, if any.
          type: string
        imageUrl:
          type: string
          readOnly: true
          description: Output only. The URL of the image or animated GIF attached to the comment, if any. This property is only present when a comment contains an image or GIF. The URL is served as a signed link with a six-hour time to live (TTL) and expires six hours after retrieval.
        viewerRating:
          type: string
          description: The rating the viewer has given to this comment. For the time being this will never return RATE_TYPE_DISLIKE and instead return RATE_TYPE_NONE. This may change in the future.
          enum:
          - none
          - like
          - dislike
      description: Basic details about a comment, such as its author and text.
      type: object
  securitySchemes:
    apiKey:
      type: apiKey
      in: query
      name: key
      description: API key; accepted by methods that do not need user data.
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://accounts.google.com/o/oauth2/auth
          tokenUrl: https://oauth2.googleapis.com/token
          scopes:
            https://www.googleapis.com/auth/youtube: Manage your YouTube account
            https://www.googleapis.com/auth/youtubepartner: View and manage your assets and associated content on YouTube
            https://www.googleapis.com/auth/youtube.channel-memberships.creator: See a list of your current active channel members, their current level, and when they became a member
            https://www.googleapis.com/auth/youtubepartner-channel-audit: View private information of your YouTube channel relevant during the audit process with a YouTube partner
            https://www.googleapis.com/auth/youtube.force-ssl: See, edit, and permanently delete your YouTube videos, ratings, comments and captions
            https://www.googleapis.com/auth/youtube.readonly: View your YouTube account
            https://www.googleapis.com/auth/youtube.upload: Manage your YouTube videos
externalDocs:
  url: https://developers.google.com/youtube/
x-provenance:
  method: harvested
  publisher: Google
  source: https://youtube.googleapis.com/$discovery/rest?version=v3
  note: converted by discovery-to-openapi.py from Google's Discovery document (revision 20261111)