Scrape Users Script Configuration
The scrape_users script exports usernames from the follower list, following list, or account search UI. It is available on TikTok, Instagram, and Threads in the Pro build and runs through a connected Android device.
Script Configuration (script_config)
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| mode | string | No | followers | followers, following, or keyword |
| target_username | string | Conditional | "" | Account whose followers/following list should be opened |
| search_keyword | string | Conditional | "" | Search query used when mode is keyword |
| max_scrape_count | integer | No | 50 | Maximum new usernames to export (1–10,000) |
target_username is required for followers and following. search_keyword is required for keyword.
Example: Threads followers
curl -X POST http://localhost:50809/api/v1/task \
-H "Content-Type: application/json" \
-d '{
"serials": ["device_serial_1"],
"script_name": "scrape_users",
"platform": "threads",
"script_config": {
"mode": "followers",
"target_username": "@creator",
"max_scrape_count": 50
}
}'
Output files
The runner writes one username per line under TikMatrix's <work_dir>/download/ directory. Files use the safe target or keyword as their base name:
<target>_followers.txt<target>_following.txt<keyword>.txt
Unsafe filename characters are replaced, and subsequent runs append to the same file. The platform may expose fewer rows in one scroll session; the script continues until the requested count is reached or no new rows appear.
Error Codes
| Code | Description |
|---|---|
| 40001 | Missing target username or search keyword for the selected mode |
| 40003 | Script is not supported by the selected build or platform |
| 40301 | API access requires a Pro+ plan |
See Also
- Task Management API - Create, list, and manage tasks
- Scrape Users tutorial - Desktop workflow and screenshots
- Local API Overview - API overview and quick start