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,297 @@
1
+ # Douyin (抖音) Guide
2
+
3
+ Complete guide for Douyin (抖音) operations via xAPI — user profiles, videos, comments, hot search, hashtags, music, and video statistics.
4
+
5
+ > **Dynamic catalog:** These are database-registered third-party APIs under the `douyin` 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
+ - [Video mixes](#video-mix-合集)
12
+ - [Hot search](#hot-search-热搜)
13
+ - [Hashtags](#hashtags)
14
+ - [Music](#music)
15
+ - [Common workflows](#common-workflows)
16
+ - [Pagination](#pagination-patterns)
17
+ - [API reference](#api-reference)
18
+ - [Error handling](#error-handling)
19
+
20
+ ## User Data
21
+
22
+ ### Get user profile
23
+
24
+ ```bash
25
+ npx xapi-to call douyin.api_v1_douyin_app_v3_handler__user__profile \
26
+ --input '{"method":"GET","params":{"sec_user_id":"<sec_user_id>"}}'
27
+ ```
28
+
29
+ Requires `sec_user_id`. Returns user info at `data.data.user`.
30
+
31
+ ### Get user's videos
32
+
33
+ ```bash
34
+ npx xapi-to call douyin.api_v1_douyin_app_v3_fetch__user__post__videos \
35
+ --input '{"method":"GET","params":{"sec_user_id":"<sec_user_id>","count":10}}'
36
+ ```
37
+
38
+ Requires `sec_user_id`. Paginate with `max_cursor`. Optional: `sort_type`.
39
+
40
+ ### Get user's liked videos
41
+
42
+ ```bash
43
+ npx xapi-to call douyin.api_v1_douyin_app_v3_fetch__user__like__videos \
44
+ --input '{"method":"GET","params":{"sec_user_id":"<sec_user_id>","counts":10}}'
45
+ ```
46
+
47
+ Requires `sec_user_id`. Paginate with `max_cursor`. Note: the parameter is `counts` (with 's'), not `count`.
48
+
49
+ ### Get user fans list
50
+
51
+ ```bash
52
+ npx xapi-to call douyin.api_v1_douyin_app_v3_fetch__user__fans__list \
53
+ --input '{"method":"GET","params":{"sec_user_id":"<sec_user_id>","count":20}}'
54
+ ```
55
+
56
+ Paginate with `max_time`.
57
+
58
+ ### Get user series list
59
+
60
+ ```bash
61
+ npx xapi-to call douyin.api_v1_douyin_app_v3_fetch__user__series__list \
62
+ --input '{"method":"GET","params":{"sec_user_id":"<sec_user_id>"}}'
63
+ ```
64
+
65
+ ## Video Data
66
+
67
+ ### Get video by ID
68
+
69
+ ```bash
70
+ npx xapi-to call douyin.api_v1_douyin_app_v3_fetch__one__video \
71
+ --input '{"method":"GET","params":{"aweme_id":"<video_id>"}}'
72
+ ```
73
+
74
+ Also available: V2 (`fetch__one__video__v2`) and V3 (`fetch__one__video__v3`, no copyright restrictions).
75
+
76
+ ### Get video by share URL
77
+
78
+ ```bash
79
+ npx xapi-to call douyin.api_v1_douyin_app_v3_fetch__one__video__by__share__url \
80
+ --input '{"method":"GET","params":{"share_url":"https://v.douyin.com/xxxxx/"}}'
81
+ ```
82
+
83
+ ### Batch get videos
84
+
85
+ ```bash
86
+ npx xapi-to call douyin.api_v1_douyin_app_v3_fetch__multi__video \
87
+ --input '{"method":"GET","params":{"aweme_ids":"id1,id2,id3"}}'
88
+ ```
89
+
90
+ Also available: V2 (`fetch__multi__video__v2`).
91
+
92
+ ### Get video statistics
93
+
94
+ ```bash
95
+ npx xapi-to call douyin.api_v1_douyin_app_v3_fetch__video__statistics \
96
+ --input '{"method":"GET","params":{"aweme_ids":"<video_id>"}}'
97
+ ```
98
+
99
+ Returns like count, download count, play count, share count. Supports comma-separated IDs for batch queries.
100
+
101
+ ### Get high quality play URL
102
+
103
+ ```bash
104
+ npx xapi-to call douyin.api_v1_douyin_app_v3_fetch__video__high__quality__play__url \
105
+ --input '{"method":"GET","params":{"aweme_id":"<video_id>"}}'
106
+ ```
107
+
108
+ Returns the highest quality video play URL.
109
+
110
+ ### Get video comments
111
+
112
+ ```bash
113
+ npx xapi-to call douyin.api_v1_douyin_app_v3_fetch__video__comments \
114
+ --input '{"method":"GET","params":{"aweme_id":"<video_id>","count":20,"cursor":0}}'
115
+ ```
116
+
117
+ Paginate with `cursor`.
118
+
119
+ ### Get comment replies
120
+
121
+ ```bash
122
+ npx xapi-to call douyin.api_v1_douyin_app_v3_fetch__video__comment__replies \
123
+ --input '{"method":"GET","params":{"item_id":"<video_id>","comment_id":"<comment_id>","count":20,"cursor":0}}'
124
+ ```
125
+
126
+ ## Video Mix (合集)
127
+
128
+ ### Get video mix detail
129
+
130
+ ```bash
131
+ npx xapi-to call douyin.api_v1_douyin_app_v3_fetch__video__mix__detail \
132
+ --input '{"method":"GET","params":{"mix_id":"<mix_id>"}}'
133
+ ```
134
+
135
+ ### Get video mix post list
136
+
137
+ ```bash
138
+ npx xapi-to call douyin.api_v1_douyin_app_v3_fetch__video__mix__post__list \
139
+ --input '{"method":"GET","params":{"mix_id":"<mix_id>","count":20,"cursor":0}}'
140
+ ```
141
+
142
+ Paginate with `cursor`.
143
+
144
+ ### Get series detail
145
+
146
+ ```bash
147
+ npx xapi-to call douyin.api_v1_douyin_app_v3_fetch__series__detail \
148
+ --input '{"method":"GET","params":{"series_id":"<series_id>"}}'
149
+ ```
150
+
151
+ ### Get series video list
152
+
153
+ ```bash
154
+ npx xapi-to call douyin.api_v1_douyin_app_v3_fetch__series__video__list \
155
+ --input '{"method":"GET","params":{"series_id":"<series_id>"}}'
156
+ ```
157
+
158
+ ## Hot Search (热搜)
159
+
160
+ ### Get Douyin hot search list
161
+
162
+ ```bash
163
+ npx xapi-to call douyin.api_v1_douyin_app_v3_fetch__hot__search__list \
164
+ --input '{"method":"GET","params":{}}'
165
+ ```
166
+
167
+ Returns ~50 trending topics at `data.data.data.word_list[]`. Most entries have fields: `word` (topic title), `hot_value`, `view_count`, `event_time`, `position`. Pinned/top entries may only have `word`, `hot_value`, `view_count` without `event_time` or `position`.
168
+
169
+ Optional: `board_type`, `board_sub_type` for different ranking categories.
170
+
171
+ ### Get brand hot search list
172
+
173
+ ```bash
174
+ npx xapi-to call douyin.api_v1_douyin_app_v3_fetch__brand__hot__search__list \
175
+ --input '{"method":"GET","params":{}}'
176
+ ```
177
+
178
+ ### Get live hot search list
179
+
180
+ ```bash
181
+ npx xapi-to call douyin.api_v1_douyin_app_v3_fetch__live__hot__search__list \
182
+ --input '{"method":"GET","params":{}}'
183
+ ```
184
+
185
+ ## Hashtags
186
+
187
+ ### Get hashtag details
188
+
189
+ ```bash
190
+ npx xapi-to call douyin.api_v1_douyin_app_v3_fetch__hashtag__detail \
191
+ --input '{"method":"GET","params":{"ch_id":123456}}'
192
+ ```
193
+
194
+ Note: `ch_id` is an **integer** for Douyin.
195
+
196
+ ### Get hashtag video list
197
+
198
+ ```bash
199
+ npx xapi-to call douyin.api_v1_douyin_app_v3_fetch__hashtag__video__list \
200
+ --input '{"method":"GET","params":{"ch_id":"<hashtag_id>","count":20,"cursor":0}}'
201
+ ```
202
+
203
+ Optional: `sort_type` — `0` = comprehensive, `1` = most likes, `2` = latest first.
204
+
205
+ ## Music
206
+
207
+ ### Get music details
208
+
209
+ ```bash
210
+ npx xapi-to call douyin.api_v1_douyin_app_v3_fetch__music__detail \
211
+ --input '{"method":"GET","params":{"music_id":"<music_id>"}}'
212
+ ```
213
+
214
+ ### Get music video list
215
+
216
+ ```bash
217
+ npx xapi-to call douyin.api_v1_douyin_app_v3_fetch__music__video__list \
218
+ --input '{"method":"GET","params":{"music_id":"<music_id>"}}'
219
+ ```
220
+
221
+ ### Get music hot search list
222
+
223
+ ```bash
224
+ npx xapi-to call douyin.api_v1_douyin_app_v3_fetch__music__hot__search__list \
225
+ --input '{"method":"GET","params":{}}'
226
+ ```
227
+
228
+ ## Common Workflows
229
+
230
+ ### Track Douyin trending
231
+
232
+ 1. Hot search: `douyin...fetch__hot__search__list` → top 50 trending topics
233
+ 2. Brand hot search: `douyin...fetch__brand__hot__search__list` → brand trending
234
+ 3. Get video details for a trending topic
235
+
236
+ ### Research a Douyin creator
237
+
238
+ 1. Get profile: `douyin...handler__user__profile` with `sec_user_id` → user info
239
+ 2. Get videos: `douyin...fetch__user__post__videos` → browse recent posts
240
+ 3. Get stats: `douyin...fetch__video__statistics` → batch check engagement metrics
241
+
242
+ ### Analyze a Douyin video
243
+
244
+ 1. Get video: `douyin...fetch__one__video` with `aweme_id` → full video data
245
+ 2. Get stats: `douyin...fetch__video__statistics` → play count, likes, downloads, shares
246
+ 3. Read comments: `douyin...fetch__video__comments` → top comments
247
+ 4. Get replies: `douyin...fetch__video__comment__replies` → comment threads
248
+
249
+ ### Browse a video series
250
+
251
+ 1. Get series: `douyin...fetch__series__detail` or `douyin...fetch__video__mix__detail`
252
+ 2. List videos: `douyin...fetch__series__video__list` or `douyin...fetch__video__mix__post__list`
253
+
254
+ ## Pagination Patterns
255
+
256
+ | Pattern | Endpoints | How to use |
257
+ |---------|-----------|------------|
258
+ | `max_cursor` | user videos, liked videos | Pass `max_cursor` from previous response |
259
+ | `cursor` | comments, hashtag videos, mix post list | Pass `cursor` from previous response |
260
+ | `max_time` | fans list | Pass `max_time` from previous response |
261
+
262
+ ## API Reference
263
+
264
+ | API (prefix: `douyin.api_v1_douyin_app_v3_`) | Description | Key Params |
265
+ |---|---|---|
266
+ | `handler__user__profile` | Get user profile | `sec_user_id` |
267
+ | `fetch__user__post__videos` | User's videos | `sec_user_id`, `count`, `max_cursor` |
268
+ | `fetch__user__like__videos` | User's liked videos | `sec_user_id`, `counts`, `max_cursor` |
269
+ | `fetch__user__fans__list` | User's fans | `sec_user_id`, `count`, `max_time` |
270
+ | `fetch__user__series__list` | User's series | `sec_user_id` |
271
+ | `fetch__one__video` | Single video | `aweme_id` |
272
+ | `fetch__one__video__v2` | Single video V2 | `aweme_id` |
273
+ | `fetch__one__video__v3` | Single video V3 (no copyright restrictions) | `aweme_id` |
274
+ | `fetch__one__video__by__share__url` | Video by share URL | `share_url` |
275
+ | `fetch__multi__video` | Batch get videos | `aweme_ids` |
276
+ | `fetch__video__statistics` | Video stats (batch) | `aweme_ids` |
277
+ | `fetch__video__high__quality__play__url` | High quality play URL | `aweme_id` |
278
+ | `fetch__video__comments` | Video comments | `aweme_id`, `count`, `cursor` |
279
+ | `fetch__video__comment__replies` | Comment replies | `item_id`, `comment_id`, `count`, `cursor` |
280
+ | `fetch__video__mix__detail` | Video mix detail | `mix_id` |
281
+ | `fetch__video__mix__post__list` | Video mix posts | `mix_id`, `count`, `cursor` |
282
+ | `fetch__series__detail` | Series detail | `series_id` |
283
+ | `fetch__series__video__list` | Series videos | `series_id` |
284
+ | `fetch__hot__search__list` | Hot search list | `board_type`, `board_sub_type` |
285
+ | `fetch__brand__hot__search__list` | Brand hot search | — |
286
+ | `fetch__live__hot__search__list` | Live hot search | — |
287
+ | `fetch__hashtag__detail` | Hashtag details | `ch_id` (integer) |
288
+ | `fetch__hashtag__video__list` | Hashtag videos | `ch_id`, `count`, `cursor`, `sort_type` |
289
+ | `fetch__music__detail` | Music details | `music_id` |
290
+ | `fetch__music__video__list` | Music videos | `music_id` |
291
+ | `fetch__music__hot__search__list` | Music hot search | — |
292
+
293
+ ## Error Handling
294
+
295
+ - **Missing sec_user_id** → Douyin requires `sec_user_id` for most user-related endpoints; obtain it through other channels
296
+ - **Empty results** → Check that `aweme_id`, `ch_id`, `mix_id`, or `music_id` is valid
297
+ - **Pagination exhausted** → When `has_more` is `0` or `false`, no more pages available
@@ -0,0 +1,194 @@
1
+ # Google Search Guide
2
+
3
+ Complete guide for web search operations via xAPI — general search, realtime search, news, images, videos, scholar, maps, places, and shopping.
4
+
5
+ All search endpoints are capability-type actions under the `web.search` namespace. Parameters are passed directly (no `"method"` or `"params"` wrapper needed).
6
+
7
+ ## Contents
8
+
9
+ - [Common parameters](#common-parameters)
10
+ - [Web search](#web-search)
11
+ - [News, image, video, and scholar search](#news-search)
12
+ - [Maps and places](#maps-search)
13
+ - [Shopping search](#shopping-search)
14
+ - [Common workflows](#common-workflows)
15
+ - [Localization tips](#localization-tips)
16
+ - [API reference](#api-reference)
17
+
18
+ ## Common Parameters
19
+
20
+ All search capabilities accept `q`, `gl`, `hl`, and `page`. Most also accept `autocorrect`; `web.search.realtime` does not expose it and deliberately disables autocorrection. Run `get` before relying on optional parameters.
21
+
22
+ | Parameter | Type | Default | Description |
23
+ |-----------|------|---------|-------------|
24
+ | `q` | string | **(required)** | Search query |
25
+ | `gl` | string | `"us"` | Country code (e.g. `us`, `cn`, `jp`, `de`) |
26
+ | `hl` | string | `"en"` | Language code (e.g. `en`, `zh`, `ja`, `de`) |
27
+ | `page` | number | `1` | Page number for pagination |
28
+ | `autocorrect` | boolean | `true` | Supported by every search capability except `web.search.realtime` |
29
+
30
+ ## Web Search
31
+
32
+ ### General web search
33
+
34
+ ```bash
35
+ npx xapi-to call web.search --input '{"q":"OpenAI GPT-5","num":10}'
36
+ ```
37
+
38
+ Additional parameters:
39
+ - `num` — number of results to return (default 10)
40
+ - `location` — location name for localized results
41
+
42
+ Returns `data.organic[]` with `title`, `link`, `snippet`, and `position`. The declared response also includes optional `data.knowledgeGraph` and `data.relatedSearches[]`.
43
+
44
+ ### Realtime web search
45
+
46
+ ```bash
47
+ npx xapi-to call web.search.realtime --input '{"q":"breaking news","timeRange":"day","num":10}'
48
+ ```
49
+
50
+ For finding the latest content with time-based filtering.
51
+
52
+ Additional parameters:
53
+ - `timeRange` — time filter: `"hour"`, `"day"` (default), `"week"`, `"month"`, `"year"`
54
+ - `num` — number of results (default 10)
55
+ - `location` — location for localized results
56
+
57
+ Returns `data.organic[]` with fields: `title`, `link`, `snippet`, `position`, `date`.
58
+
59
+ ## News Search
60
+
61
+ ```bash
62
+ npx xapi-to call web.search.news --input '{"q":"AI regulation"}'
63
+ ```
64
+
65
+ Search Google News for articles.
66
+
67
+ Additional parameters:
68
+ - `tbs` — date range filter: `"qdr:h"` (past hour), `"qdr:d"` (past 24h), `"qdr:w"` (past week), `"qdr:m"` (past month), `"qdr:y"` (past year)
69
+
70
+ Returns `data.news[]` with fields: `title`, `link`, `snippet`, `date`, `source`, `imageUrl`.
71
+
72
+ ## Image Search
73
+
74
+ ```bash
75
+ npx xapi-to call web.search.image --input '{"q":"aurora borealis"}'
76
+ ```
77
+
78
+ Search Google Images.
79
+
80
+ Additional parameters:
81
+ - `tbs` — date range filter (same values as news)
82
+
83
+ Returns `data.images[]` with fields: `title`, `imageUrl`, `imageWidth`, `imageHeight`, `thumbnailUrl`, `source`, `domain`, `link`.
84
+
85
+ ## Video Search
86
+
87
+ ```bash
88
+ npx xapi-to call web.search.video --input '{"q":"machine learning tutorial"}'
89
+ ```
90
+
91
+ Search Google Videos (primarily YouTube results).
92
+
93
+ Additional parameters:
94
+ - `tbs` — date range filter (same values as news)
95
+
96
+ Returns `data.videos[]` with declared fields `title`, `link`, `snippet`, `channel`, `date`, and `duration`.
97
+
98
+ ## Scholar Search
99
+
100
+ ```bash
101
+ npx xapi-to call web.search.scholar --input '{"q":"transformer architecture attention"}'
102
+ ```
103
+
104
+ Search Google Scholar for academic papers and citations.
105
+
106
+ Returns `data.organic[]` with declared fields `title`, `link`, `snippet`, `publicationInfo`, `citedBy`, and `year`.
107
+
108
+ ## Maps Search
109
+
110
+ ```bash
111
+ npx xapi-to call web.search.maps --input '{"q":"coffee shop near Times Square"}'
112
+ ```
113
+
114
+ Search Google Maps for locations and businesses.
115
+
116
+ Additional parameters:
117
+ - `ll` — latitude/longitude coordinates to center the search (e.g. `"@40.7455096,-74.0083012,14z"`)
118
+
119
+ Returns `data.places[]` with declared fields `title`, `address`, `latitude`, `longitude`, `rating`, `ratingCount`, and `category`.
120
+
121
+ ## Places Search
122
+
123
+ ```bash
124
+ npx xapi-to call web.search.places --input '{"q":"best ramen in Tokyo","gl":"jp"}'
125
+ ```
126
+
127
+ Search for businesses and places with richer contact details. Use this capability when phone number or website is important.
128
+
129
+ Additional parameters:
130
+ - `location` — location name to scope the search (e.g. `"San Francisco, California, United States"`)
131
+ - `ll` — latitude/longitude coordinates (e.g. `"@37.7749295,-122.4194155,14z"`)
132
+
133
+ Returns `data.places[]` with declared fields `title`, `address`, `latitude`, `longitude`, `rating`, `ratingCount`, `category`, `phoneNumber`, and `website`.
134
+
135
+ ## Shopping Search
136
+
137
+ ```bash
138
+ npx xapi-to call web.search.shopping --input '{"q":"mechanical keyboard"}'
139
+ ```
140
+
141
+ Search Google Shopping for products and prices.
142
+
143
+ Additional parameters:
144
+ - `tbs` — date range filter
145
+ - `location` — location affecting prices and availability
146
+
147
+ Returns `data.shopping[]` with declared fields `title`, `source`, `link`, `price`, `rating`, `ratingCount`, and `imageUrl`.
148
+
149
+ The upstream provider can return additional fields that are not part of the capability's declared schema. Treat them as opportunistic: inspect the current `get` output and actual response before depending on them.
150
+
151
+ ## Common Workflows
152
+
153
+ ### Research a topic
154
+
155
+ 1. Web search: `web.search` → get authoritative sources
156
+ 2. News search: `web.search.news` → get latest developments
157
+ 3. Scholar search: `web.search.scholar` → find academic papers
158
+
159
+ ### Monitor breaking news
160
+
161
+ 1. Realtime search: `web.search.realtime` with `timeRange: "hour"` → latest content
162
+ 2. News search: `web.search.news` with `tbs: "qdr:h"` → latest news articles
163
+
164
+ ### Find a local business
165
+
166
+ 1. Maps search: `web.search.maps` with `ll` coordinates → find nearby listings and coordinates
167
+ 2. Places search: `web.search.places` → add phone numbers and websites when the upstream provides them
168
+
169
+ ### Product research
170
+
171
+ 1. Shopping search: `web.search.shopping` → compare prices and ratings
172
+ 2. Web search: `web.search` with `"<product> review"` → find reviews
173
+
174
+ ## Localization Tips
175
+
176
+ - Set `gl` (country) and `hl` (language) together for best results:
177
+ - Chinese results: `"gl":"cn","hl":"zh"`
178
+ - Japanese results: `"gl":"jp","hl":"ja"`
179
+ - German results: `"gl":"de","hl":"de"`
180
+ - Use `location` (for `web.search`, `web.search.realtime`, `web.search.places`, `web.search.shopping`) for city-level localization
181
+
182
+ ## API Reference
183
+
184
+ | Capability | Description | Result Field | Key Result Fields |
185
+ |------------|-------------|--------------|-------------------|
186
+ | `web.search` | General web search | `organic[]` | `title`, `link`, `snippet`, `position` |
187
+ | `web.search.realtime` | Realtime web search | `organic[]` | `title`, `link`, `snippet`, `date` |
188
+ | `web.search.news` | News articles | `news[]` | `title`, `link`, `source`, `date` |
189
+ | `web.search.image` | Image search | `images[]` | `title`, `imageUrl`, `imageWidth`, `imageHeight` |
190
+ | `web.search.video` | Video search | `videos[]` | `title`, `link`, `channel`, `duration` |
191
+ | `web.search.scholar` | Academic papers | `organic[]` | `title`, `link`, `citedBy`, `year` |
192
+ | `web.search.maps` | Map locations | `places[]` | `title`, `address`, `latitude`, `longitude`, `category` |
193
+ | `web.search.places` | Detailed business listings | `places[]` | `title`, `address`, `category`, `phoneNumber`, `website` |
194
+ | `web.search.shopping` | Product search | `shopping[]` | `title`, `price`, `source`, `rating`, `imageUrl` |
@@ -0,0 +1,198 @@
1
+ # LinkedIn Guide
2
+
3
+ Complete guide for LinkedIn operations via xAPI — person profiles with career history, company pages, posts and comments, and job search.
4
+
5
+ > **Dynamic catalog:** These are database-registered third-party APIs under the `linkedin` service. Exact action IDs, HTTP methods, parameters, response fields, charging, and retry behavior can change. Run `search` and `get` before calling; the current schema and live response win. Examples below reflect the `linkedin_web v2` version and keep `"method":"GET"` in the input for compatibility.
6
+
7
+ ## Contents
8
+
9
+ - [Key concept: everything is addressed by URL](#key-concept-everything-is-addressed-by-url)
10
+ - [Person data](#person-data)
11
+ - [Company data](#company-data)
12
+ - [Posts and comments](#posts-and-comments)
13
+ - [Jobs](#jobs)
14
+ - [Common workflows](#common-workflows)
15
+ - [Pagination](#pagination)
16
+ - [API reference](#api-reference)
17
+ - [Error handling](#error-handling)
18
+
19
+ ## Key Concept: everything is addressed by URL
20
+
21
+ Every `linkedin_web v2` endpoint except job search is addressed by an ordinary public LinkedIn page URL passed as `url`. There is no separate ID-resolution step: paste the URL you would open in a browser. The one extra parameter is `urn` on [post comments](#get-comments-on-a-post), and it is derived from the post URL.
22
+
23
+ | Resource | URL shape |
24
+ |----------|-----------|
25
+ | Person | `https://www.linkedin.com/in/<vanity>/` |
26
+ | Company | `https://www.linkedin.com/company/<slug>/` |
27
+ | Post | `https://www.linkedin.com/feed/update/urn:li:activity:<id>/` or `https://www.linkedin.com/posts/<slug>-activity-<id>-<hash>` |
28
+ | Job | `https://www.linkedin.com/jobs/view/<job_id>` |
29
+
30
+ Discover the current endpoint set before relying on any list here:
31
+
32
+ ```bash
33
+ npx xapi-to search "linkedin" --source api
34
+ npx xapi-to get linkedin.api_v1_linkedin_web__v2_get__user__profile
35
+ ```
36
+
37
+ ## Person Data
38
+
39
+ ### Get a profile
40
+
41
+ ```bash
42
+ npx xapi-to call linkedin.api_v1_linkedin_web__v2_get__user__profile \
43
+ --input '{"method":"GET","params":{"url":"https://www.linkedin.com/in/williamhgates/"}}'
44
+ ```
45
+
46
+ One call returns the whole profile — no follow-up requests for individual sections. `data.data` contains:
47
+
48
+ - Identity: `name`, `first_name`, `last_name`, `id` (vanity), `linkedin_id`, `linkedin_num_id`, `url`, `avatar`, `banner_image`, `influencer`
49
+ - Headline & summary: `position`, `about`, `unformatted_about`, `bio_links`
50
+ - Location: `city`, `location`, `country_code`
51
+ - Career: `experience[]`, `current_company`, `current_company_name`, `current_company_company_id`
52
+ - Education: `education[]`, `educations_details`
53
+ - Recognition: `honors_and_awards[]`
54
+ - Social proof: `followers`, `connections`, `activity[]`, `posts[]`
55
+ - Discovery: `people_also_viewed[]`, `similar_profiles[]`
56
+
57
+ There are no separate `get__user__experience` / `educations` / `skills` / `honors` / `publications` endpoints in v2 — that was the older `username` → `urn` two-step API. If you were using those IDs, they now return `Action not found`.
58
+
59
+ ### Get a person's posts
60
+
61
+ ```bash
62
+ npx xapi-to call linkedin.api_v1_linkedin_web__v2_get__user__posts \
63
+ --input '{"method":"GET","params":{"url":"https://www.linkedin.com/in/williamhgates/","page":1}}'
64
+ ```
65
+
66
+ Returns `data.data.data[]` plus `data.data.paging`. Each item carries `urn`, `post_url`, `text`, `time`/`posted`, `poster`, `images[]`, and a reaction breakdown (`num_likes`, `num_comments`, `num_reposts`, `num_reactions`, `num_empathy`, `num_praises`, …).
67
+
68
+ Keep `urn` from here — it is the numeric activity ID that [post comments](#get-comments-on-a-post) additionally requires.
69
+
70
+ ## Company Data
71
+
72
+ ### Get a company page
73
+
74
+ ```bash
75
+ npx xapi-to call linkedin.api_v1_linkedin_web__v2_get__company__profile \
76
+ --input '{"method":"GET","params":{"url":"https://www.linkedin.com/company/anthropicresearch/"}}'
77
+ ```
78
+
79
+ Returns `data.data` with `name`, `company_id`, `about`, `description`, `slogan`, `website`, `industries`, `company_size`, `organization_type`, `followers`, `employees_in_linkedin`, `employees[]`, `locations[]`, `logo`, `image`, `similar[]`, `affiliated[]`, `alumni` / `alumni_information`, `updates[]`.
80
+
81
+ ### Get a company's posts
82
+
83
+ ```bash
84
+ npx xapi-to call linkedin.api_v1_linkedin_web__v2_get__company__posts \
85
+ --input '{"method":"GET","params":{"url":"https://www.linkedin.com/company/anthropicresearch/","page":1}}'
86
+ ```
87
+
88
+ Same envelope as person posts: `data.data.data[]` + `data.data.paging`.
89
+
90
+ ## Posts and Comments
91
+
92
+ ### Get post detail
93
+
94
+ ```bash
95
+ npx xapi-to call linkedin.api_v1_linkedin_web__v2_get__post__detail \
96
+ --input '{"method":"GET","params":{"url":"https://www.linkedin.com/feed/update/urn:li:activity:7490874650621612032/"}}'
97
+ ```
98
+
99
+ Returns the full post: `post_text`, `post_text_html`, `title`, `headline`, `date_posted`, `hashtags[]`, `embedded_links[]`, `images[]`, `videos[]`, `num_likes`, `num_comments`, `top_visible_comments[]`, `repost`, `tagged_people[]`, `tagged_companies[]`, `external_link_data`, plus author context (`user_name`, `user_title`, `user_followers`, `author_profile_pic`).
100
+
101
+ ### Get comments on a post
102
+
103
+ **This endpoint requires two parameters, not one** — `url` *and* `urn`, the bare numeric activity ID. Both are marked required in the schema, and `urn` is pattern-validated as `^[0-9]+$`.
104
+
105
+ ```bash
106
+ npx xapi-to call linkedin.api_v1_linkedin_web__v2_get__post__comments \
107
+ --input '{"method":"GET","params":{"url":"https://www.linkedin.com/feed/update/urn:li:activity:7490874650621612032/","urn":"7490874650621612032","page":1}}'
108
+ ```
109
+
110
+ Extract `urn` from the post URL — the digits after `activity:` (feed form) or after `-activity-` (posts form). Passing the prefixed `urn:li:activity:7490874650621612032` form is rejected by the pattern check before the call is billed.
111
+
112
+ Returns `data.data.data[]` with `text`, `commenter`, `created_at`, `created_datetime`, `permalink`, `pinned`, `replies`, `thread_urn`, plus `data.data.total` and `data.data.pagination_token`.
113
+
114
+ ## Jobs
115
+
116
+ ### Search jobs
117
+
118
+ The one endpoint that is not URL-addressed:
119
+
120
+ ```bash
121
+ npx xapi-to call linkedin.api_v1_linkedin_web__v2_search__jobs \
122
+ --input '{"method":"GET","params":{"keywords":"machine learning engineer","location":"United States","page":1}}'
123
+ ```
124
+
125
+ `keywords` is required; `location` and `page` are optional. Returns `data.data.data[]` (`job_title`, `job_url`, `job_urn`, `company`, `company_linkedin_url`, `company_logo`, `location`, `remote`, `salary`, `posted_time`) plus `data.data.total`.
126
+
127
+ ### Get job detail
128
+
129
+ ```bash
130
+ npx xapi-to call linkedin.api_v1_linkedin_web__v2_get__job__detail \
131
+ --input '{"method":"GET","params":{"url":"https://www.linkedin.com/jobs/view/4442605025"}}'
132
+ ```
133
+
134
+ Returns `data.data.data` with the full JD (`job_description`), `job_title`, `job_type`, `experience_level`, `job_functions[]`, `skills[]`, `salary_details`, `salary_display`, `benefits[]`, `remote_allow`, `applies`, `views`, `posted`, `closed`/`expired`, `hiring_team[]`, and company context (`company_name`, `company_id`, `company_description`, `employee_count`, `industries[]`, `hq_*` address fields).
135
+
136
+ This is the most expensive LinkedIn endpoint — search first, then fetch detail only for the postings you actually care about.
137
+
138
+ ## Common Workflows
139
+
140
+ ### Profile → recent activity
141
+
142
+ ```bash
143
+ # 1. Whole profile in one call
144
+ npx xapi-to call linkedin.api_v1_linkedin_web__v2_get__user__profile \
145
+ --input '{"method":"GET","params":{"url":"https://www.linkedin.com/in/williamhgates/"}}'
146
+
147
+ # 2. Their posts (take `urn` from each item for step 3)
148
+ npx xapi-to call linkedin.api_v1_linkedin_web__v2_get__user__posts \
149
+ --input '{"method":"GET","params":{"url":"https://www.linkedin.com/in/williamhgates/","page":1}}'
150
+
151
+ # 3. Comments on one post — url AND numeric urn
152
+ npx xapi-to call linkedin.api_v1_linkedin_web__v2_get__post__comments \
153
+ --input '{"method":"GET","params":{"url":"<post_url>","urn":"<urn>","page":1}}'
154
+ ```
155
+
156
+ ### Job hunt
157
+
158
+ ```bash
159
+ # 1. Search (cheap, paginated)
160
+ npx xapi-to call linkedin.api_v1_linkedin_web__v2_search__jobs \
161
+ --input '{"method":"GET","params":{"keywords":"rust engineer","location":"Berlin","page":1}}'
162
+
163
+ # 2. Detail only for shortlisted job_url values
164
+ npx xapi-to call linkedin.api_v1_linkedin_web__v2_get__job__detail \
165
+ --input '{"method":"GET","params":{"url":"<job_url>"}}'
166
+
167
+ # 3. Company context
168
+ npx xapi-to call linkedin.api_v1_linkedin_web__v2_get__company__profile \
169
+ --input '{"method":"GET","params":{"url":"<company_linkedin_url>"}}'
170
+ ```
171
+
172
+ ## Pagination
173
+
174
+ `get__user__posts`, `get__company__posts`, `get__post__comments`, and `search__jobs` take a 1-based `page` integer. Posts responses carry `data.data.paging`; comments carry `total` and `pagination_token`; job search carries `total`. Increment `page` until a response comes back exhausted — note that past the last page the upstream returns `code: 200` with `data: null` (not an empty array), so test for falsy rather than for `length === 0`. The other four endpoints return a complete resource and take no pagination parameter.
175
+
176
+ ## API Reference
177
+
178
+ | Action ID (`linkedin.api_v1_linkedin_web__v2_…`) | Purpose | Required params | Optional |
179
+ |---|---|---|---|
180
+ | `get__user__profile` | Full person profile + experience/education/honors | `url` | — |
181
+ | `get__user__posts` | A person's posts | `url` | `page` |
182
+ | `get__company__profile` | Company page | `url` | — |
183
+ | `get__company__posts` | A company's posts | `url` | `page` |
184
+ | `get__post__detail` | Single post, full text and media | `url` | — |
185
+ | `get__post__comments` | Comments on a post | `url` **and** `urn` (digits only) | `page` |
186
+ | `search__jobs` | Job search | `keywords` | `location`, `page` |
187
+ | `get__job__detail` | Full job posting | `url` | — |
188
+
189
+ Detail-style endpoints (`get__*__profile`, `get__post__detail`) are the cheapest; list-style endpoints (posts, comments, job search) cost more per call, and `get__job__detail` is the most expensive. Run `npx xapi-to get <action-id>` for the current `meta.pricing` rather than assuming these ratios hold.
190
+
191
+ ## Error Handling
192
+
193
+ - **`Action not found: linkedin.api_v1_linkedin_web_…`** — you used a pre-v2 action ID. The `username` → `urn` two-step endpoints (`get__user__experience`, `get__user__educations`, `get__user__skills`, `get__user__contact`, `search__people`, `get__company__jobs`, …) are gone; everything is now `…_linkedin_web__v2_…` and URL-addressed. Re-discover with `npx xapi-to search "linkedin" --source api`.
194
+ - **`Input validation failed … must have required property 'url'`** — the gateway rejected the call before it reached LinkedIn. Check the `params` object, not `pathParams`.
195
+ - **`must have required property 'urn'`** — `get__post__comments` needs the numeric `urn` alongside `url`. See [Get comments on a post](#get-comments-on-a-post).
196
+ - **`must match pattern "^[0-9]+$"` on `/params/urn`** — you passed the prefixed `urn:li:activity:<id>` form. Send the digits only.
197
+ - **`API Token lacks required permissions`** (upstream `403`) — the account's upstream provider token has no LinkedIn scope. This is an account entitlement, not a parameter problem; enable it in the provider dashboard.
198
+ - **Empty `data[]` on a valid URL** — either the page is private/deleted, or you paginated past the end. LinkedIn also rate-limits aggressively; retry with backoff rather than in a tight loop.