justoneapi 3.0.97__tar.gz → 3.0.98__tar.gz

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.
Files changed (68) hide show
  1. {justoneapi-3.0.97 → justoneapi-3.0.98}/PKG-INFO +17 -1
  2. justoneapi-3.0.97/justoneapi.egg-info/PKG-INFO → justoneapi-3.0.98/README.md +16 -16
  3. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/_resource.py +12 -0
  4. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/_transport.py +35 -5
  5. justoneapi-3.0.98/justoneapi/_version.py +1 -0
  6. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/weixin.py +132 -9
  7. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/weixin_channels.py +126 -9
  8. justoneapi-3.0.97/README.md → justoneapi-3.0.98/justoneapi.egg-info/PKG-INFO +32 -0
  9. {justoneapi-3.0.97 → justoneapi-3.0.98}/tests/test_codegen.py +97 -3
  10. justoneapi-3.0.98/tests/test_runtime.py +283 -0
  11. justoneapi-3.0.97/justoneapi/_version.py +0 -1
  12. justoneapi-3.0.97/tests/test_runtime.py +0 -130
  13. {justoneapi-3.0.97 → justoneapi-3.0.98}/LICENSE +0 -0
  14. {justoneapi-3.0.97 → justoneapi-3.0.98}/MANIFEST.in +0 -0
  15. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/__init__.py +0 -0
  16. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/_exceptions.py +0 -0
  17. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/_response.py +0 -0
  18. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/client.py +0 -0
  19. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/config.py +0 -0
  20. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/__init__.py +0 -0
  21. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/models.py +0 -0
  22. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/__init__.py +0 -0
  23. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/aliexpress.py +0 -0
  24. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/amazon.py +0 -0
  25. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/beike.py +0 -0
  26. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/bilibili.py +0 -0
  27. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/dewu.py +0 -0
  28. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/douban.py +0 -0
  29. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/douyin.py +0 -0
  30. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/douyin_ec.py +0 -0
  31. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/douyin_xingtu.py +0 -0
  32. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/facebook.py +0 -0
  33. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/field_1688.py +0 -0
  34. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/imdb.py +0 -0
  35. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/instagram.py +0 -0
  36. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/jd.py +0 -0
  37. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/kuaishou.py +0 -0
  38. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/linkedin.py +0 -0
  39. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/llm.py +0 -0
  40. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/qq_huxuan.py +0 -0
  41. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/reddit.py +0 -0
  42. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/search.py +0 -0
  43. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/shopee.py +0 -0
  44. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/taobao.py +0 -0
  45. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/temu.py +0 -0
  46. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/tiktok.py +0 -0
  47. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/tiktok_shop.py +0 -0
  48. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/toutiao.py +0 -0
  49. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/twitter.py +0 -0
  50. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/weibo.py +0 -0
  51. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/xianyu.py +0 -0
  52. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/xiaohongshu.py +0 -0
  53. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/xiaohongshu_ec.py +0 -0
  54. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/xiaohongshu_pgy.py +0 -0
  55. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/youku.py +0 -0
  56. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/youtube.py +0 -0
  57. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/zcool.py +0 -0
  58. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/generated/resources/zhihu.py +0 -0
  59. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi/log.py +0 -0
  60. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi.egg-info/SOURCES.txt +0 -0
  61. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi.egg-info/dependency_links.txt +0 -0
  62. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi.egg-info/requires.txt +0 -0
  63. {justoneapi-3.0.97 → justoneapi-3.0.98}/justoneapi.egg-info/top_level.txt +0 -0
  64. {justoneapi-3.0.97 → justoneapi-3.0.98}/pyproject.toml +0 -0
  65. {justoneapi-3.0.97 → justoneapi-3.0.98}/setup.cfg +0 -0
  66. {justoneapi-3.0.97 → justoneapi-3.0.98}/tests/test_bump_version.py +0 -0
  67. {justoneapi-3.0.97 → justoneapi-3.0.98}/tests/test_generated_surface.py +0 -0
  68. {justoneapi-3.0.97 → justoneapi-3.0.98}/tests/test_integration_smoke.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: justoneapi
3
- Version: 3.0.97
3
+ Version: 3.0.98
4
4
  Summary: OpenAPI-driven Python SDK for Just One API
5
5
  Author-email: Just One API <support@justoneapi.com>
6
6
  Requires-Python: >=3.10
@@ -65,6 +65,22 @@ print(response.message) # 服务端消息
65
65
  print(response.data) # 实际业务数据
66
66
  ```
67
67
 
68
+ 微信公众号文章搜索示例:
69
+
70
+ ```python
71
+ response = client.weixin.search_article_v1(
72
+ keyword="人工智能",
73
+ publish_time_type="SEVEN_DAYS",
74
+ sort_type="LATEST",
75
+ current_page=1,
76
+ )
77
+
78
+ # V2 可按文章类别筛选
79
+ response = client.weixin.search_article_v2(keyword="人工智能", sub_search_type="HOT")
80
+ ```
81
+
82
+ `keyword` 必填。SDK 会自动提交 POST 表单和 Token。连续分页时,按接口文档传回上一页响应中的 `offset` 和 `cookies_buffer`,并设置 `current_page`。
83
+
68
84
  ## 返回结构
69
85
 
70
86
  每个 API 方法都会返回一个 `ApiResponse` 对象,包含以下字段:
@@ -1,19 +1,3 @@
1
- Metadata-Version: 2.4
2
- Name: justoneapi
3
- Version: 3.0.97
4
- Summary: OpenAPI-driven Python SDK for Just One API
5
- Author-email: Just One API <support@justoneapi.com>
6
- Requires-Python: >=3.10
7
- Description-Content-Type: text/markdown
8
- License-File: LICENSE
9
- Requires-Dist: httpx<0.29,>=0.28
10
- Requires-Dist: pydantic<3,>=2.12
11
- Provides-Extra: dev
12
- Requires-Dist: datamodel-code-generator<0.56,>=0.55; extra == "dev"
13
- Requires-Dist: PyYAML<7,>=6; extra == "dev"
14
- Requires-Dist: pytest<10,>=9; extra == "dev"
15
- Dynamic: license-file
16
-
17
1
  <p align="center">
18
2
  <a href="https://justoneapi.com/zh?utm_source=github.com&utm_medium=referral&utm_campaign=justoneapi_official_justoneapi_python&utm_content=repo_readme_logo">
19
3
  <img src="https://justoneapi.com/logo/logo_text.png" alt="Just One API Logo" width="200">
@@ -65,6 +49,22 @@ print(response.message) # 服务端消息
65
49
  print(response.data) # 实际业务数据
66
50
  ```
67
51
 
52
+ 微信公众号文章搜索示例:
53
+
54
+ ```python
55
+ response = client.weixin.search_article_v1(
56
+ keyword="人工智能",
57
+ publish_time_type="SEVEN_DAYS",
58
+ sort_type="LATEST",
59
+ current_page=1,
60
+ )
61
+
62
+ # V2 可按文章类别筛选
63
+ response = client.weixin.search_article_v2(keyword="人工智能", sub_search_type="HOT")
64
+ ```
65
+
66
+ `keyword` 必填。SDK 会自动提交 POST 表单和 Token。连续分页时,按接口文档传回上一页响应中的 `offset` 和 `cookies_buffer`,并设置 `current_page`。
67
+
68
68
  ## 返回结构
69
69
 
70
70
  每个 API 方法都会返回一个 `ApiResponse` 对象,包含以下字段:
@@ -12,3 +12,15 @@ class BaseResource:
12
12
 
13
13
  def _get(self, path: str, params: dict[str, Any]) -> ApiResponse[Any]:
14
14
  return self._transport.get(path, params)
15
+
16
+ def _post(
17
+ self,
18
+ path: str,
19
+ params: dict[str, Any],
20
+ *,
21
+ data: dict[str, Any] | None = None,
22
+ token_in_form: bool = False,
23
+ ) -> ApiResponse[Any]:
24
+ return self._transport.post(
25
+ path, params, data=data, token_in_form=token_in_form
26
+ )
@@ -37,11 +37,41 @@ class Transport:
37
37
  self._client.close()
38
38
 
39
39
  def get(self, path: str, params: dict[str, Any]) -> ApiResponse[Any]:
40
- request_params = {"token": self._token, **self._clean_params(params)}
40
+ return self._request("GET", path, params)
41
+
42
+ def post(
43
+ self,
44
+ path: str,
45
+ params: dict[str, Any],
46
+ *,
47
+ data: dict[str, Any] | None = None,
48
+ token_in_form: bool = False,
49
+ ) -> ApiResponse[Any]:
50
+ return self._request(
51
+ "POST", path, params, data=data, token_in_form=token_in_form
52
+ )
53
+
54
+ def _request(
55
+ self,
56
+ method: str,
57
+ path: str,
58
+ params: dict[str, Any],
59
+ *,
60
+ data: dict[str, Any] | None = None,
61
+ token_in_form: bool = False,
62
+ ) -> ApiResponse[Any]:
63
+ request_params = self._clean_params(params)
64
+ request_data = self._clean_params(data) if data is not None else None
65
+ if token_in_form:
66
+ request_data = {"token": self._token, **(request_data or {})}
67
+ else:
68
+ request_params = {"token": self._token, **request_params}
41
69
  try:
42
- response = self._client.get(path, params=request_params)
70
+ response = self._client.request(
71
+ method, path, params=request_params, data=request_data
72
+ )
43
73
  except httpx.HTTPError as exc:
44
- raise TransportError(f"Request failed for GET {path}: {exc}") from exc
74
+ raise TransportError(f"Request failed for {method} {path}: {exc}") from exc
45
75
 
46
76
  log_message = response.headers.get("JUSTONEAPI_PYTHON_SDK_LOG_MESSAGE")
47
77
  if log_message:
@@ -51,12 +81,12 @@ class Transport:
51
81
  payload = response.json()
52
82
  except ValueError as exc:
53
83
  raise ProtocolError(
54
- f"Server returned a non-JSON response for GET {path}"
84
+ f"Server returned a non-JSON response for {method} {path}"
55
85
  ) from exc
56
86
 
57
87
  if not isinstance(payload, dict):
58
88
  raise ProtocolError(
59
- f"Server returned a non-object JSON payload for GET {path}"
89
+ f"Server returned a non-object JSON payload for {method} {path}"
60
90
  )
61
91
 
62
92
  api_response = ApiResponse(
@@ -0,0 +1 @@
1
+ __version__ = "3.0.98"
@@ -37,28 +37,58 @@ class WeixinResource(BaseResource):
37
37
 
38
38
  def get_account_history_articles_v1(
39
39
  self,
40
+ *,
41
+ username: str,
42
+ item_show_type: str | None = "ARTICLE",
43
+ offset: str | None = "",
40
44
  ) -> ApiResponse[Any]:
41
45
  """
42
46
  Account Historical Articles
43
47
 
44
48
  Retrieves historical posts for a WeChat Official Account by username, with cursor pagination and article, video, audio, or image content tabs. Use it to browse an account's publishing history.
49
+
50
+ Args:
51
+ username: WeChat Official Account username with the gh_ prefix.
52
+ item_show_type: Content tab. Defaults to ARTICLE. Available Values: - `ARTICLE`: Articles - `VIDEO`: Videos - `AUDIO`: Audio - `IMAGE`: Images
53
+ offset: Base64 pagination cursor. Leave empty for the first page; pass next_offset from the previous response for the next page. Send it in the URL-encoded form body.
45
54
  """
46
- return self._get(
55
+ return self._post(
47
56
  "/api/weixin/get-account-history-articles/v1",
48
57
  {},
58
+ data={
59
+ "username": username,
60
+ "itemShowType": item_show_type,
61
+ "offset": offset,
62
+ },
63
+ token_in_form=True,
49
64
  )
50
65
 
51
66
  def get_account_history_articles_v2(
52
67
  self,
68
+ *,
69
+ ghid: str | None = "",
70
+ offset: str | None = "",
71
+ url: str | None = "",
53
72
  ) -> ApiResponse[Any]:
54
73
  """
55
74
  Account Historical Articles
56
75
 
57
76
  Retrieves historical articles for a WeChat Official Account identified by ghid or article URL, with an offset cursor from the previous page. Use it to continue through an account's article archive with cursor pagination.
77
+
78
+ Args:
79
+ ghid: WeChat Official Account original identifier, using the gh_ prefix returned by WeChat. Use either ghid or url.
80
+ offset: PagingInfo.Offset cursor returned by the previous response. Leave it empty for the first page. For this POST endpoint, send it in an application/x-www-form-urlencoded form body.
81
+ url: WeChat Official Account article URL used to identify the account and fetch historical articles. Use either ghid or url.
58
82
  """
59
- return self._get(
83
+ return self._post(
60
84
  "/api/weixin/get-account-history-articles/v2",
61
85
  {},
86
+ data={
87
+ "ghid": ghid,
88
+ "offset": offset,
89
+ "url": url,
90
+ },
91
+ token_in_form=True,
62
92
  )
63
93
 
64
94
  def get_article_metrics_v1(
@@ -209,15 +239,27 @@ class WeixinResource(BaseResource):
209
239
 
210
240
  def get_article_comment_v1(
211
241
  self,
242
+ *,
243
+ article_url: str,
244
+ buffer: str | None = "",
212
245
  ) -> ApiResponse[Any]:
213
246
  """
214
247
  Article Comments
215
248
 
216
249
  Retrieves top-level comments for a WeChat Official Account article by URL, with an optional buffer cursor for pagination. Use it to review reader discussion or continue through comment pages for a known article.
250
+
251
+ Args:
252
+ article_url: WeChat Official Account article URL used to fetch top-level article comments.
253
+ buffer: Comment pagination buffer returned by the previous response. Leave it empty for the first page. For this POST endpoint, send it in an application/x-www-form-urlencoded form body.
217
254
  """
218
- return self._get(
255
+ return self._post(
219
256
  "/api/weixin/get-article-comment/v1",
220
257
  {},
258
+ data={
259
+ "articleUrl": article_url,
260
+ "buffer": buffer,
261
+ },
262
+ token_in_form=True,
221
263
  )
222
264
 
223
265
  def get_article_sub_comment_v1(
@@ -280,41 +322,104 @@ class WeixinResource(BaseResource):
280
322
 
281
323
  def search_article_v1(
282
324
  self,
325
+ *,
326
+ keyword: str,
327
+ cookies_buffer: str | None = "",
328
+ current_page: int | None = 1,
329
+ offset: int | None = 0,
330
+ publish_time_type: str | None = "ALL",
331
+ sort_type: str | None = "COMPREHENSIVE",
283
332
  ) -> ApiResponse[Any]:
284
333
  """
285
334
  Article Search
286
335
 
287
336
  Searches WeChat Official Account articles by keyword with publish-time and sort filters plus page, offset, and continuation-state pagination. Use it to discover recent or high-interest articles for topic research and content monitoring.
288
- """
289
- return self._get(
337
+
338
+ Args:
339
+ keyword: Search keyword for WeChat Official Account articles.
340
+ cookies_buffer: Opaque pagination state returned by the previous WeChat web search response. Leave it empty for the first page. For this POST endpoint, send it in an application/x-www-form-urlencoded form body.
341
+ current_page: Current page number starting from 1 for WeChat web search pagination.
342
+ offset: Search result offset returned by the previous response. Use 0 for the first page.
343
+ publish_time_type: Publish time filter for WeChat Official Account article web search. Available Values: - `ALL`: All time - `ONE_DAY`: Last day - `SEVEN_DAYS`: Last seven days - `HALF_YEAR`: Last half year
344
+ sort_type: Sort order for WeChat Official Account article web search results. Available Values: - `COMPREHENSIVE`: Comprehensive sort - `LATEST`: Latest first - `HOT`: Hot first
345
+ """
346
+ return self._post(
290
347
  "/api/weixin/search-article/v1",
291
348
  {},
349
+ data={
350
+ "keyword": keyword,
351
+ "cookies_buffer": cookies_buffer,
352
+ "currentPage": current_page,
353
+ "offset": offset,
354
+ "publishTimeType": publish_time_type,
355
+ "sortType": sort_type,
356
+ },
357
+ token_in_form=True,
292
358
  )
293
359
 
294
360
  def search_article_v2(
295
361
  self,
362
+ *,
363
+ keyword: str,
364
+ cookies_buffer: str | None = "",
365
+ current_page: int | None = 1,
366
+ offset: int | None = 0,
367
+ sub_search_type: str | None = "ALL",
296
368
  ) -> ApiResponse[Any]:
297
369
  """
298
370
  Article Search
299
371
 
300
372
  Searches WeChat Official Account articles by keyword within a selected category such as followed accounts, latest, recently read, or hot, with continuation pagination. Use it to focus article discovery on a particular result stream.
373
+
374
+ Args:
375
+ keyword: Search keyword for categorized WeChat Official Account article web search.
376
+ cookies_buffer: Opaque pagination state returned by the previous WeChat web search response. Leave it empty for the first page. For this POST endpoint, send it in an application/x-www-form-urlencoded form body.
377
+ current_page: Current page number starting from 1 for WeChat web search pagination.
378
+ offset: Search result offset returned by the previous response. Use 0 for the first page.
379
+ sub_search_type: Subcategory filter for categorized WeChat Official Account article web search. Available Values: - `ALL`: All - `FOLLOWED`: Followed accounts - `LATEST`: Latest - `RECENT_READ`: Recently read - `HOT`: Hot
301
380
  """
302
- return self._get(
381
+ return self._post(
303
382
  "/api/weixin/search-article/v2",
304
383
  {},
384
+ data={
385
+ "keyword": keyword,
386
+ "cookies_buffer": cookies_buffer,
387
+ "currentPage": current_page,
388
+ "offset": offset,
389
+ "subSearchType": sub_search_type,
390
+ },
391
+ token_in_form=True,
305
392
  )
306
393
 
307
394
  def search_miniprogram_v1(
308
395
  self,
396
+ *,
397
+ keyword: str,
398
+ cookies_buffer: str | None = "",
399
+ current_page: int | None = 1,
400
+ offset: int | None = 0,
309
401
  ) -> ApiResponse[Any]:
310
402
  """
311
403
  Mini Program Search
312
404
 
313
405
  Searches WeChat Mini Programs by keyword with page, offset, and continuation-state pagination. Use it to discover mini programs related to a brand, service, topic, or product.
406
+
407
+ Args:
408
+ keyword: Search keyword for WeChat mini program web search.
409
+ cookies_buffer: Opaque pagination state returned by the previous WeChat web search response. Leave it empty for the first page. For this POST endpoint, send it in an application/x-www-form-urlencoded form body.
410
+ current_page: Current page number starting from 1 for WeChat web search pagination.
411
+ offset: Search result offset returned by the previous response. Use 0 for the first page.
314
412
  """
315
- return self._get(
413
+ return self._post(
316
414
  "/api/weixin/search-miniprogram/v1",
317
415
  {},
416
+ data={
417
+ "keyword": keyword,
418
+ "cookies_buffer": cookies_buffer,
419
+ "currentPage": current_page,
420
+ "offset": offset,
421
+ },
422
+ token_in_form=True,
318
423
  )
319
424
 
320
425
  def search_wechat_index_v1(
@@ -375,7 +480,7 @@ class WeixinResource(BaseResource):
375
480
  keyword: Search keyword for WeChat Official Account profiles.
376
481
  page: Page number starting from 1 for WeChat Official Account profile search.
377
482
  """
378
- return self._get(
483
+ return self._post(
379
484
  "/api/weixin/search-account/v1",
380
485
  {
381
486
  "keyword": keyword,
@@ -385,15 +490,33 @@ class WeixinResource(BaseResource):
385
490
 
386
491
  def search_account_v2(
387
492
  self,
493
+ *,
494
+ keyword: str,
495
+ cookies_buffer: str | None = "",
496
+ current_page: int | None = 1,
497
+ offset: int | None = 0,
388
498
  ) -> ApiResponse[Any]:
389
499
  """
390
500
  Account Search
391
501
 
392
502
  Searches WeChat Official Accounts by keyword with page, offset, and continuation-state pagination. Use it to browse broader account results for creator, brand, or publisher discovery.
503
+
504
+ Args:
505
+ keyword: Search keyword for WeChat Official Account web search.
506
+ cookies_buffer: Opaque pagination state returned by the previous WeChat web search response. Leave it empty for the first page. For this POST endpoint, send it in an application/x-www-form-urlencoded form body.
507
+ current_page: Current page number starting from 1 for WeChat web search pagination.
508
+ offset: Search result offset returned by the previous response. Use 0 for the first page.
393
509
  """
394
- return self._get(
510
+ return self._post(
395
511
  "/api/weixin/search-account/v2",
396
512
  {},
513
+ data={
514
+ "keyword": keyword,
515
+ "cookies_buffer": cookies_buffer,
516
+ "currentPage": current_page,
517
+ "offset": offset,
518
+ },
519
+ token_in_form=True,
397
520
  )
398
521
 
399
522
  def get_account_original_count_v1(
@@ -11,41 +11,101 @@ class WeixinChannelsResource(BaseResource):
11
11
 
12
12
  def search_video_v1(
13
13
  self,
14
+ *,
15
+ keyword: str,
16
+ cookies_buffer: str | None = "",
17
+ current_page: int | None = 1,
18
+ offset: int | None = 0,
19
+ publish_time_type: str | None = "ALL",
20
+ sort_type: str | None = "COMPREHENSIVE",
14
21
  ) -> ApiResponse[Any]:
15
22
  """
16
23
  Video Search
17
24
 
18
25
  Searches WeChat Channels videos by keyword with publish-time, sort, page, offset, and continuation-state controls. Use it to find recent or ordered video results and continue web-search pages.
26
+
27
+ Args:
28
+ keyword: Search keyword for WeChat Channels video results.
29
+ cookies_buffer: Opaque pagination state returned by the previous WeChat Channels web search response. Leave it empty for the first page. For this POST endpoint, send it in an application/x-www-form-urlencoded form body.
30
+ current_page: Current page number starting from 1 for WeChat Channels web search pagination.
31
+ offset: Search result offset returned by the previous WeChat Channels search response. Use 0 for the first page.
32
+ publish_time_type: Publish time filter for WeChat Channels video web search. Available Values: - `ALL`: All publish times - `ONE_DAY`: Published in the last day - `SEVEN_DAYS`: Published in the last seven days - `HALF_YEAR`: Published in the last half year
33
+ sort_type: Sort order for WeChat Channels video search results. Available Values: - `COMPREHENSIVE`: Comprehensive sort - `LATEST`: Latest first - `HOT`: Hot first
19
34
  """
20
- return self._get(
35
+ return self._post(
21
36
  "/api/weixin-channels/search-video/v1",
22
37
  {},
38
+ data={
39
+ "keyword": keyword,
40
+ "cookies_buffer": cookies_buffer,
41
+ "currentPage": current_page,
42
+ "offset": offset,
43
+ "publishTimeType": publish_time_type,
44
+ "sortType": sort_type,
45
+ },
46
+ token_in_form=True,
23
47
  )
24
48
 
25
49
  def search_video_v2(
26
50
  self,
51
+ *,
52
+ keyword: str,
53
+ cookies_buffer: str | None = "",
54
+ current_page: int | None = 1,
55
+ offset: int | None = 0,
27
56
  ) -> ApiResponse[Any]:
28
57
  """
29
58
  Video Search
30
59
 
31
60
  Searches the WeChat Channels video category by keyword with page, offset, and continuation-state controls. Use it to retrieve categorized video results and continue additional pages.
61
+
62
+ Args:
63
+ keyword: Search keyword for categorized WeChat Channels video results.
64
+ cookies_buffer: Opaque pagination state returned by the previous WeChat Channels web search response. Leave it empty for the first page. For this POST endpoint, send it in an application/x-www-form-urlencoded form body.
65
+ current_page: Current page number starting from 1 for WeChat Channels web search pagination.
66
+ offset: Search result offset returned by the previous WeChat Channels search response. Use 0 for the first page.
32
67
  """
33
- return self._get(
68
+ return self._post(
34
69
  "/api/weixin-channels/search-video/v2",
35
70
  {},
71
+ data={
72
+ "keyword": keyword,
73
+ "cookies_buffer": cookies_buffer,
74
+ "currentPage": current_page,
75
+ "offset": offset,
76
+ },
77
+ token_in_form=True,
36
78
  )
37
79
 
38
80
  def search_account_v1(
39
81
  self,
82
+ *,
83
+ keyword: str,
84
+ cookies_buffer: str | None = "",
85
+ current_page: int | None = 1,
86
+ offset: int | None = 0,
40
87
  ) -> ApiResponse[Any]:
41
88
  """
42
89
  Account Search
43
90
 
44
91
  Searches the WeChat Channels account category by keyword with page, offset, and continuation-state controls. Use it to discover creator accounts through paginated web-search results.
92
+
93
+ Args:
94
+ keyword: Search keyword for WeChat Channels account web search.
95
+ cookies_buffer: Opaque pagination state returned by the previous WeChat Channels account search response. Leave it empty for the first page. For this POST endpoint, send it in an application/x-www-form-urlencoded form body.
96
+ current_page: Current page number starting from 1 for WeChat Channels web search pagination.
97
+ offset: Search result offset returned by the previous WeChat Channels account search response. Use 0 for the first page.
45
98
  """
46
- return self._get(
99
+ return self._post(
47
100
  "/api/weixin-channels/search-account/v1",
48
101
  {},
102
+ data={
103
+ "keyword": keyword,
104
+ "cookies_buffer": cookies_buffer,
105
+ "currentPage": current_page,
106
+ "offset": offset,
107
+ },
108
+ token_in_form=True,
49
109
  )
50
110
 
51
111
  def search_account_v2(
@@ -61,7 +121,7 @@ class WeixinChannelsResource(BaseResource):
61
121
  Args:
62
122
  keyword: Search keyword used to find WeChat Channels accounts and related video objects.
63
123
  """
64
- return self._get(
124
+ return self._post(
65
125
  "/api/weixin-channels/search-account/v2",
66
126
  {
67
127
  "keyword": keyword,
@@ -81,7 +141,7 @@ class WeixinChannelsResource(BaseResource):
81
141
  Args:
82
142
  keyword: Search keyword used to resolve a WeChat Channels account id.
83
143
  """
84
- return self._get(
144
+ return self._post(
85
145
  "/api/weixin-channels/search-account/v3",
86
146
  {
87
147
  "keyword": keyword,
@@ -90,15 +150,27 @@ class WeixinChannelsResource(BaseResource):
90
150
 
91
151
  def get_account_videos_v1(
92
152
  self,
153
+ *,
154
+ v2_name: str,
155
+ last_buffer: str | None = "",
93
156
  ) -> ApiResponse[Any]:
94
157
  """
95
158
  Account Videos
96
159
 
97
160
  Retrieves a paginated WeChat Channels account feed by v2Name with continuation-buffer support. Use it to browse videos and other feed entries published by a known creator account.
161
+
162
+ Args:
163
+ v2_name: WeChat Channels account unique id, usually ending with @finder.
164
+ last_buffer: Pagination buffer returned by the previous WeChat Channels account videos response. Leave it empty for the first page. For this POST endpoint, send it in an application/x-www-form-urlencoded form body.
98
165
  """
99
- return self._get(
166
+ return self._post(
100
167
  "/api/weixin-channels/get-account-videos/v1",
101
168
  {},
169
+ data={
170
+ "v2Name": v2_name,
171
+ "last_buffer": last_buffer,
172
+ },
173
+ token_in_form=True,
102
174
  )
103
175
 
104
176
  def get_bound_channel_v1(
@@ -232,39 +304,84 @@ class WeixinChannelsResource(BaseResource):
232
304
 
233
305
  def get_video_metrics_v1(
234
306
  self,
307
+ *,
308
+ object_id: str,
309
+ last_buffer: str | None = "",
310
+ object_nonce_id: str | None = "",
235
311
  ) -> ApiResponse[Any]:
236
312
  """
237
313
  Video Metrics
238
314
 
239
315
  Retrieves interaction metrics for a WeChat Channels video by object ID with optional continuation-buffer input. Use it to review engagement for known video content.
316
+
317
+ Args:
318
+ object_id: WeChat Channels video object id used to fetch interaction metrics.
319
+ last_buffer: Pagination buffer returned by the previous WeChat Channels metrics response. Leave it empty for the first page. For this POST endpoint, send it in an application/x-www-form-urlencoded form body.
320
+ object_nonce_id: Optional WeChat Channels object nonce id.
240
321
  """
241
- return self._get(
322
+ return self._post(
242
323
  "/api/weixin-channels/get-video-metrics/v1",
243
324
  {},
325
+ data={
326
+ "objectId": object_id,
327
+ "last_buffer": last_buffer,
328
+ "objectNonceId": object_nonce_id,
329
+ },
330
+ token_in_form=True,
244
331
  )
245
332
 
246
333
  def get_video_comment_v1(
247
334
  self,
335
+ *,
336
+ object_id: str,
337
+ last_buffer: str | None = "",
338
+ object_nonce_id: str | None = "",
248
339
  ) -> ApiResponse[Any]:
249
340
  """
250
341
  Video Comments
251
342
 
252
343
  Retrieves first-level comments for a WeChat Channels video by object ID with continuation-buffer pagination. Use it to review audience discussion on known video content.
344
+
345
+ Args:
346
+ object_id: WeChat Channels video object id used to fetch first-level comments. If you only have the exportId returned by a video search result, first call the Export Id Conversion (V1) endpoint at /api/weixin-channels/convert-export-id/v1 to convert it to an objectId.
347
+ last_buffer: Pagination buffer returned by the previous first-level WeChat Channels comment response. Leave it empty for the first page. For this POST endpoint, send it in an application/x-www-form-urlencoded form body.
348
+ object_nonce_id: Optional WeChat Channels object nonce id.
253
349
  """
254
- return self._get(
350
+ return self._post(
255
351
  "/api/weixin-channels/get-video-comment/v1",
256
352
  {},
353
+ data={
354
+ "objectId": object_id,
355
+ "last_buffer": last_buffer,
356
+ "objectNonceId": object_nonce_id,
357
+ },
358
+ token_in_form=True,
257
359
  )
258
360
 
259
361
  def get_video_sub_comment_v1(
260
362
  self,
363
+ *,
364
+ object_id: str,
365
+ root_comment_id: str,
366
+ last_buffer: str | None = "",
261
367
  ) -> ApiResponse[Any]:
262
368
  """
263
369
  Video Sub Comments
264
370
 
265
371
  Retrieves replies under a first-level WeChat Channels video comment using the video and root-comment IDs. Use it to continue a threaded comment discussion with buffer pagination.
372
+
373
+ Args:
374
+ object_id: WeChat Channels video object id used to fetch second-level comment replies.
375
+ root_comment_id: Root first-level comment id returned by the WeChat Channels video comments endpoint.
376
+ last_buffer: Pagination buffer for WeChat Channels second-level comment replies. Use the first-level comment's last_buffer for the first reply page when present. For this POST endpoint, send it in an application/x-www-form-urlencoded form body.
266
377
  """
267
- return self._get(
378
+ return self._post(
268
379
  "/api/weixin-channels/get-video-sub-comment/v1",
269
380
  {},
381
+ data={
382
+ "objectId": object_id,
383
+ "rootCommentId": root_comment_id,
384
+ "last_buffer": last_buffer,
385
+ },
386
+ token_in_form=True,
270
387
  )
@@ -1,3 +1,19 @@
1
+ Metadata-Version: 2.4
2
+ Name: justoneapi
3
+ Version: 3.0.98
4
+ Summary: OpenAPI-driven Python SDK for Just One API
5
+ Author-email: Just One API <support@justoneapi.com>
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: httpx<0.29,>=0.28
10
+ Requires-Dist: pydantic<3,>=2.12
11
+ Provides-Extra: dev
12
+ Requires-Dist: datamodel-code-generator<0.56,>=0.55; extra == "dev"
13
+ Requires-Dist: PyYAML<7,>=6; extra == "dev"
14
+ Requires-Dist: pytest<10,>=9; extra == "dev"
15
+ Dynamic: license-file
16
+
1
17
  <p align="center">
2
18
  <a href="https://justoneapi.com/zh?utm_source=github.com&utm_medium=referral&utm_campaign=justoneapi_official_justoneapi_python&utm_content=repo_readme_logo">
3
19
  <img src="https://justoneapi.com/logo/logo_text.png" alt="Just One API Logo" width="200">
@@ -49,6 +65,22 @@ print(response.message) # 服务端消息
49
65
  print(response.data) # 实际业务数据
50
66
  ```
51
67
 
68
+ 微信公众号文章搜索示例:
69
+
70
+ ```python
71
+ response = client.weixin.search_article_v1(
72
+ keyword="人工智能",
73
+ publish_time_type="SEVEN_DAYS",
74
+ sort_type="LATEST",
75
+ current_page=1,
76
+ )
77
+
78
+ # V2 可按文章类别筛选
79
+ response = client.weixin.search_article_v2(keyword="人工智能", sub_search_type="HOT")
80
+ ```
81
+
82
+ `keyword` 必填。SDK 会自动提交 POST 表单和 Token。连续分页时,按接口文档传回上一页响应中的 `offset` 和 `cookies_buffer`,并设置 `current_page`。
83
+
52
84
  ## 返回结构
53
85
 
54
86
  每个 API 方法都会返回一个 `ApiResponse` 对象,包含以下字段: