視聴スクリプト設定
このページでは、タスク作成に使用する view スクリプトの設定パラメータを説明します。
概要
view スクリプトは TikTok または Instagram の投稿を開き、設定した時間だけ視聴します。ウォッチタイムやインプレッションの向上に役立ちます。API で複数の URL を指定すると、URL ごとに 1 つのタスクが作成されます。start_time パラメータで各タスクの実行時間を制御できます。
スクリプト設定 (script_config)
視聴スクリプトの設定パラメータ:
パラメータ
| パラメータ | 型 | 必須 | デフォルト | 説明 |
|---|---|---|---|---|
| target_post_urls | string[] | Yes* | [] | 視聴する投稿 URL の配列(URL ごとに 1 タスク) |
| 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 ごとに 1 つのタスクを作成します。たとえば、3 つの URL と 2 台のデバイスを指定すると、6 つのタスクが作成されます。start_time パラメータでタスクの開始時間を制御してください。
例
1 件の投稿を視聴
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 の例
Instagram の投稿とリールにも同じ API が使えます:
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/