把 TikTok 数据,
接进你的系统。
覆盖直播间抓取、实时在线人数、Android 四类搜索、账号资料与关系、无水印视频下载及 Outlook 接码,一套 REST 接口即可嵌入你的看板与自动化流。
https://tikkit.mdclaw.aicurl -X POST "https://tikkit.mdclaw.ai/api/v1/live/counts" \ -H "Authorization: Bearer $TKKIT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"room_ids":["7704642891406265110"]}'{ "success": true, "data": { "results": [ { "room_id": "7704642891406265110", "live": true, "online": 804, "total_viewers": 8614, "status": 2, "title": "Breaking live coverage", "anchor": "skynews", "nickname": "Sky News", "started_at": 1793877021, "cached": false, "error": null } ], "count": 1, "live": 1, "cached": 0, "partial": false, "invalid": 0, "ts": 1795584000 }, "request_id": "9d0b4b0e-2f1b-4b6d-a9f5-8b1d6c4a2e10", "usage": { "quota": 5000, "used": 22, "remaining": 4978, "reset_at": "2026-11-25T16:00:00.000Z", "units": 1 }}三步完成接入
API Key 在用户工作台自助签发,数据库仅存摘要不可找回;建议先调用 GET /api/v1/me 验证密钥连通性与当日剩余额度。
- 1创建 API Key
前往 工作台 → API 密钥 生成完整密钥(仅创建时展示一次)。
- 2存入环境变量
保存为
TKKIT_API_KEY,切勿硬编码或提交到前端公开代码。 - 3携带请求头并运行调试
在请求头传入
Authorization: Bearer $TKKIT_API_KEY,也可直接在 在线调试台 发起真实测试。
curl -X GET "https://tikkit.mdclaw.ai/api/v1/me" \ -H "Authorization: Bearer $TKKIT_API_KEY"{ "success": true, "data": { "key": { "id": "key_01J9Z...", "name": "数据看板", "hint": "tk_live_xxx…abcd", "status": "active", "expires_at": null, "last_used_at": "2026-11-25T10:12:00.000Z" }, "owner": { "id": "user_01J8...", "name": "Alice", "email": "alice@example.com", "tier": "pro", "membership_expires_at": null }, "quota": { "daily_limit": 5000, "used": 14, "remaining": 4986, "reset_at": "2026-11-25T16:00:00.000Z", "rate_limit_per_minute": 120, "key_daily_limit": null }, "today": { "user_requests": 14, "user_rejected": 0, "key_requests": 14, "requests": 14, "success": 14, "failure": 0, "rejected": 0, "units": 18, "average_latency_ms": 860 } }, "request_id": "e6f5a1b2-3c4d-5e6f-8a9b-0c1d2e3f4a5b", "usage": { "quota": 5000, "used": 15, "remaining": 4985, "reset_at": "2026-11-25T16:00:00.000Z", "units": 0, "rate_limit": 120, "rate_remaining": 119 }}直接提供给 AI 使用
我们根据当前开放接口契约自动生成标准 SKILL.md 与 llms.txt。你可以直接下载安装到编程 Agent,或把直链地址丢给对话式 AI,让它一次性写出零幻觉的对接代码。
# 安装到当前项目的 Claude Code skills 目录mkdir -p .claude/skills/tkkit-open-apicurl -fsSL "https://tikkit.mdclaw.ai/open-api/skill.md" -o .claude/skills/tkkit-open-api/SKILL.md---name: tkkit-open-apidescription: >- Integrate with TKKIT Open API v1: TikTok live discovery & room viewer counts, Android 4-mode search & native filters, user profiles & follower/following relations, watermark-free media extraction/download, post stats & paginated comments, Outlook verification code retrieval, and API key quota checks. Use whenever the user asks to call, integrate, script, or debug TKKIT Open API endpoints.--- # TKKIT Open API v1 — Agent Integration Skill Canonical machine-readable endpoint catalog for **TKKIT Open API v1** at `https://tikkit.mdclaw.ai`. ## Base URL & Authentication - **Base URL**: `https://tikkit.mdclaw.ai`- **API Key Format**: `tk_live_<32-char-base64url>` (read from environment variable `TKKIT_API_KEY`; NEVER hardcode secrets into source files or client bundles).- **Auth Headers** (either works on all authenticated endpoints): - `Authorization: Bearer $TKKIT_API_KEY` - `X-API-Key: $TKKIT_API_KEY`- **Public Health Check**: `GET /api/v1/health` requires **no** API key and consumes 0 quota.- **Key Self-Check**: Call `GET /api/v1/me` first to verify key validity, active tier, remaining daily quota, and per-minute rate limit. ## Response Envelope & Standard Headers All JSON endpoints return a consistent wrapper: ```json{ "success": true, "data": {}, "request_id": "uuid", "usage": { "quota": 5000, "used": 12, "remaining": 4988, "reset_at": "2026-11-25T16:00:00.000Z", "units": 1 }}``` - Failed requests return `success: false` with `error: { code, message }` and matching HTTP 4xx/5xx status.- Batch endpoints (`/api/v1/live/counts`, `/api/v1/posts/stats`) return HTTP `200` with `data.partial: true` when individual items fail; always inspect each item's `error` field instead of assuming all items succeeded. ### Standard Response Headers | Header | Description | Example || --- | --- | --- || `X-Request-Id` | 每次请求的唯一 UUID,排查问题与工单对齐时请提供该值。 | `9d0b4b0e-2f1b-4b6d-a9f5-8b1d6c4a2e10` || `X-Quota-Limit` | 当前账号今日有效 API 调用总额度。 | `5000` || `X-Quota-Used` | 当前账号今日已累计使用的调用次数。 | `12` || `X-Quota-Remaining` | 今日剩余可用调用次数。 | `4988` || `X-Quota-Reset` | 下次额度重置时间(UTC;北京时间次日 0 点即 UTC 当日 16:00)。 | `2026-11-25T16:00:00.000Z` || `X-RateLimit-Limit` | 每分钟请求上限;0 表示当前密钥不限速。 | `120` || `X-RateLimit-Remaining` | 当前分钟窗口剩余请求数。 | `118` || `X-RateLimit-Reset` | 当前分钟窗口重置的 UTC 时间。 | `2026-11-25T10:15:00.000Z` || `Server-Timing` | 网关分段耗时追踪(auth_db / admission / business / api_total 等,单位 ms)。 | `auth;dur=12.40, business;dur=320.15, api_total;dur=341.02` | ## Quotas & Rate Limits - Daily quotas accumulate per **Beijing Time natural day (UTC+8)** and reset at `00:00` CST (`16:00:00Z` UTC). All keys under one account share the account daily quota.- When `429` (`QUOTA_EXCEEDED`, `KEY_QUOTA_EXCEEDED`, `RATE_LIMITED`) is returned, respect the `Retry-After` response header (seconds) before retrying. | Tier | Daily Quota | Rate Limit | Max Active Keys || --- | --- | --- | --- || 免费版 (`free`) | 100 次/天 | 30 次/分钟 | 2 把 || 专业版 (`pro`) | 5,000 次/天 | 120 次/分钟 | 10 把 || 企业版 (`enterprise`) | 50,000 次/天 | 600 次/分钟 | 50 把 | ## Critical Workflows & Implementation Rules 1. **Async Live Discovery Workflow** (`POST /api/v1/live/discovery/tasks`): - Returns HTTP `202` with `data.task.id`. Max **3** active (`queued` / `running`) tasks per account. - Send `Idempotency-Key` header on task creation to safely retry network errors without creating duplicate tasks. - Poll `GET /api/v1/live/discovery/tasks/{taskId}/results?cursor=<next_cursor>&limit=100&order=asc` incrementally, and check `GET /api/v1/live/discovery/tasks/{taskId}` for overall status (`completed`, `partial`, `failed`, `cancelled`). - Stop polling only when `status` is terminal AND `has_more === false`. Use `DELETE /api/v1/live/discovery/tasks/{taskId}` to cancel early.2. **Android Search & Native Filters**: - Fetch `GET /api/v1/search/filters` first to discover valid integer/string filter codes for `kind=user` and `kind=video`. - `min_followers` / `max_followers` only apply to `kind=user` and exclude users whose follower count is unknown (`unknown_followers`).3. **Watermark-Free Media Download**: - Do **not** fetch `media[].url` directly from unauthenticated scripts without TikTok CDN cookies — it often returns HTTP 403. - Always download via `GET /api/v1/posts/media/download?url=<item_id>&index=<n>` (or `media[].download_url`) with your `TKKIT_API_KEY` header; the gateway relays with valid session cookies and auto-retries expired signatures.4. **Paginated Comments & Relations**: - Comments (`POST /api/v1/posts/comments`): start with `cursor: 0`, pass back `data.cursor` while `data.has_more === true`, and deduplicate by `cid`. - User profiles & relations: preserve leading `@` for numeric-only TikTok usernames.5. **Outlook Verification Codes**: - Call `GET /api/v1/email/accounts` to list authorized mailboxes (`max 20`), then poll `GET /api/v1/email/codes?email=...`. Default `sync=1` has an 8-second upstream throttle; pass `sync=0` for cache-only reads.6. **Cache Bypass**: - Pass header `X-Cache-Force: 1` on `/api/v1/users/profile` (60s cache), `/api/v1/users/relations` (15s cache), `/api/v1/live/counts` (10s cache), and `/api/v1/posts/media` (5m cache) when fresh upstream reads are required. ## Endpoints Reference <!-- Group: 账户与系统 -->### 查询额度与用量 (`GET /api/v1/me`) - **Supported Methods**: `GET`- **Authentication**: Required (`Authorization: Bearer` or `X-API-Key`)- **Billing**: 0 点(计入每日调用次数)- **Cache**: 实时计算- **Summary**: 校验当前 API Key 的有效性,返回密钥信息、所属套餐、今日实时消耗与可用端点列表。 **Parameters**: None. **Response Fields**: - `data.key` (`object`): 当前密钥 ID、名称、脱敏前缀、状态、到期时间与最近使用时间。- `data.owner` (`object`): 密钥归属用户 ID、昵称、邮箱、有效套餐(free / pro / enterprise)。- `data.quota` (`object`): 每日总额度 daily_limit、已用 used、剩余 remaining、UTC 重置时间 reset_at 与每分钟限速。- `data.today` (`object`): 今日用户总请求、本密钥成功/失败/拒绝次数、累计点数与平均耗时。- `data.endpoints` (`array`): 当前版本开放的端点摘要清单。 **Example Request**: ```bashcurl -X GET "https://tikkit.mdclaw.ai/api/v1/me" \ -H "Authorization: Bearer $TKKIT_API_KEY"``` ### 网关健康检查 (`GET /api/v1/health`) - **Supported Methods**: `GET`- **Authentication**: None (public endpoint)- **Billing**: 0 点(无需鉴权)- **Cache**: no-store- **Summary**: 检测 API 网关与服务器当前时间戳;无需传递 API Key,不消耗每日调用额度。 **Parameters**: None. **Response Fields**: - `success` (`boolean`): 服务健康状态,正常固定返回 true。- `service` (`string`): 服务标识,固定为 "tkkit-api"。- `version` (`string`): 当前 API 版本号 "v1"。- `time` (`string`): 服务端当前 UTC ISO-8601 时间戳。 **Example Request**: ```bashcurl -X GET "https://tikkit.mdclaw.ai/api/v1/health" \``` <!-- Group: 搜索与筛选 -->### Android 关键词搜索 (`POST /api/v1/search`) - **Supported Methods**: `GET / POST`- **Authentication**: Required (`Authorization: Bearer` or `X-API-Key`)- **Billing**: 按实际读取页数计点(pages_fetched)- **Cache**: 不缓存(实时请求)- **Summary**: 按关键词搜索 TikTok 用户、直播、视频和图文。用户搜索支持原生粉丝档位与自定义粉丝上下限;视频搜索支持排序、类别与发布时间筛选。 **Parameters**: | Name | In | Type | Required | Default / Constraints | Description || --- | --- | --- | --- | --- | --- || `keyword` | `body` | `string` | Yes | 1–200 字符,禁止控制字符 | 搜索关键词;GET 请求时作为 query 参数传递。 || `kind` | `body` | `string` | No | default: `user`; enum: `user`, `live`, `video`, `photo` | 搜索对象类型:用户(user)、直播(live)、视频(video)或图文(photo)。 || `pages` | `body` | `integer` | No | default: `1`; 1–1000 | 连续翻页读取的最大页数,实际消耗点数等于 pages_fetched。 || `filters` | `body` | `object` | No | — | 原版筛选对象(GET 请求传 JSON 字符串)。kind=user 支持 follower_number (0–4)、profile_type (0–3)、preference (0–1);kind=video 支持 sort / category / publish_date。 || `min_followers` | `body` | `integer` | No | ≥ 0,仅 kind=user | 按已读取结果做自定义最低粉丝数过滤(含边界),粉丝数未知记录会被排除。 || `max_followers` | `body` | `integer` | No | ≥ min_followers,仅 kind=user | 按已读取结果做自定义最高粉丝数过滤(含边界)。 | **Response Fields**: - `data.kind` (`string`): 本次搜索类型(user / live / video / photo)。- `data.count` (`integer`): 过滤后实际返回的记录条数。- `data.pages_fetched` (`integer`): 本次实际请求的上游页数(计费点数依据)。- `data.has_more` (`boolean`): 上游是否还有更多分页。- `data.users / rooms / posts` (`array`): 按 kind 分别返回用户、直播间或作品对象数组。- `data.candidate_count / unknown_followers` (`integer`): 仅 kind=user 返回:过滤前候选数与粉丝未知被排除人数。 **Endpoint Errors**: - `INVALID_SEARCH` (HTTP 400): 关键词为空/超长、页数越界或筛选编号非法。- `ANDROID_SEARCH_BUSY` (HTTP 503): 搜索服务繁忙,请稍后重试。- `ANDROID_SEARCH_UNAVAILABLE` (HTTP 503): 搜索服务暂时不可用,请联系管理员。- `ANDROID_SEARCH_TIMEOUT` (HTTP 504): 搜索请求超时(90 秒),请稍后重试。 **Example Request**: ```bashcurl -X POST "https://tikkit.mdclaw.ai/api/v1/search" \ -H "Authorization: Bearer $TKKIT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"keyword":"cooking","kind":"user","pages":2,"filters":{"follower_number":2,"profile_type":0,"preference":0},"min_followers":1000,"max_followers":10000}'``` ### 获取搜索筛选项 (`GET /api/v1/search/filters`) - **Supported Methods**: `GET`- **Authentication**: Required (`Authorization: Bearer` or `X-API-Key`)- **Billing**: 0 点(计入每日调用次数)- **Cache**: 实时读取- **Summary**: 拉取当前 Android 用户和视频搜索支持的原版筛选组、编号(code)与中文标签。 **Parameters**: None. **Response Fields**: - `data.user` (`object`): 用户搜索筛选字典,含 follower_number、profile_type、preference 的标题及 code/label 选项。- `data.video` (`object`): 视频搜索筛选字典,含 sort、category、publish_date 的 code/label 选项。 **Example Request**: ```bashcurl -X GET "https://tikkit.mdclaw.ai/api/v1/search/filters" \ -H "Authorization: Bearer $TKKIT_API_KEY"``` <!-- Group: 用户与关系 -->### 查询用户资料 (`POST /api/v1/users/profile`) - **Supported Methods**: `GET / POST`- **Authentication**: Required (`Authorization: Bearer` or `X-API-Key`)- **Billing**: 1 点- **Cache**: 60 秒内存缓存- **Summary**: 通过 @用户名、数字 UID 或 MS4w 开头的 sec_uid 查询 TikTok 账号资料、粉丝数、关注数、获赞与作品数。 **Parameters**: | Name | In | Type | Required | Default / Constraints | Description || --- | --- | --- | --- | --- | --- || `target` | `body` | `string` | Yes | 1–512 字符 | 目标账号标识:@用户名、纯数字 UID 或 MS4w... sec_uid;纯数字用户名请务必保留前导 @。 || `X-Cache-Force` | `header` | `string` | No | default: `0`; enum: `1` | 传 1 时跳过 60 秒内存缓存直接回源刷新。 | **Response Fields**: - `data.user.uid / sec_uid` (`string`, nullable): 账号唯一数字 UID 与加密 sec_uid。- `data.user.username / nickname` (`string`, nullable): handle 用户名与显示昵称。- `data.user.signature / avatar_url` (`string`, nullable): 个性签名与 HTTPS 头像地址。- `data.user.follower_count / following_count` (`integer`, nullable): 粉丝数与关注数;上游未下发时返回 null。- `data.user.like_count / aweme_count` (`integer`, nullable): 总获赞数与作品总数。- `data.cached` (`boolean`): 本次结果是否命中 60 秒内存缓存。 **Endpoint Errors**: - `INVALID_TARGET` (HTTP 400): 用户名、UID 或 sec_uid 格式不正确。- `ANDROID_PROFILE_MISMATCH` (HTTP 502): 上游返回的资料与请求目标不一致。- `ANDROID_PROFILE_TIMEOUT` (HTTP 504): 资料后端响应超时(65 秒)。 **Example Request**: ```bashcurl -X POST "https://tikkit.mdclaw.ai/api/v1/users/profile" \ -H "Authorization: Bearer $TKKIT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"target":"@ankoru5"}'``` ### 查询关注 / 粉丝列表 (`POST /api/v1/users/relations`) - **Supported Methods**: `GET / POST`- **Authentication**: Required (`Authorization: Bearer` or `X-API-Key`)- **Billing**: 按实际翻页数计点(至少 1 点)- **Cache**: 15 秒内存缓存- **Summary**: 读取指定目标账号的公开粉丝列表或关注列表,自动按 UID 去重并返回分页记录与终止原因。 **Parameters**: | Name | In | Type | Required | Default / Constraints | Description || --- | --- | --- | --- | --- | --- || `target` | `body` | `string` | Yes | — | 目标账号 @用户名、数字 UID 或 sec_uid。 || `kind` | `body` | `string` | Yes | enum: `followers`, `following` | 查询方向:followers(粉丝列表)或 following(关注列表)。 || `pages` | `body` | `integer` | No | default: `1`; 1–10 | 最多连续抓取的页数,计费点数等于实际抓取页数。 || `count` | `body` | `integer` | No | default: `20`; 1–50 | 期望每页返回的用户数。 || `X-Cache-Force` | `header` | `string` | No | enum: `1` | 传 1 时跳过 15 秒内存缓存。 | **Response Fields**: - `data.user_id / sec_user_id` (`string`): 解析出的目标账号 UID 与 sec_uid。- `data.total / raw_count / unique_count` (`integer`): 账号总关系数、原始拉取总数与 UID 去重后数量。- `data.has_more / stop_reason` (`boolean / string`): 达到页数上限时是否仍有续页依据,以及停止原因(如 page_limit / no_more)。- `data.pages` (`array`): 每页的原始数量、去重后新增数量、游标和 TikTok 返回的 has_more。- `data.users` (`array`): 去重后的关联用户列表,包含粉丝数、地区、关注状态等。 **Endpoint Errors**: - `INVALID_TARGET` (HTTP 400): 目标账号标识格式错误。- `INVALID_KIND` (HTTP 400): kind 必须为 following 或 followers。 **Example Request**: ```bashcurl -X POST "https://tikkit.mdclaw.ai/api/v1/users/relations" \ -H "Authorization: Bearer $TKKIT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"target":"@abdullah.chamkani80","kind":"followers","pages":2,"count":1}'``` <!-- Group: 直播数据 -->### 批量查询直播间在线人数 (`POST /api/v1/live/counts`) - **Supported Methods**: `GET / POST`- **Authentication**: Required (`Authorization: Bearer` or `X-API-Key`)- **Billing**: 按传入 room_id 个数计点- **Cache**: 10 秒内存缓存- **Summary**: 通过 Android 批量接口查询 1–50 个直播间的实时在线人数、累计观看、开播状态与主播昵称。 **Parameters**: | Name | In | Type | Required | Default / Constraints | Description || --- | --- | --- | --- | --- | --- || `room_ids` | `body` | `string[] \| string` | Yes | 1–50 个,每个为 1–25 位纯数字 | 直播间 room_id 数组;GET 请求可传逗号分隔字符串或重复多个 room_ids 参数。 || `room_id` | `body` | `string` | No | — | 单房间查询简写字段,与 room_ids 二选一即可。 || `X-Cache-Force` | `header` | `string` | No | enum: `1` | 传 1 时绕过 10 秒内存缓存直接回源。 | **Response Fields**: - `data.results` (`array`): 按入参顺序返回每个房间:room_id、live、online、total_viewers、status、title、anchor、nickname、started_at、cached、error。- `data.count / live / cached / invalid` (`integer`): 返回总数、开播中数量、命中缓存条数与格式非法条数。- `data.partial` (`boolean`): 存在部分房间上游拉取异常时为 true(仍返回 HTTP 200)。 **Endpoint Errors**: - `MISSING_ROOM_IDS` (HTTP 400): 未提供有效的 room_ids 或 room_id。- `BATCH_TOO_LARGE` (HTTP 413): 单次请求超过 50 个 room_id 上限。 **Example Request**: ```bashcurl -X POST "https://tikkit.mdclaw.ai/api/v1/live/counts" \ -H "Authorization: Bearer $TKKIT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"room_ids":["7704642891406265110"]}'``` ### 创建直播间发现任务 (`POST /api/v1/live/discovery/tasks`) - **Supported Methods**: `POST`- **Authentication**: Required (`Authorization: Bearer` or `X-API-Key`)- **Billing**: 0 点(受并发任务数限制)- **Cache**: 异步队列(单用户最多 3 个并发任务)- **Summary**: 提交异步直播间扫描任务,按人数门槛、分类和代理抓取合格直播间;支持游标增量 Pull 与逐房间 Webhook Push。 **Parameters**: | Name | In | Type | Required | Default / Constraints | Description || --- | --- | --- | --- | --- | --- || `proxy_id` | `body` | `string` | No | — | 管理员启用的代理配置 ID;与内联 proxy 对象二选一。 || `target_count` | `body` | `integer` | No | default: `100`; 1–1000 | 期望采集到的合格直播间数量上限,达到后自动结束。 || `min_viewers` | `body` | `integer` | No | default: `1000`; 0–1000000000 | 合格直播间最低在线人数门槛。 || `max_viewers` | `body` | `integer` | No | ≥ min_viewers | 可选最高在线人数上限。 || `categories` | `body` | `string[]` | No | default: `["all"]` | 扫描分类列表,支持 all(须单独使用)、top_live 或 game:<游戏名>(最多 21 项)。 || `timeout_seconds` | `body` | `integer` | No | default: `900`; 30–3600 | 任务最大运行时长预算(秒)。 || `pages_per_category` | `body` | `integer` | No | default: `5`; 1–20 | 每个分类最多向后扫描的页数。 || `freshness_seconds` | `body` | `integer` | No | default: `120`; 30–300 | 快照结果新鲜度有效期(秒)。 || `webhook_url / webhook_secret` | `body` | `string` | No | HTTPS 白名单主机;secret ≥ 16 字符 | 可选逐房间推送接收地址及签名密钥;自动兼容飞书/Lark 机器人地址。 || `Idempotency-Key` | `header` | `string` | No | 1–128 字符 | 幂等请求键;同键同配置重放返回 replayed: true,不同配置返回 409。 | **Response Fields**: - `data.task.id` (`string`): 任务唯一 UUID,用于后续查询进度、增量拉取或取消。- `data.task.status` (`string`): 初始状态 queued,随后变为 running / completed / partial / failed / cancelled。- `data.replayed` (`boolean`): 是否命中了 Idempotency-Key 幂等重放。- `data.webhook_secret` (`string`): 仅开启 Webhook 时返回实际生效的签名密钥。 **Endpoint Errors**: - `INVALID_PROXY_ID` (HTTP 400): 指定的 proxy_id 未启用或不存在。- `INVALID_WEBHOOK` (HTTP 400): Webhook 非 HTTPS 或不在管理员允许的白名单主机内。- `IDEMPOTENCY_CONFLICT` (HTTP 409): 相同 Idempotency-Key 传入了不同的请求参数。- `TOO_MANY_TASKS` (HTTP 429): 当前账号进行中的发现任务已达 3 个上限。 **Example Request**: ```bashcurl -X POST "https://tikkit.mdclaw.ai/api/v1/live/discovery/tasks" \ -H "Authorization: Bearer $TKKIT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"proxy_id":"my-proxy","target_count":100,"min_viewers":1000,"categories":["all"],"timeout_seconds":900,"pages_per_category":5}'``` ### 查询发现任务进度 (`GET /api/v1/live/discovery/tasks/{taskId}`) - **Supported Methods**: `GET`- **Authentication**: Required (`Authorization: Bearer` or `X-API-Key`)- **Billing**: 0 点- **Cache**: 实时读取(含自动过期检查)- **Summary**: 读取指定直播间发现任务的当前运行状态、已扫描页数、合格房间计数与 Webhook 投递统计。 **Parameters**: | Name | In | Type | Required | Default / Constraints | Description || --- | --- | --- | --- | --- | --- || `taskId` | `path` | `string` | Yes | — | 创建任务时返回的 task.id。 | **Response Fields**: - `data.status / reason` (`string`): 任务状态及结束原因(target_reached / deadline_reached / user_cancelled)。- `data.discovered_total / qualified_count` (`integer`): 累计发现与满足人数门槛的合格房间数。- `data.progress` (`object`): 当前页数、重试次数与跳过分类数等执行进度。- `data.delivery` (`object`): Webhook 逐房间投递汇总(total / sent / pending / failed)。 **Example Request**: ```bashcurl -X GET "https://tikkit.mdclaw.ai/api/v1/live/discovery/tasks/{taskId}" \ -H "Authorization: Bearer $TKKIT_API_KEY"``` ### 游标增量拉取结果 (`GET /api/v1/live/discovery/tasks/{taskId}/results`) - **Supported Methods**: `GET`- **Authentication**: Required (`Authorization: Bearer` or `X-API-Key`)- **Billing**: 0 点- **Cache**: 实时查询- **Summary**: 按 sequence 游标增量拉取任务已发现的合格直播间快照,支持正序边抓边取与倒序从最新回溯。 **Parameters**: | Name | In | Type | Required | Default / Constraints | Description || --- | --- | --- | --- | --- | --- || `taskId` | `path` | `string` | Yes | — | 任务 UUID。 || `cursor` | `query` | `integer` | No | default: `0`; ≥ 0 | 上次响应返回的 next_cursor,首次拉取传 0。 || `limit` | `query` | `integer` | No | default: `20`; 1–100 | 单次拉取返回的最大合格房间数。 || `order` | `query` | `string` | No | default: `asc`; enum: `asc`, `desc` | 排序方向:asc 从旧到新,desc 从最新往前翻。 | **Response Fields**: - `data.results` (`array`): 合格直播间列表,含 sequence、room_id、username、viewer_count、observed_at、valid_until。- `data.next_cursor` (`integer`): 下一页拉取游标。- `data.has_more` (`boolean`): 当前是否还有更多未拉取结果。 **Example Request**: ```bashcurl -X GET "https://tikkit.mdclaw.ai/api/v1/live/discovery/tasks/{taskId}/results?cursor=0&limit=20&order=asc" \ -H "Authorization: Bearer $TKKIT_API_KEY"``` ### 取消发现任务 (`DELETE /api/v1/live/discovery/tasks/{taskId}`) - **Supported Methods**: `DELETE`- **Authentication**: Required (`Authorization: Bearer` or `X-API-Key`)- **Billing**: 0 点- **Cache**: 即时生效- **Summary**: 立即终止指定直播间发现任务,释放账号租约并保留已采集到的历史结果。 **Parameters**: | Name | In | Type | Required | Default / Constraints | Description || --- | --- | --- | --- | --- | --- || `taskId` | `path` | `string` | Yes | — | 要取消的任务 ID。 | **Response Fields**: - `data.status` (`string`): 更新为 "cancelled"。- `data.reason` (`string`): 固定记录为 "user_cancelled"。 **Example Request**: ```bashcurl -X DELETE "https://tikkit.mdclaw.ai/api/v1/live/discovery/tasks/{taskId}" \ -H "Authorization: Bearer $TKKIT_API_KEY"``` <!-- Group: 作品与媒体 -->### 批量查询作品统计 (`POST /api/v1/posts/stats`) - **Supported Methods**: `GET / POST`- **Authentication**: Required (`Authorization: Bearer` or `X-API-Key`)- **Billing**: 按去重后作品条数计点- **Cache**: 5 分钟 KV 缓存- **Summary**: 批量查询 TikTok 视频或图文作品的点赞、评论、播放、分享、作者、封面与音乐信息,单次最多 10 条。 **Parameters**: | Name | In | Type | Required | Default / Constraints | Description || --- | --- | --- | --- | --- | --- || `urls` | `body` | `string[] \| string` | Yes | 1–10 条,支持完整链接、短链 ID 或纯数字 item_id | 作品链接数组;GET 请求可传逗号分隔字符串或多个 urls 参数。 || `url` | `body` | `string` | No | — | 单条作品简写参数,与 urls 二选一。 | **Response Fields**: - `data.results` (`array`): 每条作品统计:item_id、source (embed/ssr)、author、likes、comments、plays、shares、is_slideshow、cover、error。- `data.count / cached / partial` (`integer / boolean`): 返回条数、命中缓存条数与是否包含单条失败。 **Endpoint Errors**: - `MISSING_URLS` (HTTP 400): 未提供有效的 urls 或 url 参数。- `BATCH_TOO_LARGE` (HTTP 413): 单次请求超过 10 条作品上限。 **Example Request**: ```bashcurl -X POST "https://tikkit.mdclaw.ai/api/v1/posts/stats" \ -H "Authorization: Bearer $TKKIT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"urls":["https://www.tiktok.com/@user/video/7650064071173393685"]}'``` ### 解析无水印媒体直链 (`POST /api/v1/posts/media`) - **Supported Methods**: `GET / POST`- **Authentication**: Required (`Authorization: Bearer` or `X-API-Key`)- **Billing**: 1 点- **Cache**: 5 分钟 KV 缓存- **Summary**: 解析单个视频或图文作品的无水印原片直链(多码率清晰度)或高清原图列表,附带经 API 代理转发的稳定 download_url。 **Parameters**: | Name | In | Type | Required | Default / Constraints | Description || --- | --- | --- | --- | --- | --- || `url` | `body` | `string` | Yes | — | TikTok 作品链接或 15–25 位纯数字作品 ID(兼容 id 字段)。 || `X-Cache-Force` | `header` | `string` | No | enum: `1` | 直链过期时传 1 强制重新解析签名直链与会话 Cookie。 | **Response Fields**: - `data.type / media_count` (`string / integer`): 媒体类型(video / photo)与文件数量。- `data.media` (`array`): 素材列表:kind、index、format、quality、width、height、url、filename、download_url。- `data.media[].download_url` (`string`): 指向 /api/v1/posts/media/download 的代理下载地址,需带 API Key 访问。 **Endpoint Errors**: - `MISSING_URL` (HTTP 400): 缺少作品链接或作品 ID。- `INVALID_ITEM_URL` (HTTP 400): 无法从输入内容中解析出有效作品 ID。- `POST_NOT_ACCESSIBLE` (HTTP 404): 作品不存在、已删除或设为私密。 **Example Request**: ```bashcurl -X POST "https://tikkit.mdclaw.ai/api/v1/posts/media" \ -H "Authorization: Bearer $TKKIT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"https://www.tiktok.com/@alice/video/7650064071173393685"}'``` ### 代理下载媒体二进制流 (`GET /api/v1/posts/media/download`) - **Supported Methods**: `GET / POST`- **Authentication**: Required (`Authorization: Bearer` or `X-API-Key`)- **Billing**: 1 点- **Cache**: 签名失效自动刷新重试- **Summary**: 将无水印视频或图集原图通过 API 网关携带会话 Cookie 与代理中转成附件二进制流下载;签名过期自动重试。 **Parameters**: | Name | In | Type | Required | Default / Constraints | Description || --- | --- | --- | --- | --- | --- || `url` | `query` | `string` | Yes | — | TikTok 作品链接或作品 ID(兼容 id 字段)。 || `index` | `query` | `integer` | No | default: `0`; 0 ≤ index < media_count | 对应 /api/v1/posts/media 返回的 media 数组下标(兼容参数 i)。 | **Response Fields**: - `Content-Type` (`header`): 媒体真实 MIME / 格式类型,如 video/mp4 或 image/jpeg。- `Content-Disposition` (`header`): 附件下载文件名(UTF-8 编码兼容)。- `X-Media-Source` (`header`): 本次流下载所经通道来源(relay / direct)。 **Endpoint Errors**: - `INVALID_MEDIA_INDEX` (HTTP 400): index 必须是从 0 开始的整数。- `MEDIA_INDEX_OUT_OF_RANGE` (HTTP 400): index 超出了该作品实际包含的媒体文件总数。 **Example Request**: ```bashcurl -X GET "https://tikkit.mdclaw.ai/api/v1/posts/media/download?url=7650064071173393685&index=0" \ -H "Authorization: Bearer $TKKIT_API_KEY"``` ### 获取作品评论列表 (`POST /api/v1/posts/comments`) - **Supported Methods**: `POST`- **Authentication**: Required (`Authorization: Bearer` or `X-API-Key`)- **Billing**: 每次翻页 1 点- **Cache**: 实时分页- **Summary**: 按游标翻页抓取作品公开评论正文、点赞数、回复数与评论者信息;适合互动洞察与舆情采集。 **Parameters**: | Name | In | Type | Required | Default / Constraints | Description || --- | --- | --- | --- | --- | --- || `url` | `body` | `string` | Yes | — | TikTok 作品链接或纯数字作品 ID。 || `cursor` | `body` | `integer` | No | default: `0`; ≥ 0 | 分页游标;首次传 0,下一页传入上次返回的 data.cursor。 || `count` | `body` | `integer` | No | default: `20`; 1–50 | 每页期望返回评论条数。 | **Response Fields**: - `data.item_id` (`string`): 解析出的作品 ID。- `data.cursor / has_more / total` (`integer / boolean`): 下一页游标、是否还有更多评论与总评论数。- `data.comments` (`array`): 评论对象列表,含 cid、user、nickname、user_id、text、likes、replies、created。 **Endpoint Errors**: - `INVALID_ITEM_URL` (HTTP 400): url 无法解析出有效 TikTok 作品 ID。- `COMMENTS_SCHEMA` (HTTP 502): 上游评论返回结构发生变更或不可解析。 **Example Request**: ```bashcurl -X POST "https://tikkit.mdclaw.ai/api/v1/posts/comments" \ -H "Authorization: Bearer $TKKIT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"7650064071173393685","cursor":0,"count":20}'``` <!-- Group: 邮箱接码 -->### 列出已授权接码邮箱 (`GET /api/v1/email/accounts`) - **Supported Methods**: `GET`- **Authentication**: Required (`Authorization: Bearer` or `X-API-Key`)- **Billing**: 1 点- **Cache**: 实时读取- **Summary**: 返回当前 TKKIT 账号下已通过微软委托授权绑定的自有 Outlook / Hotmail 邮箱清单,绝不返回任何 Token。 **Parameters**: None. **Response Fields**: - `data.accounts` (`array`): 已授权邮箱列表,含 id、email、display_name、provider、status、last_error、last_synced_at。- `data.limit` (`integer`): 单账号允许绑定的最大邮箱数上限(20)。 **Endpoint Errors**: - `EMAIL_NOT_CONFIGURED` (HTTP 503): 服务端尚未配置 MS_GRAPH_CLIENT_ID。 **Example Request**: ```bashcurl -X GET "https://tikkit.mdclaw.ai/api/v1/email/accounts" \ -H "Authorization: Bearer $TKKIT_API_KEY"``` ### 读取邮箱验证码 (`GET /api/v1/email/codes`) - **Supported Methods**: `GET / POST`- **Authentication**: Required (`Authorization: Bearer` or `X-API-Key`)- **Billing**: 1 点- **Cache**: 8 秒同步节流- **Summary**: 按已授权邮箱地址读取收件箱与垃圾箱最近提取出的安全验证码;默认触发同步(带 8 秒微软 Graph 节流)。 **Parameters**: | Name | In | Type | Required | Default / Constraints | Description || --- | --- | --- | --- | --- | --- || `email` | `query` | `string` | Yes | — | 当前 TKKIT 账号下已授权的 Outlook / Hotmail 邮箱地址。 || `since_minutes` | `query` | `integer` | No | default: `15`; 1–1440 | 检索时间窗口(分钟)。 || `limit` | `query` | `integer` | No | default: `3`; 1–20 | 最多返回的验证码邮件条数。 || `folder` | `query` | `string` | No | default: `all`; enum: `all`, `inbox`, `junkemail` | 邮件目录筛选:全部(all)、收件箱(inbox)或垃圾箱(junkemail)。 || `sync` | `query` | `boolean \| 0 \| 1` | No | default: `1`; enum: `1`, `0` | 传 1 时先同步微软邮箱(受 8 秒节流保护),传 0 仅读取本地已入库缓存。 | **Response Fields**: - `data.latest` (`object`, nullable): 最新一条解析到的验证码对象,含 code、subject、from、received_at、folder。- `data.codes` (`array`): 时间窗口内命中的多条验证码记录列表。- `data.sync` (`object`): 本次是否实际拉取微软 Graph(fetched)、synced_at 与新增入库条数 stored。 **Endpoint Errors**: - `MISSING_EMAIL` (HTTP 400): 缺少 email 参数。- `EMAIL_ACCOUNT_NOT_FOUND` (HTTP 404): 该邮箱尚未在当前账号下授权。- `EMAIL_AUTH_REQUIRED` (HTTP 409): 邮箱 Refresh Token 已失效,需回控制台重新授权。- `EMAIL_GRAPH_RATE_LIMITED` (HTTP 503): 微软 Graph API 临时限流。 **Example Request**: ```bashcurl -X GET "https://tikkit.mdclaw.ai/api/v1/email/codes?email=you%40outlook.com&since_minutes=15&limit=3&folder=all&sync=1" \ -H "Authorization: Bearer $TKKIT_API_KEY"``` ## Common Error Codes | Code | HTTP Status | Description || --- | --- | --- || `MISSING_API_KEY` | 401 | 未在请求头提供 Authorization: Bearer 或 X-API-Key。 || `INVALID_API_KEY_FORMAT` | 401 | 密钥格式不符合 tk_live_ 前缀规范。 || `INVALID_API_KEY` | 401 | API Key 不存在或已被删除。 || `API_KEY_REVOKED` | 401 | 密钥已在工作台或后台停用。 || `API_KEY_EXPIRED` | 401 | 密钥已超过设置的到期时间。 || `API_DISABLED` | 403 | 账号每日额度被管理员设为 0。 || `API_KEY_DISABLED` | 403 | 当前密钥的每日上限被设为 0。 || `QUOTA_EXCEEDED` | 429 | 今日账号总调用额度已耗尽,北京时间次日 0 点重置。 || `KEY_QUOTA_EXCEEDED` | 429 | 单把密钥配置的每日独立上限已耗尽。 || `RATE_LIMITED` | 429 | 超过每分钟并发限速,请读取 Retry-After 秒数后退避重试。 || `INVALID_JSON` | 400 | POST 请求体不是合法的 JSON 对象。 || `INVALID_REQUEST` | 400 | 包含未知字段或整数参数超出合法范围。 || `PAYLOAD_TOO_LARGE` | 413 | JSON 请求体体积超过 64KB 上限。 || `BATCH_TOO_LARGE` | 413 | 批量请求条目数超过上限(直播 50 间 / 作品 10 条)。 || `UPSTREAM_BLOCKED` | 502 | 上游接口触发风控拦截,可配置或切换代理 relay 重试。 || `UPSTREAM_TIMEOUT` | 504 | 上游数据源响应超时,请稍后重试。 || `INTERNAL_ERROR` | 500 | 服务端内部处理异常,请携带 X-Request-Id 联系技术支持。 | 认证方式
所有需要鉴权的端点同时支持以下两种请求头,任选其一即可;密钥格式为 tk_live_ + 32 位随机串。
| 请求头 | 格式示例 | 说明 |
|---|---|---|
Authorization | Bearer tk_live_xxx | 标准 Bearer Token,与 OpenAPI/SDK 生态通用。 |
X-API-Key | tk_live_xxx | 适合反向代理或浏览器网关透传场景。 |
提示:仅 GET /api/v1/health 免鉴权探活;其余接口均会在认证阶段检查密钥是否被停用或过期。
GET /api/v1/me HTTP/1.1Host: tikkit.mdclaw.aiAuthorization: Bearer tk_live_xxxxxxxxxxxxxxxx # 或使用等价请求头:X-API-Key: tk_live_xxxxxxxxxxxxxxxx{ "success": false, "error": { "code": "INVALID_API_KEY", "message": "API Key 不存在或已失效。" }, "request_id": "0c8f4b21-7d3a-4f10-8a52-29b0c51b9e14", "usage": null}响应格式与公共响应头
除二进制下载流外,所有接口统一返回包含 success、data(或 error)、request_id 和 usage 的 JSON 包裹对象。 批量接口部分条目失败时仍返回 200 并在每条数据内给出独立错误码。
| 响应头 | 含义说明 |
|---|---|
X-Request-Id | 每次请求的唯一 UUID,排查问题与工单对齐时请提供该值。 示例:9d0b4b0e-2f1b-4b6d-a9f5-8b1d6c4a2e10 |
X-Quota-Limit | 当前账号今日有效 API 调用总额度。 示例:5000 |
X-Quota-Used | 当前账号今日已累计使用的调用次数。 示例:12 |
X-Quota-Remaining | 今日剩余可用调用次数。 示例:4988 |
X-Quota-Reset | 下次额度重置时间(UTC;北京时间次日 0 点即 UTC 当日 16:00)。 示例:2026-11-25T16:00:00.000Z |
X-RateLimit-Limit | 每分钟请求上限;0 表示当前密钥不限速。 示例:120 |
X-RateLimit-Remaining | 当前分钟窗口剩余请求数。 示例:118 |
X-RateLimit-Reset | 当前分钟窗口重置的 UTC 时间。 示例:2026-11-25T10:15:00.000Z |
Server-Timing | 网关分段耗时追踪(auth_db / admission / business / api_total 等,单位 ms)。 示例:auth;dur=12.40, business;dur=320.15, api_total;dur=341.02 |
{ "success": true, "data": { "count": 2, "partial": false, "results": [ { "room_id": "7704642891406265110", "live": true, "online": 804 } ] }, "request_id": "9d0b4b0e-2f1b-4b6d-a9f5-8b1d6c4a2e10", "usage": { "quota": 5000, "used": 12, "remaining": 4988, "reset_at": "2026-11-25T16:00:00.000Z", "units": 2, "rate_limit": 120, "rate_remaining": 118 }}额度与限速规则
每日额度按北京时间自然日累计并在次日 0 点重置(对应 UTC 16:00:00Z)。同一账号下多把密钥共享账户总额度,管理员也可单独限制某把密钥的每日上限。
| 套餐 | 每日调用 | 每分钟限速 | 有效密钥上限 |
|---|---|---|---|
| 免费版 适合快速验证接口与跑通本地 Demo | 100 次/天 | 30 次/分钟 | 2 把 |
| 专业版 适合团队看板、定时监控与多脚本集成 | 5,000 次/天 | 120 次/分钟 | 10 把 |
| 企业版 高并发自动化采集与专属单密钥限额调优 | 50,000 次/天 | 600 次/分钟 | 50 把 |
触发额度或分钟限速时返回 429 与 Retry-After 秒数。会员到期后立即回退为免费版额度。
{ "success": false, "error": { "code": "QUOTA_EXCEEDED", "message": "今日 API 调用额度已用完(5000 次/天),额度将在北京时间次日 0 点重置。" }, "request_id": "c19a21f4-8e23-49ad-b220-118ac440e27c", "usage": { "quota": 5000, "used": 5000, "remaining": 0, "reset_at": "2026-11-25T16:00:00.000Z", "rate_limit": 120, "rate_remaining": 119 }}公共错误码字典
可通过 error.code 稳定判断重试或引导用户修复。
| 错误码 (error.code) | HTTP 状态 | 说明与处理建议 |
|---|---|---|
MISSING_API_KEY | 401 | 未在请求头提供 Authorization: Bearer 或 X-API-Key。 |
INVALID_API_KEY_FORMAT | 401 | 密钥格式不符合 tk_live_ 前缀规范。 |
INVALID_API_KEY | 401 | API Key 不存在或已被删除。 |
API_KEY_REVOKED | 401 | 密钥已在工作台或后台停用。 |
API_KEY_EXPIRED | 401 | 密钥已超过设置的到期时间。 |
API_DISABLED | 403 | 账号每日额度被管理员设为 0。 |
API_KEY_DISABLED | 403 | 当前密钥的每日上限被设为 0。 |
QUOTA_EXCEEDED | 429 | 今日账号总调用额度已耗尽,北京时间次日 0 点重置。 |
KEY_QUOTA_EXCEEDED | 429 | 单把密钥配置的每日独立上限已耗尽。 |
RATE_LIMITED | 429 | 超过每分钟并发限速,请读取 Retry-After 秒数后退避重试。 |
INVALID_JSON | 400 | POST 请求体不是合法的 JSON 对象。 |
INVALID_REQUEST | 400 | 包含未知字段或整数参数超出合法范围。 |
PAYLOAD_TOO_LARGE | 413 | JSON 请求体体积超过 64KB 上限。 |
BATCH_TOO_LARGE | 413 | 批量请求条目数超过上限(直播 50 间 / 作品 10 条)。 |
UPSTREAM_BLOCKED | 502 | 上游接口触发风控拦截,可配置或切换代理 relay 重试。 |
UPSTREAM_TIMEOUT | 504 | 上游数据源响应超时,请稍后重试。 |
INTERNAL_ERROR | 500 | 服务端内部处理异常,请携带 X-Request-Id 联系技术支持。 |
账户与系统
校验 API Key 状态、查询当日实时额度与检查网关连通性。
查询额度与用量
在调试台运行校验当前 API Key 的有效性,返回密钥信息、所属套餐、今日实时消耗与可用端点列表。
请求参数
该接口无需传递额外的查询或请求体参数。
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
data.key | object | 当前密钥 ID、名称、脱敏前缀、状态、到期时间与最近使用时间。 |
data.owner | object | 密钥归属用户 ID、昵称、邮箱、有效套餐(free / pro / enterprise)。 |
data.quota | object | 每日总额度 daily_limit、已用 used、剩余 remaining、UTC 重置时间 reset_at 与每分钟限速。 |
data.today | object | 今日用户总请求、本密钥成功/失败/拒绝次数、累计点数与平均耗时。 |
data.endpoints | array | 当前版本开放的端点摘要清单。 |
curl -X GET "https://tikkit.mdclaw.ai/api/v1/me" \ -H "Authorization: Bearer $TKKIT_API_KEY"{ "success": true, "data": { "key": { "id": "key_01J9Z...", "name": "数据看板", "hint": "tk_live_xxx…abcd", "status": "active", "expires_at": null, "last_used_at": "2026-11-25T10:12:00.000Z" }, "owner": { "id": "user_01J8...", "name": "Alice", "email": "alice@example.com", "tier": "pro", "membership_expires_at": null }, "quota": { "daily_limit": 5000, "used": 14, "remaining": 4986, "reset_at": "2026-11-25T16:00:00.000Z", "rate_limit_per_minute": 120, "key_daily_limit": null }, "today": { "user_requests": 14, "user_rejected": 0, "key_requests": 14, "requests": 14, "success": 14, "failure": 0, "rejected": 0, "units": 18, "average_latency_ms": 860 } }, "request_id": "e6f5a1b2-3c4d-5e6f-8a9b-0c1d2e3f4a5b", "usage": { "quota": 5000, "used": 15, "remaining": 4985, "reset_at": "2026-11-25T16:00:00.000Z", "units": 0, "rate_limit": 120, "rate_remaining": 119 }}网关健康检查
在调试台运行检测 API 网关与服务器当前时间戳;无需传递 API Key,不消耗每日调用额度。
请求参数
该接口无需传递额外的查询或请求体参数。
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
success | boolean | 服务健康状态,正常固定返回 true。 |
service | string | 服务标识,固定为 "tkkit-api"。 |
version | string | 当前 API 版本号 "v1"。 |
time | string | 服务端当前 UTC ISO-8601 时间戳。 |
curl -X GET "https://tikkit.mdclaw.ai/api/v1/health"{ "success": true, "service": "tkkit-api", "version": "v1", "time": "2026-11-25T11:30:00.000Z"}搜索与筛选
直连 Android 搜索能力,覆盖用户、直播、视频与图文四类对象及原生筛选项。
Android 关键词搜索
在调试台运行按关键词搜索 TikTok 用户、直播、视频和图文。用户搜索支持原生粉丝档位与自定义粉丝上下限;视频搜索支持排序、类别与发布时间筛选。
请求参数
| 参数 | 类型 / 位置 | 说明 |
|---|---|---|
keyword必填 | string body | 搜索关键词;GET 请求时作为 query 参数传递。 约束:1–200 字符,禁止控制字符 |
kind可选默认:user | string body | 搜索对象类型:用户(user)、直播(live)、视频(video)或图文(photo)。 userlivevideophoto |
pages可选默认:1 | integer body | 连续翻页读取的最大页数,实际消耗点数等于 pages_fetched。 约束:1–1000 |
filters可选 | object body | 原版筛选对象(GET 请求传 JSON 字符串)。kind=user 支持 follower_number (0–4)、profile_type (0–3)、preference (0–1);kind=video 支持 sort / category / publish_date。 |
min_followers可选 | integer body | 按已读取结果做自定义最低粉丝数过滤(含边界),粉丝数未知记录会被排除。 约束:≥ 0,仅 kind=user |
max_followers可选 | integer body | 按已读取结果做自定义最高粉丝数过滤(含边界)。 约束:≥ min_followers,仅 kind=user |
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
data.kind | string | 本次搜索类型(user / live / video / photo)。 |
data.count | integer | 过滤后实际返回的记录条数。 |
data.pages_fetched | integer | 本次实际请求的上游页数(计费点数依据)。 |
data.has_more | boolean | 上游是否还有更多分页。 |
data.users / rooms / posts | array | 按 kind 分别返回用户、直播间或作品对象数组。 |
data.candidate_count / unknown_followers | integer | 仅 kind=user 返回:过滤前候选数与粉丝未知被排除人数。 |
端点常见错误码
INVALID_SEARCH400关键词为空/超长、页数越界或筛选编号非法。ANDROID_SEARCH_BUSY503搜索服务繁忙,请稍后重试。ANDROID_SEARCH_UNAVAILABLE503搜索服务暂时不可用,请联系管理员。ANDROID_SEARCH_TIMEOUT504搜索请求超时(90 秒),请稍后重试。curl -X POST "https://tikkit.mdclaw.ai/api/v1/search" \ -H "Authorization: Bearer $TKKIT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"keyword":"cooking","kind":"user","pages":2,"filters":{"follower_number":2,"profile_type":0,"preference":0},"min_followers":1000,"max_followers":10000}'{ "success": true, "data": { "source": "android", "kind": "user", "keyword": "cooking", "count": 1, "users": [ { "uid": "7000000000000000001", "username": "chef_daily", "nickname": "Chef Daily", "signature": "Home recipes every day", "follower_count": 2400, "following_count": 18, "aweme_count": 20 } ], "pages_fetched": 2, "has_more": true, "candidate_count": 20, "unknown_followers": 0, "native_filters_requested": true }, "request_id": "5c14d33a-2b7d-4e9e-a76f-8f4b2f0e9101", "usage": { "quota": 5000, "used": 18, "remaining": 4982, "reset_at": "2026-11-25T16:00:00.000Z", "units": 2 }}获取搜索筛选项
在调试台运行拉取当前 Android 用户和视频搜索支持的原版筛选组、编号(code)与中文标签。
请求参数
该接口无需传递额外的查询或请求体参数。
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
data.user | object | 用户搜索筛选字典,含 follower_number、profile_type、preference 的标题及 code/label 选项。 |
data.video | object | 视频搜索筛选字典,含 sort、category、publish_date 的 code/label 选项。 |
curl -X GET "https://tikkit.mdclaw.ai/api/v1/search/filters" \ -H "Authorization: Bearer $TKKIT_API_KEY"{ "success": true, "data": { "user": { "follower_number": { "title": "粉丝数量", "options": [ { "code": 0, "label": "不限" }, { "code": 1, "label": "< 1 万" }, { "code": 2, "label": "1 万 – 10 万" } ] }, "profile_type": { "title": "主页类型", "options": [ { "code": 0, "label": "全部" }, { "code": 1, "label": "认证账号" } ] }, "preference": { "title": "偏好", "options": [ { "code": 0, "label": "默认" }, { "code": 1, "label": "活跃创作者" } ] } }, "video": { "sort": [ { "code": "relevance", "label": "综合排序" }, { "code": "likes", "label": "最多点赞" }, { "code": "latest", "label": "最新发布" } ], "category": [ { "code": "all", "label": "全部" } ], "publish_date": [ { "code": "all", "label": "不限时间" }, { "code": "day", "label": "最近 24 小时" } ] } }, "request_id": "7a1d8810-4b23-4c99-8210-18f2b0cd5192", "usage": { "quota": 5000, "used": 19, "remaining": 4981, "reset_at": "2026-11-25T16:00:00.000Z", "units": 0 }}用户与关系
按 @用户名、UID 或 sec_uid 读取用户资料、粉丝列表与关注列表。
查询用户资料
在调试台运行通过 @用户名、数字 UID 或 MS4w 开头的 sec_uid 查询 TikTok 账号资料、粉丝数、关注数、获赞与作品数。
请求参数
| 参数 | 类型 / 位置 | 说明 |
|---|---|---|
target必填 | string body | 目标账号标识:@用户名、纯数字 UID 或 MS4w... sec_uid;纯数字用户名请务必保留前导 @。 约束:1–512 字符 |
X-Cache-Force可选默认:0 | string header | 传 1 时跳过 60 秒内存缓存直接回源刷新。 1 |
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
data.user.uid / sec_uid | stringnullable | 账号唯一数字 UID 与加密 sec_uid。 |
data.user.username / nickname | stringnullable | handle 用户名与显示昵称。 |
data.user.signature / avatar_url | stringnullable | 个性签名与 HTTPS 头像地址。 |
data.user.follower_count / following_count | integernullable | 粉丝数与关注数;上游未下发时返回 null。 |
data.user.like_count / aweme_count | integernullable | 总获赞数与作品总数。 |
data.cached | boolean | 本次结果是否命中 60 秒内存缓存。 |
端点常见错误码
INVALID_TARGET400用户名、UID 或 sec_uid 格式不正确。ANDROID_PROFILE_MISMATCH502上游返回的资料与请求目标不一致。ANDROID_PROFILE_TIMEOUT504资料后端响应超时(65 秒)。curl -X POST "https://tikkit.mdclaw.ai/api/v1/users/profile" \ -H "Authorization: Bearer $TKKIT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"target":"@ankoru5"}'{ "success": true, "data": { "user": { "uid": "7000000000000000001", "sec_uid": null, "username": "ankoru5", "nickname": "Ankoru", "signature": "Creator & live host", "avatar_url": null, "follower_count": 12000, "following_count": 50, "like_count": null, "aweme_count": 80, "source": "android", "observed_at": "2026-11-25T10:00:00.000Z" }, "cached": false }, "request_id": "31d9b4e0-8a11-4f42-b1e7-c9801d224f01", "usage": { "quota": 5000, "used": 20, "remaining": 4980, "reset_at": "2026-11-25T16:00:00.000Z", "units": 1 }}查询关注 / 粉丝列表
在调试台运行读取指定目标账号的公开粉丝列表或关注列表,自动按 UID 去重并返回分页记录与终止原因。
请求参数
| 参数 | 类型 / 位置 | 说明 |
|---|---|---|
target必填 | string body | 目标账号 @用户名、数字 UID 或 sec_uid。 |
kind必填 | string body | 查询方向:followers(粉丝列表)或 following(关注列表)。 followersfollowing |
pages可选默认:1 | integer body | 最多连续抓取的页数,计费点数等于实际抓取页数。 约束:1–10 |
count可选默认:20 | integer body | 期望每页返回的用户数。 约束:1–50 |
X-Cache-Force可选 | string header | 传 1 时跳过 15 秒内存缓存。 1 |
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
data.user_id / sec_user_id | string | 解析出的目标账号 UID 与 sec_uid。 |
data.total / raw_count / unique_count | integer | 账号总关系数、原始拉取总数与 UID 去重后数量。 |
data.has_more / stop_reason | boolean / string | 达到页数上限时是否仍有续页依据,以及停止原因(如 page_limit / no_more)。 |
data.pages | array | 每页的原始数量、去重后新增数量、游标和 TikTok 返回的 has_more。 |
data.users | array | 去重后的关联用户列表,包含粉丝数、地区、关注状态等。 |
端点常见错误码
INVALID_TARGET400目标账号标识格式错误。INVALID_KIND400kind 必须为 following 或 followers。curl -X POST "https://tikkit.mdclaw.ai/api/v1/users/relations" \ -H "Authorization: Bearer $TKKIT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"target":"@abdullah.chamkani80","kind":"followers","pages":2,"count":1}'{ "success": true, "data": { "target": "@abdullah.chamkani80", "user_id": "7680545004074320917", "sec_user_id": null, "kind": "followers", "count": 2, "total": 731, "raw_count": 2, "unique_count": 2, "pages": [ { "page": 1, "count": 1, "new_count": 1, "has_more": false }, { "page": 2, "count": 1, "new_count": 1, "has_more": false } ], "has_more": true, "stop_reason": "page_limit", "users": [ { "uid": "7652611617817576470", "sec_uid": null, "username": "waheed.khan.8004", "nickname": "Waheed", "signature": null, "follow_status": 0, "follower_status": 1, "follower_count": 12, "following_count": 40, "aweme_count": 2, "total_favorited": 18, "region": "PK" }, { "uid": "7652611617817576471", "sec_uid": null, "username": null, "nickname": null, "signature": null, "follow_status": 0, "follower_status": 1, "follower_count": null, "following_count": null, "aweme_count": null, "total_favorited": null, "region": null } ], "cached": false }, "request_id": "8b40f120-21c5-4918-a5a2-24e119b7a210", "usage": { "quota": 5000, "used": 21, "remaining": 4979, "reset_at": "2026-11-25T16:00:00.000Z", "units": 2 }}直播数据
批量查询直播间实时在线人数,或创建异步千人直播间采集任务。
批量查询直播间在线人数
在调试台运行通过 Android 批量接口查询 1–50 个直播间的实时在线人数、累计观看、开播状态与主播昵称。
请求参数
| 参数 | 类型 / 位置 | 说明 |
|---|---|---|
room_ids必填 | string[] | string body | 直播间 room_id 数组;GET 请求可传逗号分隔字符串或重复多个 room_ids 参数。 约束:1–50 个,每个为 1–25 位纯数字 |
room_id可选 | string body | 单房间查询简写字段,与 room_ids 二选一即可。 |
X-Cache-Force可选 | string header | 传 1 时绕过 10 秒内存缓存直接回源。 1 |
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
data.results | array | 按入参顺序返回每个房间:room_id、live、online、total_viewers、status、title、anchor、nickname、started_at、cached、error。 |
data.count / live / cached / invalid | integer | 返回总数、开播中数量、命中缓存条数与格式非法条数。 |
data.partial | boolean | 存在部分房间上游拉取异常时为 true(仍返回 HTTP 200)。 |
端点常见错误码
MISSING_ROOM_IDS400未提供有效的 room_ids 或 room_id。BATCH_TOO_LARGE413单次请求超过 50 个 room_id 上限。curl -X POST "https://tikkit.mdclaw.ai/api/v1/live/counts" \ -H "Authorization: Bearer $TKKIT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"room_ids":["7704642891406265110"]}'{ "success": true, "data": { "results": [ { "room_id": "7704642891406265110", "live": true, "online": 804, "total_viewers": 8614, "status": 2, "title": "Breaking live coverage", "anchor": "skynews", "nickname": "Sky News", "started_at": 1793877021, "cached": false, "error": null } ], "count": 1, "live": 1, "cached": 0, "partial": false, "invalid": 0, "ts": 1795584000 }, "request_id": "9d0b4b0e-2f1b-4b6d-a9f5-8b1d6c4a2e10", "usage": { "quota": 5000, "used": 22, "remaining": 4978, "reset_at": "2026-11-25T16:00:00.000Z", "units": 1 }}创建直播间发现任务
在调试台运行提交异步直播间扫描任务,按人数门槛、分类和代理抓取合格直播间;支持游标增量 Pull 与逐房间 Webhook Push。
请求参数
| 参数 | 类型 / 位置 | 说明 |
|---|---|---|
proxy_id可选 | string body | 管理员启用的代理配置 ID;与内联 proxy 对象二选一。 |
target_count可选默认:100 | integer body | 期望采集到的合格直播间数量上限,达到后自动结束。 约束:1–1000 |
min_viewers可选默认:1000 | integer body | 合格直播间最低在线人数门槛。 约束:0–1000000000 |
max_viewers可选 | integer body | 可选最高在线人数上限。 约束:≥ min_viewers |
categories可选默认:["all"] | string[] body | 扫描分类列表,支持 all(须单独使用)、top_live 或 game:<游戏名>(最多 21 项)。 |
timeout_seconds可选默认:900 | integer body | 任务最大运行时长预算(秒)。 约束:30–3600 |
pages_per_category可选默认:5 | integer body | 每个分类最多向后扫描的页数。 约束:1–20 |
freshness_seconds可选默认:120 | integer body | 快照结果新鲜度有效期(秒)。 约束:30–300 |
webhook_url / webhook_secret可选 | string body | 可选逐房间推送接收地址及签名密钥;自动兼容飞书/Lark 机器人地址。 约束:HTTPS 白名单主机;secret ≥ 16 字符 |
Idempotency-Key可选 | string header | 幂等请求键;同键同配置重放返回 replayed: true,不同配置返回 409。 约束:1–128 字符 |
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
data.task.id | string | 任务唯一 UUID,用于后续查询进度、增量拉取或取消。 |
data.task.status | string | 初始状态 queued,随后变为 running / completed / partial / failed / cancelled。 |
data.replayed | boolean | 是否命中了 Idempotency-Key 幂等重放。 |
data.webhook_secret | string | 仅开启 Webhook 时返回实际生效的签名密钥。 |
端点常见错误码
INVALID_PROXY_ID400指定的 proxy_id 未启用或不存在。INVALID_WEBHOOK400Webhook 非 HTTPS 或不在管理员允许的白名单主机内。IDEMPOTENCY_CONFLICT409相同 Idempotency-Key 传入了不同的请求参数。TOO_MANY_TASKS429当前账号进行中的发现任务已达 3 个上限。curl -X POST "https://tikkit.mdclaw.ai/api/v1/live/discovery/tasks" \ -H "Authorization: Bearer $TKKIT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"proxy_id":"my-proxy","target_count":100,"min_viewers":1000,"categories":["all"],"timeout_seconds":900,"pages_per_category":5}'{ "success": true, "data": { "task": { "id": "f2d9c610-4a8e-4c11-9b30-7d1e8a6f0123", "status": "queued", "config": { "target_count": 100, "min_viewers": 1000, "categories": [ "all" ], "timeout_seconds": 900, "pages_per_category": 5 }, "discovered_total": 0, "qualified_count": 0, "fresh_qualified_count": 0, "webhook_enabled": false }, "replayed": false }, "request_id": "1b2c3d4e-5f60-4a7b-8c9d-0e1f2a3b4c5d", "usage": { "quota": 5000, "used": 23, "remaining": 4977, "reset_at": "2026-11-25T16:00:00.000Z", "units": 0 }}查询发现任务进度
在调试台运行读取指定直播间发现任务的当前运行状态、已扫描页数、合格房间计数与 Webhook 投递统计。
请求参数
| 参数 | 类型 / 位置 | 说明 |
|---|---|---|
taskId必填 | string path | 创建任务时返回的 task.id。 |
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
data.status / reason | string | 任务状态及结束原因(target_reached / deadline_reached / user_cancelled)。 |
data.discovered_total / qualified_count | integer | 累计发现与满足人数门槛的合格房间数。 |
data.progress | object | 当前页数、重试次数与跳过分类数等执行进度。 |
data.delivery | object | Webhook 逐房间投递汇总(total / sent / pending / failed)。 |
curl -X GET "https://tikkit.mdclaw.ai/api/v1/live/discovery/tasks/{taskId}" \ -H "Authorization: Bearer $TKKIT_API_KEY"{ "success": true, "data": { "id": "f2d9c610-4a8e-4c11-9b30-7d1e8a6f0123", "status": "running", "discovered_total": 240, "qualified_count": 36, "fresh_qualified_count": 36, "progress": { "pages": 4, "retries": 0, "skipped_sources": 0 }, "reason": null, "webhook_enabled": true, "delivery": { "total": 36, "sent": 35, "pending": 1, "failed": 0 } }, "request_id": "2c3d4e5f-6a70-4b8c-9d0e-1f2a3b4c5d6e", "usage": { "quota": 5000, "used": 24, "remaining": 4976, "reset_at": "2026-11-25T16:00:00.000Z", "units": 0 }}游标增量拉取结果
在调试台运行按 sequence 游标增量拉取任务已发现的合格直播间快照,支持正序边抓边取与倒序从最新回溯。
请求参数
| 参数 | 类型 / 位置 | 说明 |
|---|---|---|
taskId必填 | string path | 任务 UUID。 |
cursor可选默认:0 | integer query | 上次响应返回的 next_cursor,首次拉取传 0。 约束:≥ 0 |
limit可选默认:20 | integer query | 单次拉取返回的最大合格房间数。 约束:1–100 |
order可选默认:asc | string query | 排序方向:asc 从旧到新,desc 从最新往前翻。 ascdesc |
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
data.results | array | 合格直播间列表,含 sequence、room_id、username、viewer_count、observed_at、valid_until。 |
data.next_cursor | integer | 下一页拉取游标。 |
data.has_more | boolean | 当前是否还有更多未拉取结果。 |
curl -X GET "https://tikkit.mdclaw.ai/api/v1/live/discovery/tasks/{taskId}/results?cursor=0&limit=20&order=asc" \ -H "Authorization: Bearer $TKKIT_API_KEY"{ "success": true, "data": { "task_id": "f2d9c610-4a8e-4c11-9b30-7d1e8a6f0123", "status": "running", "order": "asc", "discovered_total": 240, "qualified_count": 36, "results": [ { "sequence": 1, "room_id": "7704642891406265110", "username": "skynews", "nickname": "Sky News", "viewer_count": 1420, "observed_at": "2026-11-25T10:15:10.000Z", "valid_until": "2026-11-25T10:17:10.000Z" } ], "next_cursor": 1, "has_more": true }, "request_id": "3d4e5f6a-7b80-4c9d-0e1f-2a3b4c5d6e7f", "usage": { "quota": 5000, "used": 25, "remaining": 4975, "reset_at": "2026-11-25T16:00:00.000Z", "units": 0 }}取消发现任务
在调试台运行立即终止指定直播间发现任务,释放账号租约并保留已采集到的历史结果。
请求参数
| 参数 | 类型 / 位置 | 说明 |
|---|---|---|
taskId必填 | string path | 要取消的任务 ID。 |
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
data.status | string | 更新为 "cancelled"。 |
data.reason | string | 固定记录为 "user_cancelled"。 |
curl -X DELETE "https://tikkit.mdclaw.ai/api/v1/live/discovery/tasks/{taskId}" \ -H "Authorization: Bearer $TKKIT_API_KEY"{ "success": true, "data": { "id": "f2d9c610-4a8e-4c11-9b30-7d1e8a6f0123", "status": "cancelled", "reason": "user_cancelled", "discovered_total": 240, "qualified_count": 36 }, "request_id": "4e5f6a7b-8c90-4d0e-1f2a-3b4c5d6e7f80", "usage": { "quota": 5000, "used": 26, "remaining": 4974, "reset_at": "2026-11-25T16:00:00.000Z", "units": 0 }}作品与媒体
批量获取作品统计、解析无水印视频/图集直链、代理下载二进制流与翻页抓评论。
批量查询作品统计
在调试台运行批量查询 TikTok 视频或图文作品的点赞、评论、播放、分享、作者、封面与音乐信息,单次最多 10 条。
请求参数
| 参数 | 类型 / 位置 | 说明 |
|---|---|---|
urls必填 | string[] | string body | 作品链接数组;GET 请求可传逗号分隔字符串或多个 urls 参数。 约束:1–10 条,支持完整链接、短链 ID 或纯数字 item_id |
url可选 | string body | 单条作品简写参数,与 urls 二选一。 |
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
data.results | array | 每条作品统计:item_id、source (embed/ssr)、author、likes、comments、plays、shares、is_slideshow、cover、error。 |
data.count / cached / partial | integer / boolean | 返回条数、命中缓存条数与是否包含单条失败。 |
端点常见错误码
MISSING_URLS400未提供有效的 urls 或 url 参数。BATCH_TOO_LARGE413单次请求超过 10 条作品上限。curl -X POST "https://tikkit.mdclaw.ai/api/v1/posts/stats" \ -H "Authorization: Bearer $TKKIT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"urls":["https://www.tiktok.com/@user/video/7650064071173393685"]}'{ "success": true, "data": { "results": [ { "item_id": "7650064071173393685", "source": "embed", "url": "https://www.tiktok.com/@alice/video/7650064071173393685", "author": "alice", "nickname": "Alice", "description": "hello", "create_time": 1700000000, "likes": 1200, "comments": 34, "plays": 5600, "shares": 12, "is_slideshow": false, "cached": false } ], "count": 1, "cached": 0, "partial": false, "ts": 1795584000 }, "request_id": "4f1d2a80-6c7e-4d1d-9b0a-1f5e7c2d3b44", "usage": { "quota": 5000, "used": 27, "remaining": 4973, "reset_at": "2026-11-25T16:00:00.000Z", "units": 1 }}解析无水印媒体直链
在调试台运行解析单个视频或图文作品的无水印原片直链(多码率清晰度)或高清原图列表,附带经 API 代理转发的稳定 download_url。
请求参数
| 参数 | 类型 / 位置 | 说明 |
|---|---|---|
url必填 | string body | TikTok 作品链接或 15–25 位纯数字作品 ID(兼容 id 字段)。 |
X-Cache-Force可选 | string header | 直链过期时传 1 强制重新解析签名直链与会话 Cookie。 1 |
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
data.type / media_count | string / integer | 媒体类型(video / photo)与文件数量。 |
data.media | array | 素材列表:kind、index、format、quality、width、height、url、filename、download_url。 |
data.media[].download_url | string | 指向 /api/v1/posts/media/download 的代理下载地址,需带 API Key 访问。 |
端点常见错误码
MISSING_URL400缺少作品链接或作品 ID。INVALID_ITEM_URL400无法从输入内容中解析出有效作品 ID。POST_NOT_ACCESSIBLE404作品不存在、已删除或设为私密。curl -X POST "https://tikkit.mdclaw.ai/api/v1/posts/media" \ -H "Authorization: Bearer $TKKIT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"https://www.tiktok.com/@alice/video/7650064071173393685"}'{ "success": true, "data": { "item_id": "7650064071173393685", "source": "ssr", "type": "video", "author": "alice", "nickname": "Alice", "description": "hello", "duration": 5.34, "width": 576, "height": 1024, "media_count": 1, "media": [ { "kind": "video", "index": 0, "format": "mp4", "watermarked": false, "codec": "h264", "quality": "1080p", "bitrate": 2150000, "width": 576, "height": 1024, "duration": 5.34, "url": "https://v16-webapp-prime.tiktok.com/video/tos/alisg/xxxx/", "filename": "alice_7650064071173393685.mp4", "download_url": "https://tikkit.mdclaw.ai/api/v1/posts/media/download?url=7650064071173393685&index=0" } ], "cached": false }, "request_id": "7c2a9f10-4d6b-4e3c-9f21-8a0d5b6c7e33", "usage": { "quota": 5000, "used": 28, "remaining": 4972, "reset_at": "2026-11-25T16:00:00.000Z", "units": 1 }}代理下载媒体二进制流
在调试台运行将无水印视频或图集原图通过 API 网关携带会话 Cookie 与代理中转成附件二进制流下载;签名过期自动重试。
请求参数
| 参数 | 类型 / 位置 | 说明 |
|---|---|---|
url必填 | string query | TikTok 作品链接或作品 ID(兼容 id 字段)。 |
index可选默认:0 | integer query | 对应 /api/v1/posts/media 返回的 media 数组下标(兼容参数 i)。 约束:0 ≤ index < media_count |
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
Content-Type | header | 媒体真实 MIME / 格式类型,如 video/mp4 或 image/jpeg。 |
Content-Disposition | header | 附件下载文件名(UTF-8 编码兼容)。 |
X-Media-Source | header | 本次流下载所经通道来源(relay / direct)。 |
端点常见错误码
INVALID_MEDIA_INDEX400index 必须是从 0 开始的整数。MEDIA_INDEX_OUT_OF_RANGE400index 超出了该作品实际包含的媒体文件总数。curl -X GET "https://tikkit.mdclaw.ai/api/v1/posts/media/download?url=7650064071173393685&index=0" \ -H "Authorization: Bearer $TKKIT_API_KEY"HTTP/1.1 200 OKcontent-type: video/mp4content-disposition: attachment; filename="alice_7650064071173393685.mp4"x-media-source: relayx-request-id: 3f9c2a17-6b84-4e52-9a10-5d7c8b1e2f04 <二进制视频流>获取作品评论列表
在调试台运行按游标翻页抓取作品公开评论正文、点赞数、回复数与评论者信息;适合互动洞察与舆情采集。
请求参数
| 参数 | 类型 / 位置 | 说明 |
|---|---|---|
url必填 | string body | TikTok 作品链接或纯数字作品 ID。 |
cursor可选默认:0 | integer body | 分页游标;首次传 0,下一页传入上次返回的 data.cursor。 约束:≥ 0 |
count可选默认:20 | integer body | 每页期望返回评论条数。 约束:1–50 |
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
data.item_id | string | 解析出的作品 ID。 |
data.cursor / has_more / total | integer / boolean | 下一页游标、是否还有更多评论与总评论数。 |
data.comments | array | 评论对象列表,含 cid、user、nickname、user_id、text、likes、replies、created。 |
端点常见错误码
INVALID_ITEM_URL400url 无法解析出有效 TikTok 作品 ID。COMMENTS_SCHEMA502上游评论返回结构发生变更或不可解析。curl -X POST "https://tikkit.mdclaw.ai/api/v1/posts/comments" \ -H "Authorization: Bearer $TKKIT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"url":"7650064071173393685","cursor":0,"count":20}'{ "success": true, "data": { "item_id": "7650064071173393685", "cursor": 20, "has_more": true, "total": 100, "comments": [ { "cid": "74129850129310", "user": "bob", "nickname": "Bob", "user_id": "7000000000000000099", "text": "nice shot!", "likes": 5, "replies": 2, "created": 1700000000 } ] }, "request_id": "b3e1d0c9-5a2f-4c8e-8d71-2c9f6a4e1b22", "usage": { "quota": 5000, "used": 29, "remaining": 4971, "reset_at": "2026-11-25T16:00:00.000Z", "units": 1 }}邮箱接码
通过委托授权读取你自有 Outlook / Hotmail 邮箱的近期安全验证码。
列出已授权接码邮箱
在调试台运行返回当前 TKKIT 账号下已通过微软委托授权绑定的自有 Outlook / Hotmail 邮箱清单,绝不返回任何 Token。
请求参数
该接口无需传递额外的查询或请求体参数。
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
data.accounts | array | 已授权邮箱列表,含 id、email、display_name、provider、status、last_error、last_synced_at。 |
data.limit | integer | 单账号允许绑定的最大邮箱数上限(20)。 |
端点常见错误码
EMAIL_NOT_CONFIGURED503服务端尚未配置 MS_GRAPH_CLIENT_ID。curl -X GET "https://tikkit.mdclaw.ai/api/v1/email/accounts" \ -H "Authorization: Bearer $TKKIT_API_KEY"{ "success": true, "data": { "accounts": [ { "id": "acc_01J9...", "email": "you@outlook.com", "display_name": "You", "provider": "outlook", "status": "active", "last_error": null, "last_synced_at": "2026-11-25T10:08:00.000Z", "created_at": "2026-11-20T08:00:00.000Z" } ], "limit": 20 }, "request_id": "0a1b2c3d-4e5f-4a6b-8c7d-9e0f1a2b3c4d", "usage": { "quota": 5000, "used": 30, "remaining": 4970, "reset_at": "2026-11-25T16:00:00.000Z", "units": 1 }}读取邮箱验证码
在调试台运行按已授权邮箱地址读取收件箱与垃圾箱最近提取出的安全验证码;默认触发同步(带 8 秒微软 Graph 节流)。
请求参数
| 参数 | 类型 / 位置 | 说明 |
|---|---|---|
email必填 | string query | 当前 TKKIT 账号下已授权的 Outlook / Hotmail 邮箱地址。 |
since_minutes可选默认:15 | integer query | 检索时间窗口(分钟)。 约束:1–1440 |
limit可选默认:3 | integer query | 最多返回的验证码邮件条数。 约束:1–20 |
folder可选默认:all | string query | 邮件目录筛选:全部(all)、收件箱(inbox)或垃圾箱(junkemail)。 allinboxjunkemail |
sync可选默认:1 | boolean | 0 | 1 query | 传 1 时先同步微软邮箱(受 8 秒节流保护),传 0 仅读取本地已入库缓存。 10 |
返回字段
| 字段 | 类型 | 说明 |
|---|---|---|
data.latest | objectnullable | 最新一条解析到的验证码对象,含 code、subject、from、received_at、folder。 |
data.codes | array | 时间窗口内命中的多条验证码记录列表。 |
data.sync | object | 本次是否实际拉取微软 Graph(fetched)、synced_at 与新增入库条数 stored。 |
端点常见错误码
MISSING_EMAIL400缺少 email 参数。EMAIL_ACCOUNT_NOT_FOUND404该邮箱尚未在当前账号下授权。EMAIL_AUTH_REQUIRED409邮箱 Refresh Token 已失效,需回控制台重新授权。EMAIL_GRAPH_RATE_LIMITED503微软 Graph API 临时限流。curl -X GET "https://tikkit.mdclaw.ai/api/v1/email/codes?email=you%40outlook.com&since_minutes=15&limit=3&folder=all&sync=1" \ -H "Authorization: Bearer $TKKIT_API_KEY"{ "success": true, "data": { "email": "you@outlook.com", "account": { "id": "acc_01J9...", "email": "you@outlook.com", "display_name": "You", "provider": "outlook", "status": "active", "last_error": null, "last_synced_at": "2026-11-25T10:10:02.000Z" }, "latest": { "code": "482913", "subject": "Your TikTok verification code", "from": "noreply@account.tiktok.com", "from_name": "TikTok", "received_at": "2026-11-25T10:09:31.000Z", "folder": "inbox", "message_id": "AAMkAD..." }, "codes": [ { "code": "482913", "subject": "Your TikTok verification code", "from": "noreply@account.tiktok.com", "from_name": "TikTok", "received_at": "2026-11-25T10:09:31.000Z", "folder": "inbox", "message_id": "AAMkAD..." } ], "window_minutes": 15, "sync": { "fetched": true, "synced_at": "2026-11-25T10:10:02.000Z", "stored": 1 } }, "request_id": "5f1c8a02-9d3e-4b7a-8c21-6e4d0a9b3f75", "usage": { "quota": 5000, "used": 31, "remaining": 4969, "reset_at": "2026-11-25T16:00:00.000Z", "units": 1 }}立刻拿真实数据跑通你的第一个请求。
在工作台生成 API Key,或先打开在线调试台免配脚本体验全量端点。