xapi-to 0.1.18 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +258 -10
- package/dist/chunk-TYY6JR6O.js +870 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1256 -590
- package/dist/openai-sandbox-client.d.ts +85 -0
- package/dist/openai-sandbox-client.js +285 -0
- package/examples/openai-agents-sandbox-local.ts +131 -0
- package/examples/sandbox-api-cli-openai.mjs +450 -0
- package/package.json +33 -4
- package/scripts/openai-sandbox-agent-e2e.ts +219 -0
- package/scripts/sandbox-playground-e2e.mjs +463 -0
- package/skills/xapi/SKILL.md +498 -0
- package/skills/xapi/guides/ai.md +200 -0
- package/skills/xapi/guides/ai_gateway.md +263 -0
- package/skills/xapi/guides/crypto.md +197 -0
- package/skills/xapi/guides/douyin.md +297 -0
- package/skills/xapi/guides/google_search.md +194 -0
- package/skills/xapi/guides/linkedin.md +253 -0
- package/skills/xapi/guides/reddit.md +312 -0
- package/skills/xapi/guides/sandbox.md +466 -0
- package/skills/xapi/guides/serper.md +124 -0
- package/skills/xapi/guides/sms.md +186 -0
- package/skills/xapi/guides/tiktok.md +322 -0
- package/skills/xapi/guides/twitter.md +276 -0
- package/skills/xapi/guides/weibo.md +301 -0
- package/skills/xapi/guides/ws_gateway.md +206 -0
- package/skills/xapi/guides/xiaohongshu.md +315 -0
- package/skills/xapi/scripts/download_tweet_videos.sh +125 -0
- package/src/client.ts +664 -0
- package/src/config.ts +160 -0
- package/src/openai-sandbox-client.ts +349 -0
- package/src/sandbox-client.ts +289 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# SMS Verification Guide
|
|
2
|
+
|
|
3
|
+
Use xAPI's 5SIM SMS service to get virtual phone numbers and receive SMS verification codes for platform registrations (Claude, OpenAI, Telegram, etc.).
|
|
4
|
+
|
|
5
|
+
> **Dynamic catalog:** These are database-registered third-party APIs, not built-in capabilities. Exact action IDs, HTTP methods, parameters, billing rules, and response fields can change. Run `search` and then `get` before every paid workflow; the current schema, service terms, quoted price, and live response are authoritative. Examples below reflect one known GET-based version.
|
|
6
|
+
|
|
7
|
+
Use virtual numbers only where the target service permits them. Do not use this workflow to bypass access controls, identity checks, account limits, or platform terms.
|
|
8
|
+
|
|
9
|
+
## Contents
|
|
10
|
+
|
|
11
|
+
- [How it works](#how-it-works)
|
|
12
|
+
- [Check availability](#step-1-check-availability)
|
|
13
|
+
- [Buy a number](#step-2-buy-a-number)
|
|
14
|
+
- [Use the number](#step-3-use-the-number)
|
|
15
|
+
- [Check for SMS](#step-4-check-for-sms)
|
|
16
|
+
- [Finish or cancel](#step-5-finish-or-cancel)
|
|
17
|
+
- [Agent workflow](#complete-agent-workflow)
|
|
18
|
+
- [API reference](#api-reference)
|
|
19
|
+
- [Error handling](#error-handling)
|
|
20
|
+
|
|
21
|
+
## How It Works
|
|
22
|
+
|
|
23
|
+
1. **Check availability** — See stock and pricing by country
|
|
24
|
+
2. **Buy a number** — Review the live quote and obtain explicit user confirmation before this paid action
|
|
25
|
+
3. **Use the number** — Enter it on the target platform's registration page
|
|
26
|
+
4. **Check for SMS** — Poll until the verification code arrives
|
|
27
|
+
5. **Finish or cancel** — Confirm completion, or cancel/ban if the number didn't work
|
|
28
|
+
|
|
29
|
+
**Billing:** Treat purchase, finish, cancel, ban, settlement, and refund behavior as service-version dependent. Some versions may reserve balance first and settle later; others may charge at purchase. Never promise a refund or a final charge point without checking the current schema and service terms.
|
|
30
|
+
|
|
31
|
+
## Step 1: Check Availability
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npx xapi-to call 5sim-sms.v1_guest_products_country_operator_product \
|
|
35
|
+
--method GET \
|
|
36
|
+
--input '{"pathParams":{"country":"any","operator":"any","product":"claudeai"},"params":{"single":0,"sort":"top"}}'
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Returns stock and pricing per country. Pick a country with good stock and low price.
|
|
40
|
+
|
|
41
|
+
### Common Product Names
|
|
42
|
+
|
|
43
|
+
| Platform | Product name |
|
|
44
|
+
|----------|-------------|
|
|
45
|
+
| Claude / Anthropic | `claudeai` |
|
|
46
|
+
| OpenAI / ChatGPT | `openai` |
|
|
47
|
+
| Telegram | `telegram` |
|
|
48
|
+
| WhatsApp | `whatsapp` |
|
|
49
|
+
| Google | `google` |
|
|
50
|
+
| Discord | `discord` |
|
|
51
|
+
| Twitter / X | `twitter` |
|
|
52
|
+
|
|
53
|
+
Treat these names as examples, not a stable catalog. Use `npx xapi-to search "5sim <platform>" --source api`, inspect candidates with `get`, or query the current products endpoint.
|
|
54
|
+
|
|
55
|
+
As a last resort, you can list all products:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npx xapi-to call 5sim-sms.v1_guest_products_country_operator \
|
|
59
|
+
--method GET \
|
|
60
|
+
--input '{"pathParams":{"country":"any","operator":"any"}}'
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The full product response can be large; filter it locally or query a product-specific endpoint after discovering the current name.
|
|
64
|
+
|
|
65
|
+
## Step 2: Buy a Number
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npx xapi-to call 5sim-sms.v1_user_buy_activation_country_operator_product \
|
|
69
|
+
--method GET \
|
|
70
|
+
--input '{"pathParams":{"country":"england","operator":"any","product":"claudeai"}}'
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Response:
|
|
74
|
+
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"id": 123456789,
|
|
78
|
+
"phone": "+447123456789",
|
|
79
|
+
"operator": "three",
|
|
80
|
+
"product": "claudeai",
|
|
81
|
+
"price": 0.05,
|
|
82
|
+
"status": "PENDING",
|
|
83
|
+
"country": "england"
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Before running the buy call, show the user the selected country, operator, product, quoted price, and applicable cancellation/refund terms, then obtain explicit confirmation. **Save the returned `id` and `phone`**; the `id` is needed for subsequent operations.
|
|
88
|
+
|
|
89
|
+
Inspect the returned balance/order fields to determine whether the current version reserved or charged funds. Do not infer settlement solely from a successful HTTP response.
|
|
90
|
+
|
|
91
|
+
## Step 3: Use the Number
|
|
92
|
+
|
|
93
|
+
Tell the user to:
|
|
94
|
+
|
|
95
|
+
1. Go to the target platform's sign-up page (e.g. claude.ai)
|
|
96
|
+
2. Enter the phone number from step 2 (e.g. `+447123456789`)
|
|
97
|
+
3. Click "Send verification code"
|
|
98
|
+
|
|
99
|
+
**This step requires human action.** Wait for the user to confirm they've requested the code.
|
|
100
|
+
|
|
101
|
+
## Step 4: Check for SMS
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npx xapi-to call 5sim-sms.v1_user_check_id \
|
|
105
|
+
--method GET \
|
|
106
|
+
--input '{"pathParams":{"id":"123456789"}}'
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Response when SMS received:
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"id": 123456789,
|
|
114
|
+
"phone": "+447123456789",
|
|
115
|
+
"status": "RECEIVED",
|
|
116
|
+
"sms": [
|
|
117
|
+
{
|
|
118
|
+
"created_at": "2026-03-26T10:30:00Z",
|
|
119
|
+
"text": "Your Claude verification code is: 834291",
|
|
120
|
+
"code": "834291"
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
If `status` is still `PENDING`, wait a few seconds and poll again until the order's current expiry or retry limit.
|
|
127
|
+
|
|
128
|
+
**Polling strategy:** Start around every 5 seconds, respect any upstream retry guidance, and stop at the order's current expiry. Do not create another paid order without a new confirmation.
|
|
129
|
+
|
|
130
|
+
## Step 5: Finish or Cancel
|
|
131
|
+
|
|
132
|
+
### Finish (mark order as completed)
|
|
133
|
+
|
|
134
|
+
After the user has successfully used the verification code:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
npx xapi-to call 5sim-sms.v1_user_finish_id \
|
|
138
|
+
--method GET \
|
|
139
|
+
--input '{"pathParams":{"id":"123456789"}}'
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Cancel
|
|
143
|
+
|
|
144
|
+
If the SMS never arrives or the number doesn't work:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
npx xapi-to call 5sim-sms.v1_user_cancel_id \
|
|
148
|
+
--method GET \
|
|
149
|
+
--input '{"pathParams":{"id":"123456789"}}'
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Read the returned order and balance fields to determine the result. Cancellation does not imply that a refund is either guaranteed or impossible.
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
## Complete Agent Workflow
|
|
156
|
+
|
|
157
|
+
When a user asks to register for a platform using SMS verification:
|
|
158
|
+
|
|
159
|
+
1. Ask which platform (to determine the product name)
|
|
160
|
+
2. Check availability and pricing — suggest the cheapest option with good stock
|
|
161
|
+
3. Show the exact quote and terms, obtain explicit confirmation, then buy one number
|
|
162
|
+
4. Tell the user to enter the number on the platform and request the code
|
|
163
|
+
5. Poll for SMS — check every 5 seconds until received
|
|
164
|
+
6. Show the verification code to the user
|
|
165
|
+
7. Wait for user to confirm they've completed registration
|
|
166
|
+
8. Call finish to confirm, or cancel if something went wrong
|
|
167
|
+
|
|
168
|
+
## API Reference
|
|
169
|
+
|
|
170
|
+
| API | Description |
|
|
171
|
+
|-----------|-------------|
|
|
172
|
+
| `5sim-sms.v1_guest_products_country_operator_product` | Check stock and pricing by country/product |
|
|
173
|
+
| `5sim-sms.v1_guest_products_country_operator` | List all available products |
|
|
174
|
+
| `5sim-sms.v1_guest_countries` | List all supported countries |
|
|
175
|
+
| `5sim-sms.v1_guest_prices` | Query prices by country/product/carrier |
|
|
176
|
+
| `5sim-sms.v1_user_buy_activation_country_operator_product` | Buy a number; inspect the response for billing state |
|
|
177
|
+
| `5sim-sms.v1_user_check_id` | Check order status and SMS content |
|
|
178
|
+
| `5sim-sms.v1_user_finish_id` | Confirm completion under current service terms |
|
|
179
|
+
| `5sim-sms.v1_user_cancel_id` | Request cancellation under current service terms |
|
|
180
|
+
|
|
181
|
+
## Error Handling
|
|
182
|
+
|
|
183
|
+
- **"Bad product"** → Rediscover the current action/product with `search`, `get`, or the products endpoint; do not keep guessing paid inputs.
|
|
184
|
+
- **SMS never arrives** → Inspect the order's allowed cancel/ban actions and terms. Ask before buying another number in a different country.
|
|
185
|
+
- **Insufficient balance** → Top up: `npx xapi-to topup --method stripe --amount 10`
|
|
186
|
+
- **Number rejected by platform** → Some platforms block certain countries. Try USA or UK numbers.
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
# TikTok Guide
|
|
2
|
+
|
|
3
|
+
Complete guide for TikTok operations via xAPI — user profiles, videos, comments, search, hashtags, music, live rooms, and recommended feed.
|
|
4
|
+
|
|
5
|
+
> **Dynamic catalog:** These are database-registered third-party APIs under the `tiktok` service. Exact action IDs, HTTP methods, parameters, and response fields can change. Run `search` and `get` before calling; the current schema wins. Examples below reflect one known GET-based version and keep `"method":"GET"` in the input for compatibility.
|
|
6
|
+
|
|
7
|
+
## Contents
|
|
8
|
+
|
|
9
|
+
- [User data](#user-data)
|
|
10
|
+
- [Video data](#video-data)
|
|
11
|
+
- [Search](#search)
|
|
12
|
+
- [Hashtags](#hashtags)
|
|
13
|
+
- [Music](#music)
|
|
14
|
+
- [Live](#live)
|
|
15
|
+
- [Feed](#feed)
|
|
16
|
+
- [Common workflows](#common-workflows)
|
|
17
|
+
- [Pagination](#pagination-patterns)
|
|
18
|
+
- [API reference](#api-reference)
|
|
19
|
+
- [Error handling](#error-handling)
|
|
20
|
+
|
|
21
|
+
## User Data
|
|
22
|
+
|
|
23
|
+
### Get user profile
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_handler__user__profile \
|
|
27
|
+
--input '{"method":"GET","params":{"unique_id":"tiktok"}}'
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Look up a user by `unique_id` (username), `user_id` (numeric), or `sec_user_id`. At least one must be provided.
|
|
31
|
+
|
|
32
|
+
Returns `data.data.user` with fields: `uid`, `unique_id`, `nickname`, `signature`, `follower_count`, `following_count`, `total_favorited`, `aweme_count`, `avatar_thumb`, `avatar_medium`, `sec_uid`.
|
|
33
|
+
|
|
34
|
+
**Important:** The user profile returns `sec_uid`, but other TikTok APIs expect the parameter name `sec_user_id`. Pass the value of `sec_uid` as `sec_user_id` when calling other endpoints.
|
|
35
|
+
|
|
36
|
+
### Get user_id and sec_user_id by username
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_get__user__id__and__sec__user__id__by__username \
|
|
40
|
+
--input '{"method":"GET","params":{"username":"tiktok"}}'
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Important:** Many TikTok actions require `sec_user_id` instead of the username. Use this endpoint or `handler_user_profile` to get it first.
|
|
44
|
+
|
|
45
|
+
### Get user's videos
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_fetch__user__post__videos \
|
|
49
|
+
--input '{"method":"GET","params":{"unique_id":"tiktok","count":10}}'
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Can also pass `sec_user_id` instead of `unique_id`. Paginate with `max_cursor` from previous response.
|
|
53
|
+
|
|
54
|
+
Optional parameters:
|
|
55
|
+
- `count` — items per page
|
|
56
|
+
- `sort_type` — sort type
|
|
57
|
+
- `max_cursor` — pagination cursor
|
|
58
|
+
|
|
59
|
+
For faster response with simplified data, use the V3 endpoint: `tiktok.api_v1_tiktok_app_v3_fetch__user__post__videos__v3`.
|
|
60
|
+
|
|
61
|
+
### Get user's liked videos
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_fetch__user__like__videos \
|
|
65
|
+
--input '{"method":"GET","params":{"sec_user_id":"<sec_user_id>","counts":10}}'
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Requires `sec_user_id`. Paginate with `max_cursor`. Note: the parameter is `counts` (with 's'), not `count`.
|
|
69
|
+
|
|
70
|
+
### Get followers / following
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# Followers
|
|
74
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_fetch__user__follower__list \
|
|
75
|
+
--input '{"method":"GET","params":{"user_id":"107955","count":20}}'
|
|
76
|
+
|
|
77
|
+
# Following
|
|
78
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_fetch__user__following__list \
|
|
79
|
+
--input '{"method":"GET","params":{"user_id":"107955","count":20}}'
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Pass either `user_id` or `sec_user_id`. Paginate with `min_time` and `page_token` from previous response.
|
|
83
|
+
|
|
84
|
+
### Get similar user recommendations
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_fetch__similar__user__recommendations \
|
|
88
|
+
--input '{"method":"GET","params":{"user_id":"107955"}}'
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Video Data
|
|
92
|
+
|
|
93
|
+
### Get video by ID
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_fetch__one__video__v2 \
|
|
97
|
+
--input '{"method":"GET","params":{"aweme_id":"<video_id>"}}'
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
The `aweme_id` is the numeric video ID. Returns full video data including `desc`, `statistics`, `author`, `music`, `video` (with play URLs).
|
|
101
|
+
|
|
102
|
+
### Get video by share URL
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_fetch__one__video__by__share__url__v2 \
|
|
106
|
+
--input '{"method":"GET","params":{"share_url":"https://www.tiktok.com/@user/video/1234567890"}}'
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Batch get videos
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_fetch__multi__video__v2 \
|
|
113
|
+
--input '{"method":"GET","params":{"aweme_ids":"id1,id2,id3"}}'
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Get video comments
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_fetch__video__comments \
|
|
120
|
+
--input '{"method":"GET","params":{"aweme_id":"<video_id>","count":20,"cursor":0}}'
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Paginate with `cursor`.
|
|
124
|
+
|
|
125
|
+
### Get comment replies
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_fetch__video__comment__replies \
|
|
129
|
+
--input '{"method":"GET","params":{"item_id":"<video_id>","comment_id":"<comment_id>","count":20,"cursor":0}}'
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Search
|
|
133
|
+
|
|
134
|
+
### General search (comprehensive)
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_fetch__general__search__result \
|
|
138
|
+
--input '{"method":"GET","params":{"keyword":"cat","count":10}}'
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Returns mixed results (videos, users, hashtags). Paginate with `offset`.
|
|
142
|
+
|
|
143
|
+
Optional parameters:
|
|
144
|
+
- `sort_type` — sort type
|
|
145
|
+
- `publish_time` — publish time filter
|
|
146
|
+
|
|
147
|
+
### Video search
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_fetch__video__search__result \
|
|
151
|
+
--input '{"method":"GET","params":{"keyword":"cooking","count":10}}'
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Optional: `region`, `sort_type`, `publish_time`. Paginate with `offset`.
|
|
155
|
+
|
|
156
|
+
### User search
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_fetch__user__search__result \
|
|
160
|
+
--input '{"method":"GET","params":{"keyword":"chef","count":10}}'
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Optional filters: `user_search_follower_count`, `user_search_profile_type`. Paginate with `offset`.
|
|
164
|
+
|
|
165
|
+
### Music search
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_fetch__music__search__result \
|
|
169
|
+
--input '{"method":"GET","params":{"keyword":"pop","count":10}}'
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Optional: `region`, `filter_by`, `sort_type`. Paginate with `offset`.
|
|
173
|
+
|
|
174
|
+
### Hashtag search
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_fetch__hashtag__search__result \
|
|
178
|
+
--input '{"method":"GET","params":{"keyword":"dance","count":10}}'
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Paginate with `offset`.
|
|
182
|
+
|
|
183
|
+
## Hashtags
|
|
184
|
+
|
|
185
|
+
### Get hashtag details
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_fetch__hashtag__detail \
|
|
189
|
+
--input '{"method":"GET","params":{"ch_id":"<hashtag_id>"}}'
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Get hashtag video list
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_fetch__hashtag__video__list \
|
|
196
|
+
--input '{"method":"GET","params":{"ch_id":"<hashtag_id>","count":20,"cursor":0}}'
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Paginate with `cursor`.
|
|
200
|
+
|
|
201
|
+
## Music
|
|
202
|
+
|
|
203
|
+
### Get music details
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_fetch__music__detail \
|
|
207
|
+
--input '{"method":"GET","params":{"music_id":"<music_id>"}}'
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Get videos using a music
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_fetch__music__video__list \
|
|
214
|
+
--input '{"method":"GET","params":{"music_id":"<music_id>","count":20,"cursor":0}}'
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Paginate with `cursor`.
|
|
218
|
+
|
|
219
|
+
## Live
|
|
220
|
+
|
|
221
|
+
### Get live room info
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_fetch__live__room__info \
|
|
225
|
+
--input '{"method":"GET","params":{"room_id":"<room_id>"}}'
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Check if live room is online
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_check__live__room__online \
|
|
232
|
+
--input '{"method":"GET","params":{"room_id":"<room_id>"}}'
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### Batch check live rooms online
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_check__live__room__online__batch \
|
|
239
|
+
--input '{"method":"GET","params":{"room_ids":"id1,id2,id3"}}'
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Get live search results
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_fetch__live__search__result \
|
|
246
|
+
--input '{"method":"GET","params":{"keyword":"gaming"}}'
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## Feed
|
|
250
|
+
|
|
251
|
+
### Get home feed (recommended videos)
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
npx xapi-to call tiktok.api_v1_tiktok_app_v3_fetch__home__feed \
|
|
255
|
+
--input '{"method":"GET","params":{}}'
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Returns recommended "For You" page videos. **Note:** This endpoint may return empty results depending on account/region configuration.
|
|
259
|
+
|
|
260
|
+
## Common Workflows
|
|
261
|
+
|
|
262
|
+
### Research a TikTok creator
|
|
263
|
+
|
|
264
|
+
1. Look up user: `tiktok...handler__user__profile` with `unique_id` → get `uid`, `sec_user_id`, follower stats
|
|
265
|
+
2. Get videos: `tiktok...fetch__user__post__videos` → browse recent content
|
|
266
|
+
3. Check engagement: view `statistics` in each video (play count, likes, comments, shares)
|
|
267
|
+
|
|
268
|
+
### Analyze a TikTok video
|
|
269
|
+
|
|
270
|
+
1. Get video: `tiktok...fetch__one__video__v2` with `aweme_id` → full video data
|
|
271
|
+
2. Read comments: `tiktok...fetch__video__comments` → top comments
|
|
272
|
+
3. Get replies: `tiktok...fetch__video__comment__replies` → comment threads
|
|
273
|
+
|
|
274
|
+
### Discover content by hashtag
|
|
275
|
+
|
|
276
|
+
1. Search hashtags: `tiktok...fetch__hashtag__search__result` with `keyword` → find hashtag IDs
|
|
277
|
+
2. Get details: `tiktok...fetch__hashtag__detail` with `ch_id` → view count, video count
|
|
278
|
+
3. Browse videos: `tiktok...fetch__hashtag__video__list` → videos using this hashtag
|
|
279
|
+
|
|
280
|
+
## Pagination Patterns
|
|
281
|
+
|
|
282
|
+
| Pattern | Endpoints | How to use |
|
|
283
|
+
|---------|-----------|------------|
|
|
284
|
+
| `max_cursor` | user videos, liked videos | Pass `max_cursor` from previous response |
|
|
285
|
+
| `cursor` | comments, hashtag videos, music videos | Pass `cursor` from previous response |
|
|
286
|
+
| `offset` | all search endpoints | Increment by `count` each page |
|
|
287
|
+
| `min_time` + `page_token` | follower/following lists | Pass both from previous response |
|
|
288
|
+
|
|
289
|
+
## API Reference
|
|
290
|
+
|
|
291
|
+
| API (prefix: `tiktok.api_v1_tiktok_app_v3_`) | Description | Key Params |
|
|
292
|
+
|---|---|---|
|
|
293
|
+
| `handler__user__profile` | Get user profile | `unique_id` or `user_id` or `sec_user_id` |
|
|
294
|
+
| `get__user__id__and__sec__user__id__by__username` | Get IDs by username | `username` |
|
|
295
|
+
| `fetch__user__post__videos` | User's videos | `unique_id` or `sec_user_id`, `count`, `max_cursor` |
|
|
296
|
+
| `fetch__user__post__videos__v3` | User's videos (simplified) | `unique_id` or `sec_user_id`, `count`, `max_cursor` |
|
|
297
|
+
| `fetch__user__like__videos` | User's liked videos | `sec_user_id`, `counts`, `max_cursor` |
|
|
298
|
+
| `fetch__user__follower__list` | User's followers | `user_id` or `sec_user_id`, `count` |
|
|
299
|
+
| `fetch__user__following__list` | User's following | `user_id` or `sec_user_id`, `count` |
|
|
300
|
+
| `fetch__one__video__v2` | Single video | `aweme_id` |
|
|
301
|
+
| `fetch__one__video__by__share__url__v2` | Video by share URL | `share_url` |
|
|
302
|
+
| `fetch__multi__video__v2` | Batch get videos | `aweme_ids` |
|
|
303
|
+
| `fetch__video__comments` | Video comments | `aweme_id`, `count`, `cursor` |
|
|
304
|
+
| `fetch__video__comment__replies` | Comment replies | `item_id`, `comment_id`, `count`, `cursor` |
|
|
305
|
+
| `fetch__general__search__result` | General search | `keyword`, `count`, `offset` |
|
|
306
|
+
| `fetch__video__search__result` | Video search | `keyword`, `count`, `offset` |
|
|
307
|
+
| `fetch__user__search__result` | User search | `keyword`, `count`, `offset` |
|
|
308
|
+
| `fetch__music__search__result` | Music search | `keyword`, `count`, `offset` |
|
|
309
|
+
| `fetch__hashtag__search__result` | Hashtag search | `keyword`, `count`, `offset` |
|
|
310
|
+
| `fetch__hashtag__detail` | Hashtag details | `ch_id` |
|
|
311
|
+
| `fetch__hashtag__video__list` | Hashtag videos | `ch_id`, `count`, `cursor` |
|
|
312
|
+
| `fetch__music__detail` | Music details | `music_id` |
|
|
313
|
+
| `fetch__music__video__list` | Music videos | `music_id`, `count`, `cursor` |
|
|
314
|
+
| `fetch__live__room__info` | Live room info | `room_id` |
|
|
315
|
+
| `check__live__room__online` | Check live online | `room_id` |
|
|
316
|
+
| `fetch__home__feed` | Home feed | — |
|
|
317
|
+
|
|
318
|
+
## Error Handling
|
|
319
|
+
|
|
320
|
+
- **Missing sec_user_id** → Use `handler_user_profile` or `get_user_id_and_sec_user_id_by_username` to get it first
|
|
321
|
+
- **Empty results** → Check that `aweme_id`, `ch_id`, or `music_id` is valid
|
|
322
|
+
- **Pagination exhausted** → When `has_more` is `0` or `false`, no more pages available
|