Skip to main content
POST
/
tiktok
/
video
/
comment
TikTok Video Comment
curl --request POST \
  --url https://mavi-backend.memories.ai/serve/api/v2/tiktok/video/comment \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "video_id": "7543017294226558221",
  "page_size": 50,
  "cursor": 0
}
'
[
  {
    "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
  }
]
This API is used to get the comment list for TikTok videos with pagination support.
Channel routing guide: see 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.
Each API call costs $0.01 USD.

Channel Options

If your request supports a channel option, use it to control how scraper data is sourced:
ChannelWhat it meansTypical trade-off
apifyUses Apify, a dedicated web scraping platform with broad content coverage.Most stable and most complete results, but usually more expensive.
rapidUses RapidAPI, a lower-cost aggregation platform.Lower cost, but less stable and often narrower coverage.
memories.aiManaged routing by Memories.ai.Automatically selects the best price/performance path for your request.
Recommendation: Start with memories.ai unless you need to force a specific provider.
  • 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

Code Example

import requests

BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2"
API_KEY = "sk-mai-this_a_test_string_please_use_your_generated_key_during_testing"
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)

Request Body

FieldTypeRequiredDescription
video_idstringYesTikTok video ID (the numeric ID at the end of a TikTok URL, e.g., 7543017294226558221)
page_sizenumberNoNumber of comments returned per page, maximum value is 50, default is 50
cursornumberNoPagination cursor, starts from 0, default is 0

Response

Returns an array of comment list.
[
  {
    "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
  }
]

Response Parameters

ParameterTypeDescription
[].cidstringComment ID
[].textstringComment content
[].create_timenumberComment creation timestamp
[].like_countnumberLike count
[].authorobjectComment author information
[].author.idstringAuthor ID
[].author.namestringAuthor username
[].author.nick_namestringAuthor display name
[].reply_countnumberReply count

Authorizations

Authorization
string
header
required

Body

application/json
video_id
string
required

TikTok video ID

Example:

"7543017294226558221"

page_size
integer
default:50

Number of comments returned per page, maximum value is 50, default is 50

Required range: x <= 50
Example:

50

cursor
integer
default:0

Pagination cursor, starts from 0, default is 0

Required range: x >= 0
Example:

0

Response

200 - application/json

Successfully returned comment list

cid
string

Comment ID

text
string

Comment content

create_time
integer

Comment creation timestamp

like_count
integer

Like count

author
object

Comment author information

reply_count
integer

Reply count