As a TikTok comments scraper, GET /v1/tiktok/comment_list returns a video's comments 20 to a page, and each page costs $0.0005, so 1,000 comments cost $0.025. This guide reads one video's first page, pages through the rest with a cursor, saves the comments as a CSV file and explains what happens with replies. You need an API key in VIREV_API_KEY, Python with requests, and the full URL of a public video.
Read the first page of comments
Send url as the full https://www.tiktok.com/@handle/video/<id> address and max_pages=1 to get one page back at once. A short vm.tiktok.com link or a bare video id answers 400 before billing, because the read needs the author handle from the URL.
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"This is the first comment of a real answer to that call, captured on 2026-10-12 for a Khaby Lame video, with the other 19 comments and the null and bookkeeping fields cut:
{
"data": {
"items": [
{
"id": "7681901814388622081",
"text": "My hero is Prophet Muhammad ﷺ ❤️",
"created_at": "2026-09-05T04:22:41+00:00",
"likes": 12493,
"replies": 146,
"owner": {
"id": "6586283068750479365",
"username": "annakhan_annie",
"full_name": "Anna Khan"
}
}
],
"pages": [{ "cursor": null, "fetched_at": "2026-10-12T12:58:00.084829+00:00", "count": 20 }],
"next_cursor": "eyJjdXJzb3IiOiIyMCIsIm9wIjoiY29tbWVudF9saXN0In0",
"has_more": true,
"stop_reason": "pages"
},
"meta": { "cost": "$0.0005", "request_id": "req_28b36b7a92b073b717902b0877f87df1" }
}Each item has the comment id, text, created_at in UTC, likes, the replies count and the commenter under owner. The endpoint reference lists every field with its type.
Page through every comment with the cursor
While next_cursor is set, send it back as cursor with the same url and max_pages=1, and you get the next 20. The loop below keeps one copy of each comment by id and stops at 1,000 comments, which is 50 calls and $0.025. Remove the limit to read to the end.
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, timeout=60)
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")Your organization can send 100 requests a minute across all its keys. Over that, a call answers 429 with a Retry-After header that gives the seconds to wait, and the 429 is not billed.
Or let a job collect them
For a video with tens of thousands of comments, send max_pages=-1 instead. The call answers 202 with a job that walks the comments until TikTok reports the end and keeps going if your script disconnects. Poll its status_url until status is ready, then read results_url page by page. Polls and downloads are free, and the job is billed once when it finishes. The job example on the reference page has the full Python loop.
Save the comments as CSV
The API answers JSON. Python's csv module quotes a comment that holds a comma, a quote or a line break, so emoji and multi-line comments land in one cell. 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.
import csv
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 comments.values():
writer.writerow([
c["id"],
c["created_at"],
c["owner"]["username"],
c["text"],
c["likes"],
c["replies"],
])Sort the file by likes to see the comments with the most likes, and by replies to see the ones with the longest threads.
Comments from a creator's latest videos
To scrape comments across an account rather than one video, list its videos first. GET /v1/tiktok/item_list with max_pages=1 returns up to 35 of its newest videos for $0.0005, and each video carries its URL in extra.url and its comment count in comments. The script below reads the first page of comments of each video that has any, so 35 videos cost at most 36 calls, $0.018.
import os
import requests
BASE = "https://api.virev.ai/v1/tiktok"
HEADERS = {"Authorization": f"Bearer {os.environ['VIREV_API_KEY']}"}
def page(op, **params):
response = requests.get(f"{BASE}/{op}", params={**params, "max_pages": 1}, headers=HEADERS, timeout=60)
response.raise_for_status()
return response.json()["data"]
rows = []
for video in page("item_list", handle="nike")["items"]:
if not video["comments"]:
continue
for comment in page("comment_list", url=video["extra"]["url"])["items"]:
rows.append({"video": video["id"], **comment})
print(len(rows), "comments from", len({r['video'] for r in rows}), "videos")What happens with replies
The endpoint returns top-level comments only. Each one carries replies, the number of replies TikTok counts under it, but the reply text does not come back, because TikTok did not load reply threads for a logged-out reader when we built this read. You are billed only for the top-level comments you get. If the replies matter for your study, use the count to pick the threads, then read those few on TikTok itself.
What it costs
| Comments | Pages of 20 | Price |
|---|---|---|
| 20 | 1 | $0.0005 |
200, a job with no max_pages | 10 | $0.005 |
| 1,000 | 50 | $0.025 |
| 10,000 | 500 | $0.25 |
A last page with fewer than 20 comments still bills as one page. A failed call, a 404 for a missing video and a failed job cost nothing.
Read comments you already collected
Every comment page the live endpoint reads is saved. GET /v1/tiktok/stored/post/comments reads those saved comments again by video id or URL, up to 200 a page for $0.0005, and never contacts TikTok. A video we never stored answers a free 404. Use it for a dashboard that shows the same videos every day, and call the live endpoint only when you want comments posted since your last read.
curl 'https://api.virev.ai/v1/tiktok/stored/post/comments?q=7681719358225239326&limit=200' \
-H "Authorization: Bearer $VIREV_API_KEY"Scrape your first TikTok comments
Create a key, export it as VIREV_API_KEY and run comments.py on any public video.
Get your API key →