TikTok API
Video Comments
Get comments for a TikTok video with pagination.
POST
$0.01/call/v1/tiktok/commentsUsage
const res = await fetch('https://api.yepapi.com/v1/tiktok/comments', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ url: 'https://www.tiktok.com/@username/video/7356291048572839174' }),
});
const { data } = await res.json();
console.log(data);curl -X POST https://api.yepapi.com/v1/tiktok/comments \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://www.tiktok.com/@username/video/7356291048572839174"}'Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
url | string | Yes | Full TikTok video URL | — |
cursor | string | No | Pagination cursor from previous response | — |
count | number | No | Number of results to return | 20 |
Response
{
"ok": true,
"data": {
"has_more": true,
"cursor": "20",
"total_comments": 3200,
"comments": [
{
"comment_id": "7356291048572839175",
"text": "This recipe is amazing! Made it last night",
"create_time": 1712346000,
"digg_count": 4500,
"reply_count": 12,
"author": {
"unique_id": "foodlover99",
"nickname": "Food Lover",
"avatar": "https://p16-sign.tiktokcdn.com/..."
}
},
{
"comment_id": "7356291048572839176",
"text": "What type of pasta did you use?",
"create_time": 1712347000,
"digg_count": 890,
"reply_count": 3,
"author": {
"unique_id": "homecook_mike",
"nickname": "Mike Cooks",
"avatar": "https://p16-sign.tiktokcdn.com/..."
}
}
]
}
}Response Fields
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded |
data.has_more | boolean | Whether more comments are available |
data.cursor | string | Cursor for fetching the next page |
data.total_comments | number | Total number of comments on the video |
data.comments | object[] | Array of comment objects |
data.comments[].comment_id | string | Unique comment identifier |
data.comments[].text | string | Comment text content |
data.comments[].create_time | number | Unix timestamp of when the comment was posted |
data.comments[].digg_count | number | Number of likes on the comment |
data.comments[].reply_count | number | Number of replies to the comment |
data.comments[].author | object | Comment author information |
Use the cursor value from the response to paginate through comments.