Skip to main content

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)​

ParameterTypeRequiredDefaultDescription
modestringNofollowersfollowers, following, or keyword
target_usernamestringConditional""Account whose followers/following list should be opened
search_keywordstringConditional""Search query used when mode is keyword
max_scrape_countintegerNo50Maximum 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​

CodeDescription
40001Missing target username or search keyword for the selected mode
40003Script is not supported by the selected build or platform
40301API access requires a Pro+ plan

See Also​