Skip to content

Commit 754d82f

Browse files
callmeiksclaude
andcommitted
sync SDK to OpenAPI spec V5.3.2 (1106 endpoints)
Regenerate the SDK from the latest https://api.tikhub.io/openapi.json: 1010 -> 1106 endpoints (+121 added, -25 removed). Two new platforms: client.douyin_index (44) and client.linkedin_web_v2 (43). - Regenerated resources, both clients, examples, and docs/reference.md. - Fix scripts/refresh_spec.py: send a browser User-Agent (the API now rejects urllib's default UA with HTTP 403). - Make test_total_endpoint_count spec-derived instead of hardcoding 1010, so it no longer breaks on a spec bump. - Update human-facing counts across READMEs, docs, examples/README, and the CHANGELOG Unreleased entry (released history untouched). Verified: verify_coverage 1106/1106; an independent param check confirms all 1106 methods' parameter names and required/optional flags match the spec exactly; 110 tests, ruff, and mypy all green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent ef4cf9b commit 754d82f

52 files changed

Lines changed: 5169 additions & 1306 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ All notable changes to `tikhub` will be documented in this file. The format is b
1010
for authentication, async, errors, pagination, retries, logging, CLI,
1111
naming rules, and a migration guide from `tikhub_sdk_v2`.
1212
- **Auto-generated API reference** (`docs/reference.md`, 1540 lines) listing
13-
all 1010 methods with their endpoint paths and signatures.
13+
all 1106 methods with their endpoint paths and signatures.
1414
Regenerated by `scripts/generate_docs.py`.
1515
- **CLI** (`pip install "tikhub[cli]"` -> `tikhub` console script):
1616
- `tikhub health`
@@ -36,7 +36,8 @@ All notable changes to `tikhub` will be documented in this file. The format is b
3636
- `refresh_spec.py` — pulls latest `openapi.json`, prints diff vs cached snapshot.
3737
- `generate_resources.py` — regenerates all resource modules + `client.py` + `async_client.py` from `spec/openapi.json`.
3838
- `verify_coverage.py` — CI gate that asserts every spec endpoint has a matching SDK method (and vice versa).
39-
- **All 52 resources** for TikHub OpenAPI V5.3.2 wired up — **1010 / 1010 endpoints**.
39+
- **All 54 resources** for TikHub OpenAPI V5.3.2 wired up — **1106 / 1106 endpoints**.
40+
- **Spec sync to V5.3.2 (1106 endpoints)** — added two platforms (`douyin_index`, 44 endpoints; `linkedin_web_v2`, 43 endpoints), +121 new endpoints across LinkedIn/YouTube/Reddit/WeChat/Douyin and others, −25 removed (deprecated Douyin & Xiaohongshu search/feed variants).
4041
- **Multipart support** in `_base_client._request` (the one Sora2 image-upload endpoint).
4142
- **GitHub Actions CI** (`.github/workflows/ci.yml`): lint, mypy, pytest matrix on Python 3.9–3.13, plus the coverage gate.
4243
- **`docs/quickstart.md`** — runnable 5-minute tour.

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Built for developers, data scientists, and AI engineers who need structured soci
3030

3131
## Why This SDK?
3232

33-
- **100% endpoint coverage**1010 / 1010 endpoints from OpenAPI spec V5.3.2, mechanically generated and verified
33+
- **100% endpoint coverage**1106 / 1106 endpoints from OpenAPI spec V5.3.2, mechanically generated and verified
3434
- **Sync + async**`TikHub` and `AsyncTikHub` clients with identical APIs
3535
- **Production-ready** — automatic retries with exponential backoff, rate-limit handling, structured error hierarchy with full debugging context
3636
- **Type-safe**`mypy --strict` clean, built on `httpx` + `pydantic v2`
@@ -43,15 +43,15 @@ Built for developers, data scientists, and AI engineers who need structured soci
4343
| Platform | Resource | Endpoints |
4444
|---|---|---|
4545
| TikTok | `tiktok_web`, `tiktok_app_v3`, `tiktok_creator`, `tiktok_analytics`, `tiktok_ads`, `tiktok_shop_web` | 200+ |
46-
| Douyin | `douyin_web`, `douyin_app_v3`, `douyin_search`, `douyin_billboard`, `douyin_creator`, `douyin_xingtu` | 400+ |
46+
| Douyin | `douyin_web`, `douyin_app_v3`, `douyin_search`, `douyin_billboard`, `douyin_creator`, `douyin_xingtu`, `douyin_index` | 400+ |
4747
| Instagram | `instagram_v1`, `instagram_v2`, `instagram_v3` | 80+ |
4848
| YouTube | `youtube_web`, `youtube_web_v2` | 50+ |
4949
| Twitter / X | `twitter_web` | 13+ |
5050
| Xiaohongshu (Red Note) | `xiaohongshu_web`, `xiaohongshu_app` (+ v2/v3 variants) | 80+ |
5151
| Bilibili | `bilibili_web`, `bilibili_app` | 40+ |
5252
| Weibo | `weibo_web`, `weibo_web_v2`, `weibo_app` | 30+ |
5353
| Threads | `threads_web` | 10+ |
54-
| LinkedIn | `linkedin_web` | 10+ |
54+
| LinkedIn | `linkedin_web`, `linkedin_web_v2` | 10+ |
5555
| Reddit | `reddit_app` | 10+ |
5656
| Kuaishou | `kuaishou_web`, `kuaishou_app` | 20+ |
5757
| WeChat | `wechat_channels`, `wechat_media_platform_web` | 20+ |
@@ -160,8 +160,8 @@ Parameter names match the OpenAPI spec verbatim. If you can read the TikHub API
160160

161161
| | |
162162
|---|---|
163-
| Resources | **52** (one per OpenAPI tag) |
164-
| Endpoints | **1010 / 1010** |
163+
| Resources | **54** (one per OpenAPI tag) |
164+
| Endpoints | **1106 / 1106** |
165165
| Tests | 110 passing |
166166
| Type-check | mypy `--strict` clean across 71 source files |
167167
| Lint | ruff clean |
@@ -180,7 +180,7 @@ The resource layer is **mechanically generated** from `spec/openapi.json`. To re
180180

181181
```bash
182182
python scripts/refresh_spec.py # pulls latest openapi.json, prints diff
183-
python scripts/generate_resources.py # regenerates all 52 resource files + clients
183+
python scripts/generate_resources.py # regenerates all 54 resource files + clients
184184
python scripts/generate_docs.py # regenerates docs/reference.md
185185
python scripts/verify_coverage.py # asserts 100% coverage
186186
pytest -q # 110 tests
@@ -204,7 +204,7 @@ Every command prints JSON to stdout — pipe to `jq` or any other formatter.
204204

205205
## Documentation
206206

207-
Full docs (mkdocs-material): authentication, async, errors, pagination, retries, logging, CLI, migration guide, naming rules, and the auto-generated reference for all 1010 endpoints.
207+
Full docs (mkdocs-material): authentication, async, errors, pagination, retries, logging, CLI, migration guide, naming rules, and the auto-generated reference for all 1106 endpoints.
208208

209209
```bash
210210
pip install -e ".[docs]"

README_CN.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
## 为什么选择这个 SDK?
3232

33-
- **100% 接口覆盖** — OpenAPI 规范 V5.3.2 的 1010 / 1010 个接口,机械化生成并验证
33+
- **100% 接口覆盖** — OpenAPI 规范 V5.3.2 的 1106 / 1106 个接口,机械化生成并验证
3434
- **同步 + 异步**`TikHub``AsyncTikHub` 客户端,API 完全一致
3535
- **生产就绪** — 自动重试(指数退避)、速率限制处理、结构化异常体系(含完整调试上下文)
3636
- **类型安全**`mypy --strict` 通过,基于 `httpx` + `pydantic v2` 构建
@@ -160,8 +160,8 @@ SDK 由 TikHub OpenAPI 规范机械化生成。两条规则:
160160

161161
| | |
162162
|---|---|
163-
| 资源 | **52**(每个 OpenAPI 标签一个) |
164-
| 接口 | **1010 / 1010** |
163+
| 资源 | **54**(每个 OpenAPI 标签一个) |
164+
| 接口 | **1106 / 1106** |
165165
| 测试 | 110 个通过 |
166166
| 类型检查 | mypy `--strict` 71 个源文件全部通过 |
167167
| 代码检查 | ruff 通过 |
@@ -170,7 +170,7 @@ SDK 由 TikHub OpenAPI 规范机械化生成。两条规则:
170170

171171
```bash
172172
python scripts/refresh_spec.py # 拉取最新 openapi.json,打印差异
173-
python scripts/generate_resources.py # 重新生成所有 52 个资源文件 + 客户端
173+
python scripts/generate_resources.py # 重新生成所有 54 个资源文件 + 客户端
174174
python scripts/generate_docs.py # 重新生成 docs/reference.md
175175
python scripts/verify_coverage.py # 验证 100% 覆盖
176176
pytest -q # 110 个测试
@@ -193,7 +193,7 @@ tikhub user usage # 今日请求量
193193

194194
## 文档
195195

196-
完整文档(mkdocs-material):身份认证、异步、异常处理、分页、重试、日志、CLI、迁移指南、命名规则,以及所有 1010 个接口的自动生成参考文档。
196+
完整文档(mkdocs-material):身份认证、异步、异常处理、分页、重试、日志、CLI、迁移指南、命名规则,以及所有 1106 个接口的自动生成参考文档。
197197

198198
```bash
199199
pip install -e ".[docs]"

README_ES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Dise&ntilde;ado para desarrolladores, cient&iacute;ficos de datos e ingenieros d
3030

3131
## &iquest;Por qu&eacute; este SDK?
3232

33-
- **Cobertura del 100%**1010 / 1010 endpoints de la especificaci&oacute;n OpenAPI V5.3.2, generados y verificados mec&aacute;nicamente
33+
- **Cobertura del 100%**1106 / 1106 endpoints de la especificaci&oacute;n OpenAPI V5.3.2, generados y verificados mec&aacute;nicamente
3434
- **Sync + async** — clientes `TikHub` y `AsyncTikHub` con APIs id&eacute;nticas
3535
- **Listo para producci&oacute;n** — reintentos autom&aacute;ticos con backoff exponencial, manejo de l&iacute;mites de tasa, jerarqu&iacute;a de errores estructurada
3636
- **Type-safe** — compatible con `mypy --strict`, construido sobre `httpx` + `pydantic v2`

README_FR.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Con&ccedil;u pour les d&eacute;veloppeurs, les data scientists et les ing&eacute
3030

3131
## Pourquoi ce SDK ?
3232

33-
- **Couverture &agrave; 100%**1010 / 1010 endpoints de la sp&eacute;cification OpenAPI V5.3.2, g&eacute;n&eacute;r&eacute;s et v&eacute;rifi&eacute;s m&eacute;caniquement
33+
- **Couverture &agrave; 100%**1106 / 1106 endpoints de la sp&eacute;cification OpenAPI V5.3.2, g&eacute;n&eacute;r&eacute;s et v&eacute;rifi&eacute;s m&eacute;caniquement
3434
- **Sync + async** — clients `TikHub` et `AsyncTikHub` avec des APIs identiques
3535
- **Pr&ecirc;t pour la production** — nouvelles tentatives automatiques avec backoff exponentiel, gestion des limites de taux, hi&eacute;rarchie d'erreurs structur&eacute;e
3636
- **Type-safe** — compatible `mypy --strict`, construit sur `httpx` + `pydantic v2`

README_JP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
## この SDK を選ぶ理由
3232

33-
- **100% エンドポイントカバレッジ** — OpenAPI 仕様 V5.3.2 の 1010 / 1010 エンドポイント、機械的に生成・検証
33+
- **100% エンドポイントカバレッジ** — OpenAPI 仕様 V5.3.2 の 1106 / 1106 エンドポイント、機械的に生成・検証
3434
- **同期 + 非同期**`TikHub``AsyncTikHub` クライアント、API は完全に同一
3535
- **本番環境対応** — 指数バックオフによる自動リトライ、レート制限処理、構造化エラー階層
3636
- **型安全**`mypy --strict` 対応、`httpx` + `pydantic v2` で構築

docs/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ with TikHub(api_key="YOUR_API_KEY") as client:
1414

1515
## At a glance
1616

17-
- :material-check-circle: **100% endpoint coverage**1010 / 1010 endpoints from spec V5.3.2
18-
- :material-check-circle: **52 resources** — one per OpenAPI tag, flat namespace
17+
- :material-check-circle: **100% endpoint coverage**1106 / 1106 endpoints from spec V5.3.2
18+
- :material-check-circle: **54 resources** — one per OpenAPI tag, flat namespace
1919
- :material-check-circle: **Async-first** with a parallel sync surface
2020
- :material-check-circle: **Typed exceptions** with status-code mapping and request-id
2121
- :material-check-circle: **Built-in retries** with exponential backoff and `Retry-After` honouring
@@ -59,5 +59,5 @@ Requires Python 3.9+.
5959

6060
- [Quickstart](quickstart.md) — 5-minute runnable tour
6161
- [Authentication](authentication.md)
62-
- [API reference](reference.md) — all 1010 endpoints
62+
- [API reference](reference.md) — all 1106 endpoints
6363
- [Migrating from V2](migrating-from-v2.md)

docs/migrating-from-v2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pip install tikhub_sdk_v2 tikhub # both at once
1111
| | V1.x (`tikhub_sdk_v2`) | V2.1 (`tikhub`) |
1212
|---|---|---|
1313
| Package | `tikhub_sdk_v2` | `tikhub` |
14-
| Spec version targeted | V1.0.0 (~28 tags) | **V5.3.2 (52 tags, 1010 endpoints)** |
14+
| Spec version targeted | V1.0.0 (~28 tags) | **V5.3.2 (54 tags, 1106 endpoints)** |
1515
| Naming | `BodyFetchHotTotalHighFanListApiV1DouyinBillboardFetchHotTotalHighFanListPost` | `client.douyin_billboard.fetch_hot_total_high_fan_list(...)` |
1616
| Async | "library: asyncio" was set in the generator config but the emitted code is sync | Native `httpx.AsyncClient` |
1717
| Python | 2 / 3 (with `six`) | **3.9+** |

0 commit comments

Comments
 (0)