xapi-to 0.1.18 → 0.1.19

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.
@@ -0,0 +1,312 @@
1
+ # Reddit Guide
2
+
3
+ Complete guide for Reddit operations via xAPI — user profiles, posts, comments, subreddit feeds, popular/news/games feeds, trending, and search suggestions.
4
+
5
+ > **Dynamic catalog:** These are database-registered third-party APIs under the `reddit` 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
+ **Tip:** Most endpoints accept `need_format` (boolean). Set it to `true` for cleaner, pre-processed responses; omit or set `false` for raw Reddit data.
8
+
9
+ ## Contents
10
+
11
+ - [User data](#user-data)
12
+ - [Post data](#post-data)
13
+ - [Subreddit data](#subreddit-data)
14
+ - [Feeds](#feeds)
15
+ - [Search and trending](#search--trending)
16
+ - [Common workflows](#common-workflows)
17
+ - [Pagination](#pagination)
18
+ - [Reddit ID prefixes](#reddit-id-prefixes)
19
+ - [API reference](#api-reference)
20
+ - [Error handling](#error-handling)
21
+
22
+ ## User Data
23
+
24
+ ### Get user profile
25
+
26
+ ```bash
27
+ npx xapi-to call reddit.api_v1_reddit_app_fetch__user__profile \
28
+ --input '{"method":"GET","params":{"username":"spez","need_format":true}}'
29
+ ```
30
+
31
+ Returns `data.data.redditorInfoByName` with fields: `id` (e.g. `t2_1w72`), `name`, `prefixedName`, `isEmployee`, `isVerified`, `accountType`, `karma` (total, fromPosts, fromComments), `profile` (createdAt, subscribersCount, publicDescriptionText, styles).
32
+
33
+ ### Get user's posts
34
+
35
+ ```bash
36
+ npx xapi-to call reddit.api_v1_reddit_app_fetch__user__posts \
37
+ --input '{"method":"GET","params":{"username":"spez","sort":"TOP","need_format":true}}'
38
+ ```
39
+
40
+ Optional parameters:
41
+ - `sort` — `NEW`, `TOP`, `HOT`, `CONTROVERSIAL`
42
+ - `after` — pagination cursor from previous response
43
+
44
+ ### Get user's comments
45
+
46
+ ```bash
47
+ npx xapi-to call reddit.api_v1_reddit_app_fetch__user__comments \
48
+ --input '{"method":"GET","params":{"username":"spez","sort":"TOP","need_format":true}}'
49
+ ```
50
+
51
+ Optional parameters:
52
+ - `sort` — `NEW`, `TOP`, `HOT`, `CONTROVERSIAL`
53
+ - `after` — pagination cursor
54
+ - `page_size` — items per page (default: 25)
55
+
56
+ ### Get user's active subreddits
57
+
58
+ ```bash
59
+ npx xapi-to call reddit.api_v1_reddit_app_fetch__user__active__subreddits \
60
+ --input '{"method":"GET","params":{"username":"spez","need_format":true}}'
61
+ ```
62
+
63
+ ### Get user's trophies
64
+
65
+ ```bash
66
+ npx xapi-to call reddit.api_v1_reddit_app_fetch__user__trophies \
67
+ --input '{"method":"GET","params":{"username":"spez","need_format":true}}'
68
+ ```
69
+
70
+ ## Post Data
71
+
72
+ ### Get single post details
73
+
74
+ ```bash
75
+ npx xapi-to call reddit.api_v1_reddit_app_fetch__post__details \
76
+ --input '{"method":"GET","params":{"post_id":"t3_1ojnh50","need_format":true}}'
77
+ ```
78
+
79
+ The `post_id` must include the `t3_` prefix. To jump to a specific comment within the post, set `include_comment_id` to `true` and pass the `comment_id`.
80
+
81
+ ### Batch get post details
82
+
83
+ ```bash
84
+ npx xapi-to call reddit.api_v1_reddit_app_fetch__post__details__batch \
85
+ --input '{"method":"GET","params":{"post_ids":"t3_1ojnh50,t3_1abc123","need_format":true}}'
86
+ ```
87
+
88
+ Comma-separated, up to 5 post IDs per request.
89
+
90
+ ### Get post comments
91
+
92
+ ```bash
93
+ npx xapi-to call reddit.api_v1_reddit_app_fetch__post__comments \
94
+ --input '{"method":"GET","params":{"post_id":"t3_1ojnh50","sort_type":"TOP","need_format":true}}'
95
+ ```
96
+
97
+ Optional parameters:
98
+ - `sort_type` — `CONFIDENCE`, `NEW`, `TOP`, `HOT`, `CONTROVERSIAL`, `OLD`, `RANDOM`
99
+ - `after` — pagination cursor
100
+
101
+ ### Get comment replies
102
+
103
+ ```bash
104
+ npx xapi-to call reddit.api_v1_reddit_app_fetch__comment__replies \
105
+ --input '{"method":"GET","params":{"post_id":"t3_1qmup73","cursor":"commenttree:ex:(RjiJd)","need_format":true}}'
106
+ ```
107
+
108
+ Both `post_id` and `cursor` are required. The `cursor` value comes from the `more.cursor` field in comment responses.
109
+
110
+ Optional: `sort_type` — same options as post comments.
111
+
112
+ ## Subreddit Data
113
+
114
+ ### Get subreddit info
115
+
116
+ ```bash
117
+ npx xapi-to call reddit.api_v1_reddit_app_fetch__subreddit__info \
118
+ --input '{"method":"GET","params":{"subreddit_name":"bitcoin","need_format":true}}'
119
+ ```
120
+
121
+ Returns `data.data.subredditInfoByName` with: `id`, `name`, `prefixedName`, `title`, `description`, `publicDescriptionText`, `subscribersCount`, `styles`.
122
+
123
+ ### Get subreddit feed
124
+
125
+ ```bash
126
+ npx xapi-to call reddit.api_v1_reddit_app_fetch__subreddit__feed \
127
+ --input '{"method":"GET","params":{"subreddit_name":"programming","sort":"HOT","need_format":true}}'
128
+ ```
129
+
130
+ Optional parameters:
131
+ - `sort` — `BEST`, `HOT`, `NEW`, `TOP`, `CONTROVERSIAL`, `RISING`
132
+ - `after` — pagination cursor
133
+ - `filter_posts` — array of post IDs to exclude
134
+
135
+ ### Get subreddit style
136
+
137
+ ```bash
138
+ npx xapi-to call reddit.api_v1_reddit_app_fetch__subreddit__style \
139
+ --input '{"method":"GET","params":{"subreddit_name":"bitcoin","need_format":true}}'
140
+ ```
141
+
142
+ Returns the subreddit's visual theme info (banner, icon, colors).
143
+
144
+ ### Get subreddit post channels
145
+
146
+ ```bash
147
+ npx xapi-to call reddit.api_v1_reddit_app_fetch__subreddit__post__channels \
148
+ --input '{"method":"GET","params":{"subreddit_name":"bitcoin","sort":"HOT","need_format":true}}'
149
+ ```
150
+
151
+ Optional parameters:
152
+ - `sort` — `HOT`, `NEW`, `TOP`, `CONTROVERSIAL`, `RISING`
153
+ - `range` — `HOUR`, `DAY`, `WEEK`, `MONTH`, `YEAR`, `ALL`
154
+
155
+ ### Check if subreddit is muted
156
+
157
+ ```bash
158
+ npx xapi-to call reddit.api_v1_reddit_app_check__subreddit__muted \
159
+ --input '{"method":"GET","params":{"subreddit_id":"t5_2s3qj","need_format":true}}'
160
+ ```
161
+
162
+ Requires the subreddit ID with `t5_` prefix (get it from subreddit info).
163
+
164
+ ### Get community highlights
165
+
166
+ ```bash
167
+ npx xapi-to call reddit.api_v1_reddit_app_fetch__community__highlights \
168
+ --input '{"method":"GET","params":{"subreddit_id":"t5_2s3qj","need_format":true}}'
169
+ ```
170
+
171
+ Requires `subreddit_id` with `t5_` prefix.
172
+
173
+ ## Feeds
174
+
175
+ ### Get popular feed
176
+
177
+ ```bash
178
+ npx xapi-to call reddit.api_v1_reddit_app_fetch__popular__feed \
179
+ --input '{"method":"GET","params":{"sort":"HOT","need_format":true}}'
180
+ ```
181
+
182
+ Returns `data.data.posts[]` with post objects and `after` for pagination.
183
+
184
+ Each post includes: `id`, `postTitle`, `url`, `score`, `commentCount`, `subreddit`, `authorInfo`, `permalink`, `postHint`, `upvoteRatio`, `createdAt`, `isNsfw`, `isSpoiler`, `media`, `thumbnail`.
185
+
186
+ Optional parameters:
187
+ - `sort` — `BEST`, `HOT`, `NEW`, `TOP`, `CONTROVERSIAL`, `RISING`
188
+ - `time` — `ALL`, `HOUR`, `DAY`, `WEEK`, `MONTH`, `YEAR`
189
+ - `after` — pagination cursor
190
+ - `filter_posts` — array of post IDs to exclude
191
+
192
+ ### Get news feed
193
+
194
+ ```bash
195
+ npx xapi-to call reddit.api_v1_reddit_app_fetch__news__feed \
196
+ --input '{"method":"GET","params":{"need_format":true}}'
197
+ ```
198
+
199
+ Optional parameters:
200
+ - `after` — pagination cursor
201
+ - `subtopic_ids` — array of subtopic IDs to filter
202
+
203
+ ### Get games feed
204
+
205
+ ```bash
206
+ npx xapi-to call reddit.api_v1_reddit_app_fetch__games__feed \
207
+ --input '{"method":"GET","params":{"sort":"HOT","need_format":true}}'
208
+ ```
209
+
210
+ Optional: `sort`, `time`, `after`.
211
+
212
+ ## Search & Trending
213
+
214
+ ### Get trending searches
215
+
216
+ ```bash
217
+ npx xapi-to call reddit.api_v1_reddit_app_fetch__trending__searches \
218
+ --input '{"method":"GET","params":{"need_format":true}}'
219
+ ```
220
+
221
+ Returns current trending search queries on Reddit.
222
+
223
+ ### Search typeahead (suggestions)
224
+
225
+ ```bash
226
+ npx xapi-to call reddit.api_v1_reddit_app_fetch__search__typeahead \
227
+ --input '{"method":"GET","params":{"query":"bitcoin","need_format":true}}'
228
+ ```
229
+
230
+ Returns search suggestions including query completions and matching subreddits.
231
+
232
+ Optional parameters:
233
+ - `allow_nsfw` — `"0"` or `"1"`
234
+ - `safe_search` — `"unset"` or `"strict"`
235
+
236
+ ## Common Workflows
237
+
238
+ ### Research a Reddit user
239
+
240
+ 1. Get profile: `reddit...fetch__user__profile` → karma, account age, description
241
+ 2. Get posts: `reddit...fetch__user__posts` with `sort=TOP` → most popular posts
242
+ 3. Get comments: `reddit...fetch__user__comments` → user's comment activity
243
+ 4. Active subreddits: `reddit...fetch__user__active__subreddits` → community participation
244
+
245
+ ### Monitor a subreddit
246
+
247
+ 1. Get info: `reddit...fetch__subreddit__info` → subscriber count, description
248
+ 2. Get feed: `reddit...fetch__subreddit__feed` with `sort=HOT` → trending posts
249
+ 3. Read post: `reddit...fetch__post__details` → full post content
250
+ 4. Read comments: `reddit...fetch__post__comments` with `sort_type=TOP` → top comments
251
+
252
+ ### Track what's trending
253
+
254
+ 1. Trending: `reddit...fetch__trending__searches` → current trending topics
255
+ 2. Popular feed: `reddit...fetch__popular__feed` with `sort=HOT` → top posts across Reddit
256
+ 3. News feed: `reddit...fetch__news__feed` → latest news posts
257
+
258
+ ### Deep-dive a post thread
259
+
260
+ 1. Get post: `reddit...fetch__post__details` with `post_id` → post content
261
+ 2. Get comments: `reddit...fetch__post__comments` with `sort_type=TOP` → top-level comments
262
+ 3. Get replies: `reddit...fetch__comment__replies` with `cursor` → expand comment threads
263
+
264
+ ## Pagination
265
+
266
+ All paginated endpoints use the `after` cursor pattern (except comment replies which use `cursor`):
267
+
268
+ 1. Make the initial request without `after`
269
+ 2. Extract `after` from the response (e.g. `data.data.after` or from `pageInfo.endCursor`)
270
+ 3. Pass `after` in the next request to get the next page
271
+ 4. When `after` is `null` or response has no more data, pagination is exhausted
272
+
273
+ ## Reddit ID Prefixes
274
+
275
+ | Prefix | Type | Example |
276
+ |--------|------|---------|
277
+ | `t1_` | Comment | `t1_abc123` |
278
+ | `t2_` | User | `t2_1w72` |
279
+ | `t3_` | Post/Link | `t3_1ojnh50` |
280
+ | `t5_` | Subreddit | `t5_2s3qj` |
281
+
282
+ ## API Reference
283
+
284
+ | API (prefix: `reddit.api_v1_reddit_app_`) | Description | Key Params |
285
+ |---|---|---|
286
+ | `fetch__user__profile` | User profile | `username`* |
287
+ | `fetch__user__posts` | User's posts | `username`*, `sort`, `after` |
288
+ | `fetch__user__comments` | User's comments | `username`*, `sort`, `after`, `page_size` |
289
+ | `fetch__user__active__subreddits` | User's active subreddits | `username`* |
290
+ | `fetch__user__trophies` | User's trophies | `username`* |
291
+ | `fetch__post__details` | Single post details | `post_id`* |
292
+ | `fetch__post__details__batch` | Batch post details (up to 5) | `post_ids`* |
293
+ | `fetch__post__comments` | Post comments | `post_id`*, `sort_type`, `after` |
294
+ | `fetch__comment__replies` | Comment replies | `post_id`*, `cursor`*, `sort_type` |
295
+ | `fetch__subreddit__info` | Subreddit info | `subreddit_name` |
296
+ | `fetch__subreddit__feed` | Subreddit feed | `subreddit_name`*, `sort`, `after` |
297
+ | `fetch__subreddit__style` | Subreddit style/theme | `subreddit_name` |
298
+ | `fetch__subreddit__post__channels` | Subreddit post channels | `subreddit_name`, `sort`, `range` |
299
+ | `check__subreddit__muted` | Check subreddit muted | `subreddit_id`* |
300
+ | `fetch__community__highlights` | Community highlights | `subreddit_id`* |
301
+ | `fetch__popular__feed` | Popular feed | `sort`, `time`, `after` |
302
+ | `fetch__news__feed` | News feed | `after`, `subtopic_ids` |
303
+ | `fetch__games__feed` | Games feed | `sort`, `time`, `after` |
304
+ | `fetch__trending__searches` | Trending searches | — |
305
+ | `fetch__search__typeahead` | Search suggestions | `query`* |
306
+
307
+ ## Error Handling
308
+
309
+ - **Missing t3_ prefix** → Post IDs must include the `t3_` prefix (e.g. `t3_1ojnh50`, not just `1ojnh50`)
310
+ - **Empty results** → Verify the username or subreddit_name exists
311
+ - **Pagination exhausted** → `after` is `null` or missing in the response
312
+ - **Comment replies require cursor** → Get the `cursor` value from the `more` field in comment responses
@@ -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.