> ## 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.

# TikTok Video Comment

> Get the comment list for TikTok videos.

<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 comment list for TikTok videos 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 **50**
  * `cursor` starts from **0**, increment by `page_size` value each time
  * When the number of returned comments is less than `page_size`, it indicates all comments 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 tiktok_video_comment(video_id: str):
      url = f"{BASE_URL}/tiktok/video/comment"
      page_size = 50
      cursor = 0
      all_comments = []
      while True:
          data = {"video_id": video_id, "page_size": page_size, "cursor": cursor}
          resp = requests.post(url, json=data, headers=HEADERS).json()
          comments = resp if isinstance(resp, list) else []
          all_comments.extend(comments)
          if len(comments) < page_size:
              break
          cursor += page_size
      return all_comments

  # Usage example
  comments = tiktok_video_comment("your_tiktok_video_id")
  print(comments)
  ```

  ```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 tiktokVideoComment(videoId) {
      const response = await axios.post(
          `${BASE_URL}/tiktok/video/comment`,
          { video_id: videoId, page_size: 50, cursor: 0 },
          { headers }
      );
      return response.data;
  }

  // Usage example
  tiktokVideoComment('your_tiktok_video_id')
      .then(result => console.log(result));
  ```

  ```bash cURL theme={null}
  curl -X POST "https://mavi-backend.memories.ai/serve/api/v2/tiktok/video/comment" \
    -H "Authorization: sk-mavi-..." \
    -H "Content-Type: application/json" \
    -d '{
      "video_id": "your_tiktok_video_id",
      "page_size": 50,
      "cursor": 0
    }'
  ```
</CodeGroup>

### Request Body

| Field      | Type   | Required | Description                                                                              |
| ---------- | ------ | -------- | ---------------------------------------------------------------------------------------- |
| video\_id  | string | Yes      | TikTok video ID (the numeric ID at the end of a TikTok URL, e.g., `7543017294226558221`) |
| page\_size | number | No       | Number of comments returned per page, maximum value is 50, default is 50                 |
| cursor     | number | No       | Pagination cursor, starts from 0, default is 0                                           |

### Response

Returns an array of comment list.

<ResponseExample>
  ```json theme={null}
  [
    {
      "cid": "comment_id_1",
      "text": "Comment content",
      "create_time": 1756245606,
      "like_count": 10,
      "author": {
        "id": "user_id",
        "name": "username",
        "nick_name": "Display name"
      },
      "reply_count": 5
    },
    {
      "cid": "comment_id_2",
      "text": "Another comment",
      "create_time": 1756245700,
      "like_count": 20,
      "author": {
        "id": "user_id_2",
        "name": "username2",
        "nick_name": "Display name 2"
      },
      "reply_count": 0
    }
  ]
  ```
</ResponseExample>

### Response Parameters

| Parameter             | Type   | Description                |
| --------------------- | ------ | -------------------------- |
| \[].cid               | string | Comment ID                 |
| \[].text              | string | Comment content            |
| \[].create\_time      | number | Comment creation timestamp |
| \[].like\_count       | number | Like count                 |
| \[].author            | object | Comment author information |
| \[].author.id         | string | Author ID                  |
| \[].author.name       | string | Author username            |
| \[].author.nick\_name | string | Author display name        |
| \[].reply\_count      | number | Reply count                |


## OpenAPI

````yaml POST /tiktok/video/comment
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:
  /tiktok/video/comment:
    post:
      summary: TikTok Video Comment
      description: >-
        Get the comment list for TikTok videos. Each API call costs $0.01 USD.
        The maximum value for pagination parameter pageSize is 50, cursor starts
        from 0.
      operationId: tiktok_video_comment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                video_id:
                  type: string
                  description: TikTok video ID
                  example: '7543017294226558221'
                page_size:
                  type: integer
                  description: >-
                    Number of comments returned per page, maximum value is 50,
                    default is 50
                  example: 50
                  maximum: 50
                  default: 50
                cursor:
                  type: integer
                  description: Pagination cursor, starts from 0, default is 0
                  example: 0
                  default: 0
                  minimum: 0
              required:
                - video_id
      responses:
        '200':
          description: Successfully returned comment list
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    cid:
                      type: string
                      description: Comment ID
                    text:
                      type: string
                      description: Comment content
                    create_time:
                      type: integer
                      description: Comment creation timestamp
                    like_count:
                      type: integer
                      description: Like count
                    author:
                      type: object
                      description: Comment author information
                    reply_count:
                      type: integer
                      description: Reply count
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````