Docs
Query Video Comments
Create Query Task
Query
Query Parameters
Key | Type | Description | Example | Required |
category | string | The data category for which the analysis is planned | comment | Yes |
condition_groups | list | Specifications for what data should be returned and processed | condition_groups = [ { "operator": "and", "conditions": [ { "field": "id", "operator": "eq", "field_values": ["7347705421577563079"] } ] } ] | No |
fields | string | Data fields to be returned. Interface will only return the fields listed here. | comment_id,video_id | Yes |
limit | int | The maximum number of records that will be returned. Test Stage The default value is 100. Execution Stage The default value is 1000. | 200 | No |
Query Condition
Key | Type | Description | Required |
and | list<Condition> | The | No |
or | list<Condition> | The | No |
not | list<Condition> | The | No |
Query Condition Fields and Operators
Field | Description | Type | Allowed Operator | |
comment_id | The unique ID for the comment | string |
| |
video_id | The ID of the video or item that the comment is under | string |
|
Response
Key | Type | Description | Example |
task_id | int | Data query job task identifier | 12345 |
Check Query Task Status
Query Parameters
Key | Type | Description | Example | Required |
task_id | int | Data query job task identifier | 12345 | Yes |
Response
Key | Type | Description | Example | Required |
status | string | Data query job task status | Created AnalysisFailed Processing Completed Cancelled Validating | No |
Check Query Task Sample Code
Example
status = client.check_query_task_status(task_id)Cancel Query Task
Query Parameters
Key | Type | Description | Example | Required |
task_id | int | Data query job task identifier | 12345 | Yes |
Response
Key | Type | Description | Example |
success | bool | Whether the request was successfullycancelled | True |
Cancel Query Task Sample Code
Example
result = client.cancel_query_task(task_id)Get Query Task Result
Query Parameters
Key | Type | Description | Example | Required |
task_id | int | Data query job task identifier | 12345 | Yes |
Response
Key | Type | Description | Example |
result | string | Data fields returned from the query. Interface will only return the fields listed here. | id, video_id, text, parent_comment_id, like_count, reply_count, create_time |
Get Query Task Sample Code
Example
data = client.get_query_task_result(task_id)Query Video Comment Data from TikTok via SDK
Example code
from pyrqs import rqs
category = 'comment'
condition_groups = [
{
"operator": "and",
"conditions": [
{
"field": "video_id",
"operator": "eq",
"field_values": ["7347705421577563079"]
}
]
}
]
fields = 'id, video_id, text, parent_comment_id, like_count, reply_count, create_time'
limit = 100
client = rqs.RQSClient()
task_id = client.create_query_task(
category=category, condition_groups=condition_groups, fields=fields, limit=limit)
status = client.check_query_task_status(task_id)