Fetching comments
Collect video comments
When a scraping job is executed with the get_comments
parameter set to true
,
all publicly available (non-deleted) comments for the specified post will be
collected. You can retrieve these comments, along with any replies, using the
following endpoint.
- No callback URL is required for this endpoint.
- No credits are used when calling this endpoint.
You will have to use video_id
that corresponds to the video you want to get comments for - this value is returned in the video scraping results.
Base URL
POST https://tiktok-scraper-api.datashake.com/v1/scrape/{request_id}/comments
Path parameters
request_id
Field type: string
Required: true
Description: The unique identifier for the scraping request.
Request parameters
video_id
Field type: string
Required: true
Description: The unique identifier for the TikTok video.
per_page
Field type: integer
Required: false
Description: The number of results to retrieve per page.
page
Field type: integer
Required: false
Description: The page number of the results to retrieve.
Code example
curl --location 'https://tiktok-scraper-api.datashake.com/v1/scrape/1742517759478683074-2b1a61cf-89d0-4d/comments?video_id=7473271005096463671&page=1&per_page=5' --header 'x-api-key: your-api-key'
import requests
url = "https://tiktok-scraper-api.datashake.com/v1/scrape/1742517759478683074-2b1a61cf-89d0-4d/comments"
params = {
"video_id": "7473271005096463671",
"page": 1,
"per_page": 5
}
headers = {
"x-api-key": "your-api-key"
}
response = requests.get(url=url, headers=headers, params=params)
Response
API response example
{
"request_id": "1742519035298729851-0e87219b-a751-4d",
"status": "completed",
"credits_used": null,
"request_metadata": {
"url": "https://www.tiktok.com/@surthycooks/video/7473271005096463671",
"callback_url": "http://example.com/callback",
"external_identifier": "my-custom-id",
"get_comments": true
},
"results": [
{
"video_id": "7473271005096463671",
"comment_id": "7482190290661524267",
"language": "en",
"likes_count": 0,
"liked_by_author": false,
"replies_count": 0,
"text": "Peruvian Ceviche is the best in the world. This is from a Latino that’s not Peruvian.",
"author_id": "6997455142510167046",
"author_unique_id": "travelingismydream1",
"author_nickname": "Beach_Life10",
"author_avatar_url": null,
"pinned_by_author": false,
"posted_at": "2025-03-15T23:59:57Z"
},
{
"video_id": "7473271005096463671",
"comment_id": "7481322080203408136",
"language": "ru",
"likes_count": 0,
"liked_by_author": false,
"replies_count": 0,
"text": "ма ша Аллах 1",
"author_id": "6656326013839097861",
"author_unique_id": "the_same_wolf95",
"author_nickname": "Борз ю",
"author_avatar_url": null,
"pinned_by_author": false,
"posted_at": "2025-03-13T15:50:53Z",
},
...
],
"summary": null,
"pagination": {
"total": 98,
"page": 1,
"per_page": 5,
"total_pages": 20
}
}