> ## Documentation Index
> Fetch the complete documentation index at: https://api-tools.memories.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# YouTube Video Comment Reply

> Get the reply list for YouTube video comments.

<Info>
  **Product**: Visual Intelligence — Social Media Scraping
  **Use case**: Fetch video metadata, transcripts, captions, and comments from YouTube, Instagram, TikTok, and Twitter/X
  **Host**: `https://mavi-backend.memories.ai/serve/api/v2`
  **Auth**: `Authorization: sk-mavi-...` (no `Bearer` prefix)
</Info>

This API is used to get the reply list for YouTube video comments with pagination support.

<Note>
  Channel routing guide: see [Social Media Scraping Overview](/visual-intelligence/social-media-scraping-overview). Endpoints with a `channel` request field let you choose `apify`, `rapid`, or `memories.ai`; endpoints without this field use managed routing.
</Note>

<Note>
  Each API call costs **\$0.01 USD**.
</Note>

### Channel Options

If your request supports a `channel` option, use it to control how scraper data is sourced:

| Channel       | What it means                                                                                    | Typical trade-off                                                       |
| ------------- | ------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------- |
| `apify`       | Uses [Apify](https://apify.com/), a dedicated web scraping platform with broad content coverage. | Most stable and most complete results, but usually more expensive.      |
| `rapid`       | Uses [RapidAPI](https://rapidapi.com/), a lower-cost aggregation platform.                       | Lower cost, but less stable and often narrower coverage.                |
| `memories.ai` | Managed routing by Memories.ai.                                                                  | Automatically selects the best price/performance path for your request. |

<Note>
  Recommendation: Start with `memories.ai` unless you need to force a specific provider.
</Note>

<Warning>
  * The maximum value for pagination parameter `page_size` is **100**
  * `next_page_token` should be **null** for the first request, use the `next_page_token` returned from the previous response for subsequent requests
  * When `next_page_token` in the response is `null`, it indicates all replies have been retrieved
</Warning>

### Code Example

<CodeGroup>
  ```python Python theme={null}
  import requests

  BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2"
  API_KEY = "sk-mavi-..."
  HEADERS = {
      "Authorization": f"{API_KEY}",
      "Content-Type": "application/json"
  }

  def youtube_video_comment_reply(comment_id: str):
      url = f"{BASE_URL}/youtube/video/comment/reply"
      page_size = 100
      next_page_token = None
      all_replies = []
      while True:
          data = {"comment_id": comment_id, "page_size": page_size, "next_page_token": next_page_token}
          resp = requests.post(url, json=data, headers=HEADERS).json()
          replies = resp.get("items", [])
          all_replies.extend(replies)
          next_page_token = resp.get("next_page_token")
          if not next_page_token:
              break
      return all_replies

  # Usage example
  replies = youtube_video_comment_reply("comment_id")
  print(replies)
  ```

  ```javascript JavaScript theme={null}
  const axios = require('axios');

  const BASE_URL = 'https://mavi-backend.memories.ai/serve/api/v2';
  const API_KEY = 'sk-mavi-...';

  const headers = {
      'Authorization': API_KEY,
      'Content-Type': 'application/json'
  };

  async function youtubeVideoCommentReply(commentId) {
      const response = await axios.post(
          `${BASE_URL}/youtube/video/comment/reply`,
          { comment_id: commentId, page_size: 100, next_page_token: null },
          { headers }
      );
      return response.data;
  }

  // Usage example
  youtubeVideoCommentReply('comment_id')
      .then(result => console.log(result));
  ```

  ```bash cURL theme={null}
  curl -X POST "https://mavi-backend.memories.ai/serve/api/v2/youtube/video/comment/reply" \
    -H "Authorization: sk-mavi-..." \
    -H "Content-Type: application/json" \
    -d '{
      "comment_id": "comment_id",
      "page_size": 100,
      "next_page_token": null
    }'
  ```
</CodeGroup>

### Request Body

| Field             | Type           | Required | Description                                                                                                                      |
| ----------------- | -------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |
| comment\_id       | string         | Yes      | Comment ID (obtained from the [YouTube Video Comment](/visual-intelligence/scraper/youtube-video-comment) response)              |
| page\_size        | number         | No       | Number of replies returned per page, maximum value is 100, default is 100                                                        |
| next\_page\_token | string \| null | No       | Next page token, should be null for the first request, use the value returned from the previous response for subsequent requests |

### Response

Returns an object containing the reply list and pagination information.

<ResponseExample>
  ```json theme={null}
  {
    "items": [
      {
        "id": "reply_id_1",
        "text": "Reply content",
        "published_at": "2024-01-01T00:00:00Z",
        "like_count": 5,
        "author": {
          "id": "user_id",
          "name": "username",
          "channel_url": "https://..."
        }
      },
      {
        "id": "reply_id_2",
        "text": "Another reply",
        "published_at": "2024-01-02T00:00:00Z",
        "like_count": 3,
        "author": {
          "id": "user_id_2",
          "name": "username2",
          "channel_url": "https://..."
        }
      }
    ],
    "next_page_token": "CAoQAA",
    "page_info": {
      "total_results": 50,
      "results_per_page": 100
    }
  }
  ```
</ResponseExample>

### Response Parameters

| Parameter                     | Type           | Description                                                                                    |
| ----------------------------- | -------------- | ---------------------------------------------------------------------------------------------- |
| items                         | array\[object] | Reply list array                                                                               |
| items\[].id                   | string         | Reply ID                                                                                       |
| items\[].text                 | string         | Reply content                                                                                  |
| items\[].published\_at        | string         | Reply published time (ISO 8601 format)                                                         |
| items\[].like\_count          | number         | Like count                                                                                     |
| items\[].author               | object         | Reply author information                                                                       |
| items\[].author.id            | string         | Author ID                                                                                      |
| items\[].author.name          | string         | Author username                                                                                |
| items\[].author.channel\_url  | string         | Author channel URL                                                                             |
| next\_page\_token             | string \| null | Next page token, used to get the next page of data, null indicates all data has been retrieved |
| page\_info                    | object         | Pagination information                                                                         |
| page\_info.total\_results     | number         | Total number of replies                                                                        |
| page\_info.results\_per\_page | number         | Number of results per page                                                                     |


## OpenAPI

````yaml POST /youtube/video/comment/reply
openapi: 3.1.0
info:
  title: Scraper API Reference
  description: REST APIs for scraping TikTok and YouTube video data
  version: v1.0.0
servers:
  - url: https://mavi-backend.memories.ai/serve/api/v2
security:
  - ApiKeyAuth: []
paths:
  /youtube/video/comment/reply:
    post:
      summary: YouTube Video Comment Reply
      description: >-
        Get the reply list for YouTube video comments. Each API call costs $0.01
        USD. The maximum value for pagination parameter pageSize is 100,
        nextPageToken should be null for the first request.
      operationId: youtube_video_comment_reply
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                comment_id:
                  type: string
                  description: Comment ID
                  example: comment_id
                page_size:
                  type: integer
                  description: >-
                    Number of replies returned per page, maximum value is 100,
                    default is 100
                  example: 100
                  maximum: 100
                  default: 100
                next_page_token:
                  type: string
                  nullable: true
                  description: >-
                    Next page token, should be null for the first request, use
                    the value returned from the previous response for subsequent
                    requests
                  example: null
              required:
                - comment_id
      responses:
        '200':
          description: Successfully returned reply list
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    description: Reply list array
                    items:
                      type: object
                  next_page_token:
                    type: string
                    nullable: true
                    description: >-
                      Next page token, used to get the next page of data, null
                      indicates all data has been retrieved
                  page_info:
                    type: object
                    description: Pagination information
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````