How to get TikTok video comments with Python

Find a video with one search call, then page through its comments 20 at a time. In our test 10 pages returned 200 comments; with the search that is 11 calls and $0.022.

Updated 2026-11-22·This page as Markdown

Step 1: find the video

Search TikTok by keyword. Each item's id is the video ID that the comments endpoint takes. If you already have a video link, skip this step: the ID is the number after /video/ in the link.

TikTok video search API·GET /v1/tiktok/videos/search·$0.002 a call

curl "https://xtikapi.com/v1/tiktok/videos/search?keyword=camping+coffee" \
  -H "Authorization: Bearer YOUR_API_KEY"
Recorded response (lists keep the first two items)
{
  "data": {
    "items": [
      {
        "id": "0779509297655120597",
        "url": "https://example.com/link",
        "text": "Example text",
        "author": {
          "id": "xx1xxxxxxxxxxx-xxxxxxxxxxxx5xxxx37x9x6xxx_xxxxxx76xxxxxxxxxxx0xxx30x02xxxxx2",
          "username": "example_user",
          "name": "Example name",
          "avatar": "https://example.com/image.jpg",
          "followers": 118728
        },
        "createdAt": "2026-11-07T13:41:13.000Z",
        "likeCount": 257030,
        "commentCount": 385,
        "shareCount": 24319,
        "viewCount": 2152698,
        "cover": "https://example.com/image.jpg"
      },
      {
        "id": "0776986179814197990",
        "url": "https://example.com/link",
        "text": "Example text",
        "author": {
          "id": "xx1xxxxxxxxx5xxxxxxxxxxx7xxx0xxxxxxx4-xxxxxxxxxxxxxxxx55xxxxx5x0xxxxxxxx9xxx",
          "username": "example_user",
          "name": "Example name",
          "avatar": "https://example.com/image.jpg",
          "followers": 53345
        },
        "createdAt": "2026-10-31T12:06:19.000Z",
        "likeCount": 625844,
        "commentCount": 1046,
        "shareCount": 63850,
        "viewCount": 8935392,
        "cover": "https://example.com/image.jpg"
      }
    ],
    "has_more": true,
    "next": {
      "cursor": 20
    }
  },
  "meta": {
    "request_id": "example",
    "endpoint": "tiktok.videos.search",
    "normalized": true,
    "unavailable": [],
    "billing": {
      "charged": true,
      "amount": 0.002,
      "balance": 4.98
    }
  }
}

Step 2: read every page of comments

Pass the video ID as id. Each page returns about 20 comments; the loop adds data.next to the parameters until it is null. Each page is one call.

TikTok comments API·GET /v1/tiktok/comments/list·$0.002 a call

curl "https://xtikapi.com/v1/tiktok/comments/list?id=7708408003065580831" \
  -H "Authorization: Bearer YOUR_API_KEY"
Recorded response (lists keep the first two items)
{
  "data": {
    "items": [
      {
        "id": "0772508255858426293",
        "text": "Example text",
        "author": {
          "id": "xx1xxxxxxxxx8xxx1xxxxxxxxxxxxxxxxxxxxx_xxxx7xx4xxxx3xxxxxxxxxxxxxxxxxxxxxx0x",
          "username": "example_user",
          "name": "Example name",
          "avatar": "https://example.com/image.jpg",
          "followers": 0,
          "description": "Example text"
        },
        "createdAt": "2026-11-15T15:38:44.000Z",
        "likeCount": 349,
        "replyCount": 5
      },
      {
        "id": "0773410572235817260",
        "text": "Example text",
        "author": {
          "id": "xx1xxxxxxxxxxx5xxxxxxxxx653x-1x2xx2xx8xxxx4xxx_xxxxxx1xx4xxxxxx5xxx7xxxxxx1x",
          "username": "example_user",
          "name": "Example name",
          "avatar": "https://example.com/image.jpg",
          "followers": 0,
          "description": "Example text"
        },
        "createdAt": "2026-11-18T02:39:24.000Z",
        "likeCount": 2,
        "replyCount": 0
      }
    ],
    "has_more": true,
    "next": {
      "cursor": 20
    }
  },
  "meta": {
    "request_id": "example",
    "endpoint": "tiktok.comments.list",
    "normalized": true,
    "unavailable": [],
    "billing": {
      "charged": true,
      "amount": 0.002,
      "balance": 4.98
    }
  }
}

What the example costs

Calls: 1
Price: $0.002
Subtotal: $0.002
Calls: 10
Price: $0.002
Subtotal: $0.02
Total
Calls: 11
Price: —
Subtotal: $0.022

Failed calls and timeouts are not charged. A new account with a verified email gets $0.50 of trial balance, enough to run this example.

Good to know

  • A page held 20 comments in our test on 2026-11-22.
  • Replies are not included. Read them with tiktok.comment_replies.list, passing the video id and the comment's id as comment_id.
  • Comments can arrive between two calls, so dedupe by id when you merge pages.

Endpoints

More about TikTok

Questions

How much does this cost with XTikAPI?

The example here is 11 calls, $0.022 in total. Failed calls and timeouts are free, and a new account with a verified email gets $0.50 of trial balance.

Do I need the TikTok Research API?

No. The calls read public comments with an API key from this site; there is no application or approval step.