> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrapeunblocker.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Scrape a YouTube video's comments

> Returns a YouTube video's comments as JSON. For each comment: `commentId`, `author`, `authorChannelId`, `authorThumbnail`, `text`, `likeCount`, `publishedTimeText`, `replyCount`, and the `isPinned`, `isHearted`, `isAuthorVerified` and `isUploader` flags, plus the video `title` and total `commentCount`. Sort by `top` or `newest` and collect up to `max_results` across pages.



## OpenAPI

````yaml /api-reference/openapi.json post /content/youtube-comments
openapi: 3.1.0
info:
  title: ScrapeUnblocker API
  description: >-
    Public API for the ScrapeUnblocker proxy/anti-bot service. Authenticate
    every request with the `x-scrapeunblocker-key` header. Three endpoints are
    documented here: page-source extraction, Google SERP scraping, and image
    fetch. All other paths exist for internal operations and are intentionally
    hidden from this spec.
  version: 3.0.0
servers:
  - url: https://api.scrapeunblocker.com
    description: Production
security: []
paths:
  /content/youtube-comments:
    post:
      tags:
        - Plugins
      summary: Scrape a YouTube video's comments
      description: >-
        Returns a YouTube video's comments as JSON. For each comment:
        `commentId`, `author`, `authorChannelId`, `authorThumbnail`, `text`,
        `likeCount`, `publishedTimeText`, `replyCount`, and the `isPinned`,
        `isHearted`, `isAuthorVerified` and `isUploader` flags, plus the video
        `title` and total `commentCount`. Sort by `top` or `newest` and collect
        up to `max_results` across pages.
      operationId: youtube_comments_content_youtube_comments_post
      parameters:
        - name: video
          in: query
          required: true
          schema:
            type: string
            description: Video id (dQw4w9WgXcQ) or any YouTube video URL.
            title: Video
          description: Video id (dQw4w9WgXcQ) or any YouTube video URL.
        - name: sort
          in: query
          required: false
          schema:
            type: string
            description: 'Comment order: top, newest.'
            default: top
            title: Sort
          description: 'Comment order: top, newest.'
        - name: max_results
          in: query
          required: false
          schema:
            type: integer
            maximum: 2000
            minimum: 1
            description: How many comments to collect across pages (~20 per page).
            default: 20
            title: Max Results
          description: How many comments to collect across pages (~20 per page).
        - name: proxy_country
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Exit-IP country (ISO-2) for the watch page. Default US.
            title: Proxy Country
          description: Exit-IP country (ISO-2) for the watch page. Default US.
      responses:
        '200':
          description: JSON with a `comments` array plus counts.
          content:
            application/json:
              schema: {}
        '400':
          description: Invalid parameters.
        '404':
          description: Comments are disabled on this video.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '502':
          description: Blocked by YouTube or comments could not be fetched.
        '504':
          description: Fetch timed out.
      security:
        - ScrapeUnblockerKey: []
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ScrapeUnblockerKey:
      type: apiKey
      in: header
      name: x-scrapeunblocker-key
      description: Your ScrapeUnblocker API key. Apply on every request.

````