采集用户脚本配置
scrape_users 通过真实 Android 设备的界面,导出粉丝、关注中或搜索结果中的用户名。Pro 版支持 TikTok、Instagram 和 Threads。
script_config
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
| mode | string | 否 | followers | followers、following 或 keyword |
| target_username | string | 条件 | "" | 要打开其粉丝/关注列表的账户 |
| search_keyword | string | 条件 | "" | keyword 模式使用的搜索词 |
| max_scrape_count | integer | 否 | 50 | 最多导出的新用户名(1–10,000) |
followers/following 模式需要 target_username;keyword 模式需要 search_keyword。
Threads API 示例
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
}
}'
结果写入 TikMatrix 的 <work_dir>/download/ 目录,每行一个用户名。文件名为 <target>_followers.txt、<target>_following.txt 或 <keyword>.txt;后续运行会追加。达到上限或找不到新行时停止。
错误码
| 代码 | 说明 |
|---|---|
| 40001 | 当前模式缺少目标用户名或搜索词 |
| 40003 | 当前构建或平台不支持此脚本 |
| 40301 | API 需要 Pro 或更高套餐 |