观看脚本配置
本页面介绍创建任务时 view 脚本的配置参数。
概述
view 脚本用于打开 TikTok 或 Instagram 上的帖子,并观看一段可配置的时长——适用于提升观看时长和曝光量。通过 API 提供多个目标帖子 URL 时,系统会为每个 URL 创建一个任务。使用 start_time 参数来控制任务的执行时间。
脚本配置 (script_config)
观看脚本的配置参数如下:
参数
| 参数 | 类型 | 必需 | 默认值 | 描述 |
|---|---|---|---|---|
| target_post_urls | string[] | Yes* | [] | 要观看的目标帖子 URL 数组(每个 URL 一个任务) |
| target_post_url | string | Yes* | "" | 单个目标帖子 URL,或多个 URL 以换行/逗号分隔 |
| view_duration | integer | No | 10 | 观看帖子的秒数 |
| view_durations | integer[] | No | — | [min, max] 随机区间(秒),优先于 view_duration 生效 |
备注
必须提供 target_post_urls 数组或 target_post_url 字符串。如果两者都提供,target_post_urls 优先。
任务创建说明
当提供多个目标帖子 URL 时,API 会为每个 URL 创建一个任务。例如,3 个 URL + 2 个设备 = 6 个任务。使用 start_time 参数来控制任务的开始时间。
示例
观看单个帖子
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "view",
"script_config": {
"target_post_url": "https://www.tiktok.com/@username/video/1234567890"
}
}'
指定固定观看时长
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "view",
"script_config": {
"target_post_url": "https://www.tiktok.com/@username/video/1234567890",
"view_duration": 30
}
}'
使用随机观看时长区间
每个任务将在 15 至 45 秒之间随机选择观看时长:
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "view",
"script_config": {
"target_post_urls": [
"https://www.tiktok.com/@user1/video/111",
"https://www.tiktok.com/@user2/video/222"
],
"view_durations": [15, 45]
}
}'
通过用户名列表模式观看
直接为特定账号创建观看任务:
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"usernames": ["@my_account1", "@my_account2"],
"script_name": "view",
"script_config": {
"target_post_url": "https://www.tiktok.com/@target/video/123",
"view_duration": 20
}
}'
Instagram 示例
相同的 API 同样适用于 Instagram 帖子和 Reels:
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "view",
"script_config": {
"target_post_url": "https://www.instagram.com/reel/ABC123/",
"view_durations": [10, 30]
}
}'
响应
{
"code": 0,
"message": "success",
"data": {
"task_ids": [501, 502],
"created_count": 2
}
}
帖子 URL 格式
TikTok
https://www.tiktok.com/@username/video/1234567890123456
https://vm.tiktok.com/ABCDEFG/
Instagram
https://www.instagram.com/p/ABCDEFGHIJK/
https://www.instagram.com/reel/ABCDEFGHIJK/
最佳实践
-
随机化观看时长:优先使用
view_durations而非固定的view_duration,使每次观看看起来更自然。 -
调度任务:使用
start_time参数将观看任务分散在一段时间内执行。 -
使用多账号模式:启用
enable_multi_account以在同一设备上使用多个账号观看帖子。
错误代码
| Code | Description |
|---|---|
| 40001 | 目标帖子 URL 缺失 |
| 40003 | API 不支持该脚本 |
| 40301 | API 访问需要 Pro+ 套餐 |