GET /v1/tiktok/comment_list

TikTok comments scraper API: export comments to JSON or CSV

This TikTok comments scraper is one GET call. Send a public video's URL and get its top-level comments, 20 to a page, each with text, post time, likes, reply count and author. A page costs $0.0005, so 1,000 comments cost $0.025. Send url as the full tiktok.com/@handle/video/<id> URL. max_pages=1 answers one page at once, and without it the call starts a job that collects 10 pages, or every page with max_pages=-1.

Price
$0.0005 per 20 results
Billing
$0.0005/20
Batch
Yes, through /v1/batch
Failed calls
Not charged

Example request

curl
curl 'https://api.virev.ai/v1/tiktok/comment_list?url=https%3A%2F%2Fwww.tiktok.com%2F%40khaby.lame%2Fvideo%2F7681719358225239326&max_pages=1' \
  -H "Authorization: Bearer $VIREV_API_KEY"
python
import os
import requests

response = requests.request(
    "GET",
    "https://api.virev.ai/v1/tiktok/comment_list",
    params={
        "url": "https://www.tiktok.com/@khaby.lame/video/7681719358225239326",
        "max_pages": "1",
    },
    headers={"Authorization": f"Bearer {os.environ['VIREV_API_KEY']}"},
    timeout=60,
)
response.raise_for_status()
print(response.json())

Parameters

NameInTypeDescription
url requiredquerystringTikTok video URL, https://www.tiktok.com/@handle/video/<id>. A bare video id is refused, because the read needs the author. Example https://www.tiktok.com/@khaby.lame/video/7681719358225239326.
since querystringNot accepted on this operation: its items carry no timestamp, so since returns 400 before billing.
max_pages queryintegerMaximum pages to fetch. -1 walks until exhaustion or since with no page cap, and must be written. Omitted, since alone bounds the walk; with neither, the job stops after 10 pages. Any positive integer is accepted. 1 returns one page synchronously with HTTP 200; any other value creates a durable job with HTTP 202. Example 1.
cursor querystringOpaque next_cursor from an earlier answer of this operation, also with get_raw=true. A native TikTok cursor from a raw page answers 400. Result download cursors belong to the results route.
page_size queryintegerNative count, default 20. TikTok answers at most 20. Billed per 20 unique returned items, one native page. Default 20.
cached queryauto | cache_only | liveauto (default) serves a read saved within the last 24 hours for these exact arguments, otherwise fetches. cache_only never contacts TikTok (404 not_cached when nothing is saved, whatever its age). live always fetches. Anything else is a 400. cache_only reads one saved page per request: omit max_pages or pass 1, and continue with next_cursor. Default auto.
get_raw querybooleantrue returns the upstream JSON exactly as TikTok answered it instead of the normalized Page[Comment]. Default false.
Idempotency-Key headerstringReuse this key with the same inputs to recover a lost job submission. A different input with the same key returns 409.

Example response

A real answer to the request above for a Khaby Lame video, captured on 2026-10-12, with the list cut to 3 of its 20 comments.

json
{
  "data": {
    "items": [
      {
        "id": "7681901814388622081",
        "text": "My hero is Prophet Muhammad ﷺ ❤️",
        "created_at": "2026-09-05T04:22:41+00:00",
        "likes": 12493,
        "replies": 146,
        "liked_by_owner": null,
        "owner": {
          "id": "6586283068750479365",
          "username": "annakhan_annie",
          "full_name": "Anna Khan",
          "is_verified": null,
          "is_private": null,
          "avatar_url": null,
          "latest_story_at": null,
          "extra": {
            "sec_uid": null
          }
        },
        "extra": {}
      },
      {
        "id": "7681721078482387729",
        "text": "1m for what?😭",
        "created_at": "2026-09-04T16:41:16+00:00",
        "likes": 7533,
        "replies": 41,
        "liked_by_owner": null,
        "owner": {
          "id": "7151662998456632325",
          "username": "ovayomzangwe901",
          "full_name": "ovi.",
          "is_verified": null,
          "is_private": null,
          "avatar_url": null,
          "latest_story_at": null,
          "extra": {
            "sec_uid": null
          }
        },
        "extra": {}
      },
      {
        "id": "7695763267344974598",
        "text": "thought he was the only one",
        "created_at": "2026-10-12T12:52:12+00:00",
        "likes": 0,
        "replies": 0,
        "liked_by_owner": null,
        "owner": {
          "id": "7669869049291965441",
          "username": "thetradesibysci",
          "full_name": "thetradesibysci",
          "is_verified": null,
          "is_private": null,
          "avatar_url": null,
          "latest_story_at": null,
          "extra": {
            "sec_uid": null
          }
        },
        "extra": {}
      }
    ],
    "pages": [
      {
        "cursor": null,
        "fetched_at": "2026-10-12T12:58:00.084829+00:00",
        "count": 20
      }
    ],
    "next_cursor": "eyJjdXJzb3IiOiIyMCIsIm9wIjoiY29tbWVudF9saXN0In0",
    "has_more": true,
    "stop_reason": "pages",
    "coverage": {
      "since": null,
      "oldest_at": null,
      "since_reached": false
    }
  },
  "meta": {
    "source": "db",
    "fetched_at": "2026-10-12T12:58:00.084829+00:00",
    "cost": "$0.0005",
    "balance": "$3.3627",
    "request_id": "req_28b36b7a92b073b717902b0877f87df1"
  }
}

Response fields

FieldTypeDescription
data.items[].idstringTikTok's comment id.
data.items[].textstringThe comment text, emoji included.
data.items[].created_atstringWhen the comment was posted, ISO 8601 in UTC.
data.items[].likesintegerLikes on the comment.
data.items[].repliesintegerHow many replies TikTok counts under the comment. The reply text is not returned.
data.items[].owner.idstringThe commenter's numeric TikTok user id.
data.items[].owner.usernamestringThe commenter's handle, without @.
data.items[].owner.full_namestringThe commenter's display name.
data.pages[].countintegerComments TikTok sent on that page, at most 20.
data.pages[].fetched_atstringWhen that page was read from TikTok.
data.next_cursorstringSend it back as cursor for the next page. Null on the last page.
data.has_morebooleanTrue while more comments remain.
data.stop_reasonstringWhy the walk stopped. pages and deadline leave a next_cursor to continue, exhausted means TikTok reported the end, and blocked means TikTok refused the next page.
meta.coststringWhat this call cost, such as $0.0005 for one page.

Price per 1,000 TikTok comments

The endpoint bills $0.0005 for each page of up to 20 unique comments it returns, and a failed call costs nothing.

  • One page of 20 comments costs $0.0005.
  • A job with no max_pages reads 10 pages, 200 comments, for $0.005.
  • 1,000 comments are 50 pages and cost $0.025.
  • 10,000 comments are 500 pages and cost $0.25.

A last page with fewer than 20 comments still bills as one page. Your organization can send 100 requests a minute across all its keys.

Replies come back as a count

Each comment carries replies, the number of replies TikTok counts under it. The endpoint does not return the reply text, because TikTok did not load reply threads for a logged-out reader when we built this read, so no reply rows come back and none are billed.

To find the conversations worth reading, sort the comments by replies and open those comments on TikTok.

Page through every comment with the cursor

Call with max_pages=1 and pass each answer's next_cursor back as cursor until it is null. Each call answers in one response with HTTP 200, and a dict keyed on id keeps one copy of each comment if a page repeats one. The loop below stops at 1,000 comments, which costs $0.025.

python
import os
import requests

API = "https://api.virev.ai/v1/tiktok/comment_list"
HEADERS = {"Authorization": f"Bearer {os.environ['VIREV_API_KEY']}"}
VIDEO = "https://www.tiktok.com/@khaby.lame/video/7681719358225239326"

comments = {}
cursor = None
while len(comments) < 1000:
    params = {"url": VIDEO, "max_pages": 1}
    if cursor:
        params["cursor"] = cursor
    response = requests.get(API, params=params, headers=HEADERS)
    response.raise_for_status()
    data = response.json()["data"]
    for comment in data["items"]:
        comments[comment["id"]] = comment
    cursor = data["next_cursor"]
    if not cursor:
        break

print(len(comments), "comments")
curl
curl 'https://api.virev.ai/v1/tiktok/comment_list?url=https%3A%2F%2Fwww.tiktok.com%2F%40khaby.lame%2Fvideo%2F7681719358225239326&max_pages=1&cursor=eyJjdXJzb3IiOiIyMCIsIm9wIjoiY29tbWVudF9saXN0In0' \
  -H "Authorization: Bearer $VIREV_API_KEY"

Collect every comment with one job

Send max_pages=-1 and leave out cursor, and the call answers HTTP 202 with a job. The job walks the comments until TikTok reports the end and keeps running if you disconnect. Poll status_url until status is ready, then read results_url, passing its next_cursor back until complete is true. Polls and result reads are free, and the job is billed once when it finishes.

python
import os
import time
import requests

BASE = "https://api.virev.ai"
HEADERS = {"Authorization": f"Bearer {os.environ['VIREV_API_KEY']}"}
VIDEO = "https://www.tiktok.com/@khaby.lame/video/7681719358225239326"

def get(path, **params):
    response = requests.get(BASE + path, params=params, headers=HEADERS)
    response.raise_for_status()
    return response.json()["data"]

job = get("/v1/tiktok/comment_list", url=VIDEO, max_pages=-1)
while job["status"] in ("queued", "running"):
    time.sleep(5)
    job = get(job["status_url"])
if job["status"] != "ready":
    raise RuntimeError(f"job {job['status']}: {job['error']}")

comments = []
cursor = None
while True:
    page = get(job["results_url"], **({"cursor": cursor} if cursor else {}))
    for result in page["results"]:
        comments.extend(result.get("items", []))
    if page["complete"]:
        break
    cursor = page["next_cursor"]

print(len(comments), "comments for", job["cost"])

Export TikTok comments to CSV

The API answers JSON. To get a spreadsheet, write the fields you need with Python's csv module, which quotes a comment that holds a comma, a quote or a line break. Open the file with newline="" as the csv docs ask, and with encoding="utf-8-sig", which writes a byte order mark so the file opens in Excel and Google Sheets with its emoji intact. This runs on the comments list from either loop above. To scrape many videos at once, send their URLs to the Batch API, which runs up to 10,000 inputs in one job. Its CSV download has one row per video, with the comments in one JSON cell, so run the CSV code above to get one row per comment.

python
import csv

rows = comments.values() if isinstance(comments, dict) else comments
with open("tiktok_comments.csv", "w", newline="", encoding="utf-8-sig") as f:
    writer = csv.writer(f)
    writer.writerow(["id", "created_at", "username", "text", "likes", "replies"])
    for c in rows:
        writer.writerow([
            c["id"],
            c["created_at"],
            c["owner"]["username"],
            c["text"],
            c["likes"],
            c["replies"],
        ])

Comments we already stored

Every comment page this endpoint reads is saved. GET /v1/tiktok/stored/post/comments reads those saved comments by video id or URL, up to 200 a page for $0.0005, and never contacts TikTok. A video we never stored is a free 404. On this endpoint, cached=cache_only serves a saved page without a new read, and cached=auto, the default, reuses a page saved in the last 24 hours.

curl
curl 'https://api.virev.ai/v1/tiktok/stored/post/comments?q=7681719358225239326&limit=200' \
  -H "Authorization: Bearer $VIREV_API_KEY"

How it works

A video's top-level comments with author, likes and reply count. With max_pages=1, returns Page[Comment] under data; with get_raw=true returns the upstream JSON.

The default request creates a durable job (202). Use max_pages=1 for one synchronous Page response (200). Poll status_url, then read results_url with its opaque cursor. Acquisition stops at the first of since, max_pages, or exhaustion. Jobs continue after disconnects. Result responses are bounded to 3 MiB; this does not limit the crawl. Supply Idempotency-Key to recover a lost submission response; reuse it with the same inputs.

A field TikTok does not carry is null, a list it does not carry is [], and TikTok-only facts sit under extra. Unknown, unsupported, and repeated query parameters return 400 before acquisition or billing.

Billing: $0.0005 per 20 unique returned items (one native page), rounded up to a minimum of one billing unit. Jobs settle once after successful completion. Submission, polling and repeat downloads are free.

Errors

StatusWhen
400The request parameters are invalid.
401Missing, malformed, or revoked API key.
402Balance is too low for this request.
404cached=cache_only found nothing saved for these arguments (not_cached; call again with cached=auto to fetch it), or the TikTok account or item does not exist (not_found). You are not charged.
429Over the per-minute limit. The limit belongs to your organization and all its API keys share it: 100 requests per minute unless an increase was granted. Wait for the Retry-After seconds, then retry. On a live read, code rate_limited means the platform itself rate-limited this read; retry after the Retry-After seconds. You are not charged.
502The upstream fetch failed. You are not charged.
503Billing could not be confirmed, so no upstream data was returned.
504The upstream request timed out. You are not charged.

Frequently asked questions

Does the TikTok comments API return replies?

It returns the reply count of each top-level comment in the replies field, but not the reply text. TikTok did not load reply threads for a logged-out reader when we built this read, so no reply rows come back and none are billed.

How many comments does one call return?

One page holds up to 20 comments, the most TikTok sends per page. With max_pages=1 a call returns one page at once. Without max_pages the call starts a job that reads 10 pages, and max_pages=-1 reads until TikTok reports the end.

How much does it cost to scrape 1,000 TikTok comments?

$0.025. The endpoint bills $0.0005 per page of up to 20 unique comments, so 1,000 comments are 50 pages. A failed call and a job that fails cost nothing.

Can I export TikTok comments to CSV?

The API answers JSON. The CSV section on this page writes the id, time, username, text, likes and reply count of each comment to a file with Python's csv module, in under 15 lines.

Do I need a TikTok account or a TikTok developer app?

No. You send a Virev API key, and the endpoint reads what TikTok shows a logged-out visitor, so it covers public videos.

Can I send a video id instead of the URL?

Not on this endpoint, because the read needs the author's handle from the URL, so a bare id answers 400 before billing. The stored endpoint, /v1/tiktok/stored/post/comments, takes a bare video id.

Guides that use this endpoint