点赞脚本配置
本页面介绍创建任务时 like 脚本的配置参数。
概述
like 脚本用于在 TikTok 或 Instagram 上自动为帖子点赞。通过 API 提供多个目标帖子 URL 时,系统会为每个 URL 创建一个任务。使用 start_time 参数来控制任务的执行时间。
脚本配置 (script_config)
点赞脚本的配置参数如下:
参数
| 参数 | 类型 | 必需 | 默认值 | 描述 |
|---|---|---|---|---|
| target_post_urls | string[] | Yes* | [] | 要点赞的目标帖子 URL 数组(每个 URL 一个任务) |
| target_post_url | string | Yes* | "" | 单个目标帖子 URL,或多个 URL 以换行/逗号分隔 |
| access_method | string | No | "direct" | 导航到帖子的方式:direct(通过 URL) |
备注
必须提供 target_post_urls 数组或 target_post_url 字符串。如果两者都提供,target_post_urls 优先。
信息
当提供多个目标帖子 URL 时,API 会为每个 URL 创建一个任务。例如,3 个 URL + 2 个设备 = 6 个任务。
示例
为单个帖子点赞
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "like",
"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": "like",
"script_config": {
"target_post_urls": [
"https://www.tiktok.com/@user1/video/111",
"https://www.tiktok.com/@user2/video/222",
"https://www.tiktok.com/@user3/video/333"
]
}
}'
这将创建 3 个独立的任务,立即执行。
使用开始时间调度点赞
使用 start_time 来调度任务的开始时间:
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "like",
"script_config": {
"target_post_url": "https://www.tiktok.com/@username/video/1234567890"
},
"start_time": "14:30"
}'
通过用户名列表点赞
直接为特定账号创建点赞任务:
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"usernames": ["@my_account1", "@my_account2"],
"script_name": "like",
"script_config": {
"target_post_url": "https://www.tiktok.com/@target/video/123"
}
}'
多设备批量点赞
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_1", "device_2", "device_3"],
"script_name": "like",
"script_config": {
"target_post_url": "https://www.tiktok.com/@viral/video/999"
},
"enable_multi_account": true
}'
Instagram 示例
相同的 API 也适用于 Instagram 帖子:
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "like",
"script_config": {
"target_post_url": "https://www.instagram.com/p/ABC123/"
}
}'
响应
{
"code": 0,
"message": "success",
"data": {
"task_ids": [401, 402, 403],
"created_count": 3
}
}
帖子 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/
最佳实践
-
调度任务:使用
start_time参数将点赞分散在一段时间内,减少触发频率限制的可能性。 -
合理批量:不要一次创建太多点赞任务,大多数平台对点赞 有频率限制。
-
使用多账号模式:启用
enable_multi_account以在同一设备上使用多个账号为帖子点赞。
错误代码
| Code | Description |
|---|---|
| 40001 | 目标帖子 URL 缺失 |
| 40003 | API 不支持该脚本 |
| 40301 | API 访问需要 Pro+ 套餐 |