View Script Configuration
This page documents the configuration parameters for the view script used in task creation.
Overview
The view script opens a post on TikTok or Instagram and watches it for a configurable duration — useful for boosting watch time / impressions. When you provide multiple target post URLs via API, one task is created per target post URL. You can control when each task executes using the start_time parameter.
Script Configuration (script_config)
The script_config object contains the parameters for the view script. Below are the available parameters:
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| target_post_urls | string[] | Yes* | [] | Array of target post URLs to view (one task per URL) |
| target_post_url | string | Yes* | "" | Single target post URL or multiple URLs separated by newlines/commas |
| view_duration | integer | No | 10 | Seconds to watch the post |
| view_durations | integer[] | No | — | [min, max] range in seconds; a random value within the range is used. Takes priority over view_duration |
Either target_post_urls array or target_post_url string must be provided. If both are provided, target_post_urls takes priority.
When multiple target post URLs are provided, the API creates one task per target post URL. For example, if you specify 3 post URLs and 2 devices, 6 tasks will be created. Use the start_time parameter to control when tasks start executing.
Examples
View a Single Post
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 with a Fixed Watch Duration
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
}
}'
View with a Random Watch Duration Range
A random watch time between 15 and 45 seconds is used per task:
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]
}
}'
View Posts by Username List Mode
Create view tasks directly for specific accounts:
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 View Example
The same API works for Instagram posts and 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]
}
}'
Response
{
"code": 0,
"message": "success",
"data": {
"task_ids": [501, 502],
"created_count": 2
}
}
Post URL Formats
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/
Best Practices
-
Vary the watch time: Prefer
view_durationsover a fixedview_durationso each view looks more natural. -
Schedule tasks: Use the
start_timeparameter to spread out views over time. -
Use multi-account mode: Enable
enable_multi_accountto view posts using multiple accounts on the same device.
Error Codes
| Code | Description |
|---|---|
| 40001 | Missing target post URL |
| 40003 | Script not supported via API |
| 40301 | API access requires Pro+ plan |
See Also
- Like Script Configuration - Like posts
- Favorite Script Configuration - Save posts to Favorites
- Task Management API - Create, list, and manage tasks
- Local API Overview - API overview and quick start