Skip to content

How to get TikTok comments and replies with an API

Updated · 2 steps

Comments are where audience sentiment, product questions and complaints show up first. These two calls return a public video's comments, then the replies under any comment, as JSON you can feed into sentiment analysis, moderation tools or a spreadsheet.

01

Get a video's comments

Pass the video URL. Each comment in comments has its id cid, text, create_time, like count digg_count, reply count reply_comment_total and the commenter in user. The response also has total.

While has_more is true, send the cursor from the response to get the next page.

GET /v1/tiktok/video/comments 1 credit per call

cURL

curl --request GET 'https://api.fetchproof.com/v1/tiktok/video/comments?url=https%3A%2F%2Fwww.tiktok.com%2F%40nasa%2Fvideo%2F7708867568920038669' \
  --header 'x-api-key: YOUR_API_KEY'

JavaScript

const response = await fetch("https://api.fetchproof.com/v1/tiktok/video/comments?url=https%3A%2F%2Fwww.tiktok.com%2F%40nasa%2Fvideo%2F7708867568920038669", {
  method: 'GET',
  headers: {
    'x-api-key': process.env.FETCHPROOF_API_KEY,
  },
});
const data = await response.json();
console.log(data);

Python

import os
import requests

response = requests.get(
    "https://api.fetchproof.com/v1/tiktok/video/comments?url=https%3A%2F%2Fwww.tiktok.com%2F%40nasa%2Fvideo%2F7708867568920038669",
    headers={"x-api-key": os.environ["FETCHPROOF_API_KEY"]},
)
print(response.json())

Go

package main

import (
  "fmt"
  "io"
  "net/http"
  "os"
)

func main() {
  req, _ := http.NewRequest("GET", "https://api.fetchproof.com/v1/tiktok/video/comments?url=https%3A%2F%2Fwww.tiktok.com%2F%40nasa%2Fvideo%2F7708867568920038669", nil)
  req.Header.Set("x-api-key", os.Getenv("FETCHPROOF_API_KEY"))
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}

PHP

<?php
$ch = curl_init("https://api.fetchproof.com/v1/tiktok/video/comments?url=https%3A%2F%2Fwww.tiktok.com%2F%40nasa%2Fvideo%2F7708867568920038669");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    'x-api-key: ' . getenv('FETCHPROOF_API_KEY'),
  ],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Excerpt of published sample response Full response →
{
  "success": true,
  "credits_remaining": 100,
  "alias_comment_deleted": false,
  "comments": [
    {
      "author_pin": false,
      "aweme_id": "7708867568920038669",
      "cid": "7708869768674460438",
      "collect_stat": 0,
      "comment_language": "un",
      "comment_post_item_ids": null,
      "create_time": 1794861136,
      "digg_count": 87,
      "image_list": null,
      "is_author_digged": false,
      "is_comment_translatable": false,
      "label_list": null,
      "…": "16 more fields"
    }
  ],
  "cursor": 20,
  "extra": {
    "api_debug_info": null,
    "fatal_item_ids": null,
    "now": 1794882948000
  },
  "has_filtered_comments": 0,
  "has_more": 1,
  "log_pb": {
    "impr_id": "20261117023548296DD721A170712E9911"
  },
  "reply_style": 2,
  "status_code": 0,
  "status_msg": "",
  "…": "3 more fields"
}
02

Get the replies to a comment

Pass the comment's cid as comment_id, together with the same video URL. Replies come back in the same shape as comments, with their own cursor and has_more for paging. Only call it for comments where reply_comment_total is above 0.

GET /v1/tiktok/video/comment/replies 1 credit per call

cURL

curl --request GET 'https://api.fetchproof.com/v1/tiktok/video/comment/replies?comment_id=7708869768674460438&url=https%3A%2F%2Fwww.tiktok.com%2F%40nasa%2Fvideo%2F7708867568920038669' \
  --header 'x-api-key: YOUR_API_KEY'

JavaScript

const response = await fetch("https://api.fetchproof.com/v1/tiktok/video/comment/replies?comment_id=7708869768674460438&url=https%3A%2F%2Fwww.tiktok.com%2F%40nasa%2Fvideo%2F7708867568920038669", {
  method: 'GET',
  headers: {
    'x-api-key': process.env.FETCHPROOF_API_KEY,
  },
});
const data = await response.json();
console.log(data);

Python

import os
import requests

response = requests.get(
    "https://api.fetchproof.com/v1/tiktok/video/comment/replies?comment_id=7708869768674460438&url=https%3A%2F%2Fwww.tiktok.com%2F%40nasa%2Fvideo%2F7708867568920038669",
    headers={"x-api-key": os.environ["FETCHPROOF_API_KEY"]},
)
print(response.json())

Go

package main

import (
  "fmt"
  "io"
  "net/http"
  "os"
)

func main() {
  req, _ := http.NewRequest("GET", "https://api.fetchproof.com/v1/tiktok/video/comment/replies?comment_id=7708869768674460438&url=https%3A%2F%2Fwww.tiktok.com%2F%40nasa%2Fvideo%2F7708867568920038669", nil)
  req.Header.Set("x-api-key", os.Getenv("FETCHPROOF_API_KEY"))
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}

PHP

<?php
$ch = curl_init("https://api.fetchproof.com/v1/tiktok/video/comment/replies?comment_id=7708869768674460438&url=https%3A%2F%2Fwww.tiktok.com%2F%40nasa%2Fvideo%2F7708867568920038669");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    'x-api-key: ' . getenv('FETCHPROOF_API_KEY'),
  ],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Excerpt of published sample response Full response →
{
  "success": true,
  "credits_remaining": 100,
  "credits_charged": 1,
  "comments": [
    {
      "aweme_id": "7708867568920038669",
      "cid": "7708899253913600788",
      "collect_stat": 0,
      "comment_language": "un",
      "comment_post_item_ids": null,
      "create_time": 1794868003,
      "digg_count": 4,
      "fold_status": 0,
      "image_list": null,
      "is_author_digged": false,
      "is_comment_translatable": false,
      "is_high_purchase_intent": true,
      "…": "16 more fields"
    }
  ],
  "cursor": 5,
  "extra": {
    "fatal_item_ids": [],
    "logid": "2026111702354854A8CCB11E8C542E2D5A",
    "now": 1794882948000
  },
  "has_more": 0,
  "log_pb": {
    "impr_id": "2026111702354854A8CCB11E8C542E2D5A"
  },
  "status_code": 0,
  "status_msg": "",
  "total": 5
}

What it costs

A page of comments costs 1 credit, and a page with no comments costs 0. Each page of replies costs 1 credit. Errors cost 0 credits.

Limits

An empty page doesn't prove the video has no comments, so retry later before you record zero. Only comments on public videos and slideshows are available.

Try it with 100 free credits

Sign up with an email address, no card. Credits never expire. Errors cost 0 credits, and each endpoint page lists exactly what it charges.