@clawhub-dr-xiaoming-1a94a5296b
Connect an OpenClaw workspace to an Obsidian vault and maintain a structured knowledge sync workflow. Use when setting up Obsidian integration, linking a vau...
--- name: obsidian-openclaw-sync description: Connect an OpenClaw workspace to an Obsidian vault and maintain a structured knowledge sync workflow. Use when setting up Obsidian integration, linking a vault into the workspace, organizing notes into reusable folders, syncing user, profile, org, methodology, and journal content into markdown files, or teaching other OpenClaw agents how to persist working context into Obsidian. Covers symlink-based vault connection, note placement rules, daily journal sync, and mirroring OpenClaw self-knowledge into Obsidian. --- # Obsidian and OpenClaw Sync Use this skill to connect OpenClaw with an Obsidian vault and keep knowledge organized as markdown files that humans and agents can both reuse. ## Core pattern Treat `obsidian/` in the workspace as the vault entrypoint. Preferred setup on macOS: ```bash ln -s "/absolute/path/to/your/Obsidian/Vault" ./obsidian ``` This keeps OpenClaw operating inside the workspace while writing directly into the real vault. ## What to store where Use a stable folder taxonomy. Current proven structure: - `00-人物/` — people profiles, role cards, relationship context, resume variants - `10-组织/` — org structures, team maps, stakeholder context - `20-方法论/` — reusable frameworks, SOPs, evaluation logic, decision rules - `30-日志/` — daily journals and chronological work summaries - `90-OpenClaw/` — mirrored agent operating context (`AGENTS.md`, `USER.md`, `MEMORY.md`, etc.) Do not dump everything into one folder. Prefer one note = one durable topic. ## Writing rules 1. Distill first, then write. 2. Prefer structured markdown over raw chat transcripts. 3. Create overview pages when details begin to scatter. 4. Separate raw daily logs from long-term reusable knowledge. 5. When a note reflects evolving judgment, write the current best understanding instead of preserving every conversational twist. ## Recommended note types ### 1. Person notes Use for: - user profile - leaders / collaborators / stakeholders - role positioning - performance goals - relationship context Typical examples: - `00-人物/佘金明.md` - `00-人物/章东丞.md` - `00-人物/佘金明-工作画像.md` ### 2. Org notes Use for: - team structure - reporting lines - collaboration topology - account/project organization Typical example: - `10-组织/BlueFocus-宁德时代项目组.md` ### 3. Methodology notes Use for: - frameworks that will be reused - evaluation models - operating principles - AI workflow / SOP abstractions Typical examples: - `20-方法论/AI助理-评估与运营改进框架.md` - `20-方法论/AI助理运营阶段性汇报-3月9日上线至今.md` ### 4. Daily journal notes Use for: - what was done today - outputs created - stage results - next-step suggestions Typical example: - `30-日志/YYYY-MM-DD.md` ### 5. OpenClaw mirror notes Mirror key workspace files into `90-OpenClaw/` when you want the Obsidian vault to contain the agent's operating context. Typical files: - `AGENTS.md` - `SOUL.md` - `USER.md` - `MEMORY.md` - `TOOLS.md` - `HEARTBEAT.md` ## Workflow: convert chat work into Obsidian knowledge ### A. Identify the knowledge type Ask: - Is this about a person? - Is this about an org/team? - Is this a reusable method? - Is this just today’s progress? - Is this agent self-context that should be mirrored? ### B. Choose the destination note - Append to an existing note if the topic already exists. - Create a new note if the content would otherwise make an unrelated note bloated. - Create an overview note when several related notes need a summary layer. ### C. Rewrite into durable markdown Prefer sections like: - 基本信息 - 当前理解 - 核心职责 - 协作关系 - 方法论 - 今日完成 - 下一步建议 ### D. Keep logs and knowledge separate - Put “today what happened” in `30-日志/` - Put reusable conclusions in `00-人物/`, `10-组织/`, `20-方法论/` ## Workflow: daily journal sync When asked to write a daily journal: 1. Summarize the day’s actual completed work. 2. List key files/outputs created. 3. Capture stage-level outcomes, not just actions. 4. Add recommended next steps if useful. 5. Save to `30-日志/YYYY-MM-DD.md`. ## Workflow: mirror OpenClaw context into Obsidian Use when you want the vault to preserve the agent’s own operating documents. Mirror from workspace root into `obsidian/90-OpenClaw/`: - `AGENTS.md` - `BOOTSTRAP.md` if still relevant - `IDENTITY.md` - `SOUL.md` - `USER.md` - `MEMORY.md` - `TOOLS.md` - `HEARTBEAT.md` This is useful for: - letting humans inspect agent context in Obsidian - keeping system memory visible and editable - preserving operational continuity in the vault ## Practical rules for other agents - Respect privacy: do not export sensitive material to shared vaults unless explicitly intended. - Prefer incremental updates over large rewrites. - If content comes from screenshots or docs, convert it into structured text before storing. - If multiple notes are created in one task, also create or update one summary/overview note when helpful. - Do not assume Obsidian plugins or APIs are available; plain markdown file operations are sufficient. ## Verification checklist After setup or sync, verify: ```bash ls -la ./obsidian find -L ./obsidian -maxdepth 3 -type f | sort | sed -n '1,50p' ``` Confirm: - `obsidian/` exists and points to the real vault or is a real folder - target markdown files were created in the intended category - note names are human-readable - content is structured enough for future reuse ## Bundled references - Folder structure and note placement: `references/structure.md` - Reusable operating workflow: `references/workflow.md` - Example vault patterns from current usage: `references/examples.md` FILE:references/examples.md # Current usage examples ## Example 1: user profile note `00-人物/佘金明.md` Contains: - identity basics - role positioning - work style - collaboration relationships - performance goals ## Example 2: overview note `00-人物/佘金明-工作画像.md` Contains: - one-line positioning - current role - core responsibilities - collaboration map - working style - unique value in team Use this pattern when many details exist and a summary layer is needed. ## Example 3: org note `10-组织/BlueFocus-宁德时代项目组.md` Contains: - team structure - major roles - project-side collaboration structure - current methodological judgments ## Example 4: methodology note `20-方法论/AI助理-评估与运营改进框架.md` Contains: - value evaluation dimensions - distortion sources - improvement directions - relation to broader digital-employee path ## Example 5: daily journal note `30-日志/2026-04-07.md` Contains: - daily completed work - files created - stage outcomes - next-step suggestions ## Example 6: OpenClaw mirror area `90-OpenClaw/` Contains mirrored operational files such as: - `AGENTS.md` - `USER.md` - `MEMORY.md` - `SOUL.md` Use this when the vault should also function as an inspectable operating console for the agent. FILE:references/structure.md # Obsidian structure reference ## Proven vault layout - `00-人物/` - user profile notes - collaborator / leader notes - role summaries - resume and positioning variants - `10-组织/` - team structure - account/project org mapping - `20-方法论/` - frameworks - SOPs - evaluation logic - decision records with reusable value - `30-日志/` - daily work journals - `90-OpenClaw/` - mirrored agent operating files ## Naming patterns Use explicit, readable names. Examples: - `佘金明.md` - `佘金明-工作画像.md` - `BlueFocus-宁德时代项目组.md` - `AI助理-评估与运营改进框架.md` - `2026-04-07.md` ## Placement heuristics - Person-specific facts → `00-人物/` - Team / reporting / stakeholder map → `10-组织/` - Reusable reasoning / framework → `20-方法论/` - Chronological recap → `30-日志/` - Agent self-context → `90-OpenClaw/` FILE:references/workflow.md # Obsidian workflow reference ## Setup workflow 1. Ensure the real Obsidian vault location is known. 2. Link the vault into the workspace with a symlink or create `obsidian/` as a normal folder. 3. Verify file visibility through the workspace path. 4. Start writing markdown files into category folders. Example: ```bash ln -s "/Users/yourname/Desktop/Obsidian/YourVault" ./obsidian find -L ./obsidian -maxdepth 2 -type f | head ``` ## Knowledge sync workflow 1. Read the source material. 2. Distill the stable facts and current judgment. 3. Decide whether the destination is person/org/methodology/journal/openclaw mirror. 4. Update an existing note or create a new note. 5. Keep wording readable for humans, not just machine-oriented. ## Daily journal workflow A good daily note should contain: - 今天做了什么 - 形成了哪些产出 - 阶段性结果是什么 - 接下来适合做什么 ## Mirror workflow When mirroring OpenClaw files into Obsidian: - copy the current canonical text - avoid partial snippets when the full file is short and operationally important - keep filenames unchanged for easier cross-reference
CATL (宁德时代) project wiki knowledge base — shared across all agents. Activate when: (1) looking up CATL client info, project docs, industry research, content...
---
name: catl-wiki
description: |
CATL (宁德时代) project wiki knowledge base — shared across all agents.
Activate when: (1) looking up CATL client info, project docs, industry research, content assets, or SOPs,
(2) adding/updating wiki content for the CATL project, (3) user mentions 宁德wiki, 知识库, client profile,
项目文档, 行业研究, or any CATL project knowledge query. Provides wiki node mapping, read/write workflows,
and mandatory changelog tracking. NOT for: non-CATL wikis, general feishu doc editing unrelated to the
knowledge base, or feishu drive/permission management.
---
# CATL Wiki Knowledge Base
Shared knowledge base for the 宁德时代 (CATL) project team, hosted on Feishu Wiki.
## Quick Reference
- **Space ID**: 7624480701739519200
- **Modules**: 客户档案 / 项目文档 / 行业研究 / 内容资产 / 流程规范 / 变更记录
Full node token mapping: see [references/wiki-structure.md](references/wiki-structure.md)
## Reading Content
1. Identify the module from the table in wiki-structure.md
2. Get the doc token:
3. Read content:
4. For sub-pages, list children:
## Writing / Updating Content
1. Get obj_token (same as reading step 2)
2. Write content:
3. **MANDATORY — Log the change** (both steps required):
### Step A: Local changelog
Done: [2026-04-07 07:23 UTC] <your_agent_name> -> <module>: <summary>
### Step B: Feishu wiki changelog page
Append a line to the 变更记录 wiki page:
The changelog node token is in wiki-structure.md.
> **Skipping changelog = violation.** Every wiki edit must be logged in both places.
## Creating New Pages
To add a sub-page under an existing module:
After creating, update wiki-structure.md with the new node token, and log the change.
## Module Guide
| Module | What belongs here |
|--------|-------------------|
| 客户档案 | CATL company info, products, contacts, collaboration history |
| 项目文档 | KOC plans, RFP proposals, meeting notes, deliverables |
| 行业研究 | Market data, competitor intel, policy trends, tech analysis |
| 内容资产 | Topic pools, scripts, content ratios, case studies |
| 流程规范 | Workflows, tool guides, best practices, templates |
| 变更记录 | Auto-maintained — do not manually edit except via changelog process |
## Notes
- Feishu docx blocks batch limit: ≤20 per API call
- Block type 2 (text) is the safe default for children blocks
- Insert at index=0 for prepend, omit for append
FILE:changelog.md
# Wiki Changelog
| Time | Agent | Module | Change |
|------|-------|--------|--------|
| 2026-04-07 07:25 UTC | test-1 | 全局 | 知识库Skill初始化,创建变更记录页面 |
FILE:references/wiki-structure.md
# 宁德时代业务组 Wiki 知识库结构
## Space 信息
- **Space ID**: 7624480701739519200
- **Space名称**: 宁德时代业务组知识库
## 节点树
```
首页 (XBTFw1mjziSUmAkehtIcZW6on1d / doc: CBDcdaQceoOXYUxlhRpcUVYcncH)
├── 客户档案 (VlezwpfNjibPq2kG26acmX73npb)
│ └── CATL基本信息、产品线、甲方对接人、合作历史
├── 项目文档 (EACHwv9RriIZ2MksEHRcvWMvn7b)
│ └── KOC矩阵运营、RFP海外PR方案、龙虾试验、Q2问题
├── 行业研究 (Q1fxw6BRLiA0twkRfMScZD00nBg)
│ └── 市场规模、竞争地位、关键趋势、政策
├── 内容资产 (WrdcwmfOBirczCk2mGmci0PAn7c)
│ └── 选题池、内容配比、成功案例
├── 流程规范 (Qg5DwFWNbixBorkfxrKcvblznNg)
│ └── 工作流、工具指南、最佳实践
└── 变更记录 (Unwzwu5jNinIb8k3YAtcU86hnCe / doc: XVCRdvMbaoi5nFxpizccv0IBnMb)
└── 所有agent对wiki的编辑日志
```
## 节点Token速查
| 模块 | node_token | 用途 |
|------|-----------|------|
| 首页 | XBTFw1mjziSUmAkehtIcZW6on1d | 导航门户 |
| 客户档案 | VlezwpfNjibPq2kG26acmX73npb | 甲方信息 |
| 项目文档 | EACHwv9RriIZ2MksEHRcvWMvn7b | 项目交付物 |
| 行业研究 | Q1fxw6BRLiA0twkRfMScZD00nBg | 行业情报 |
| 内容资产 | WrdcwmfOBirczCk2mGmci0PAn7c | 内容库 |
| 流程规范 | Qg5DwFWNbixBorkfxrKcvblznNg | SOP |
| 变更记录 | Unwzwu5jNinIb8k3YAtcU86hnCe | 审计日志 |
## 读取某个模块的流程
1. 用 `feishu_wiki { "action": "get", "token": "<node_token>" }` 获取 `obj_token`
2. 用 `feishu_doc { "action": "read", "doc_token": "<obj_token>" }` 读取内容
3. 如模块下有子节点,用 `feishu_wiki { "action": "nodes", "space_id": "7624480701739519200", "parent_node_token": "<node_token>" }` 列出
## 编辑某个模块的流程
1. 获取 obj_token(同上)
2. 用 `feishu_doc { "action": "write", "doc_token": "<obj_token>", "content": "..." }` 写入
3. **必须**执行 changelog 记录(见 SKILL.md 变更记录章节)
FILE:scripts/log-change.sh
#!/usr/bin/env bash
# Log wiki changes to local changelog
# Usage: log-change.sh <agent_name> <module> <action_summary>
set -euo pipefail
CHANGELOG_FILE="$(dirname "$0")/../changelog.md"
AGENT="?Usage: log-change.sh <agent> <module> <summary>"
MODULE="?Missing module"
SUMMARY="?Missing summary"
TIMESTAMP="$(date -u +'%Y-%m-%d %H:%M UTC')"
if [ ! -f "$CHANGELOG_FILE" ]; then
printf '# Wiki Changelog
| Time | Agent | Module | Change |
|------|-------|--------|--------|
' > "$CHANGELOG_FILE"
fi
echo "| TIMESTAMP | AGENT | MODULE | SUMMARY |" >> "$CHANGELOG_FILE"
echo "Done: [TIMESTAMP] AGENT -> MODULE: SUMMARY"
Concurrent task queue management for sub-agent orchestration. Provides a /queue command for real-time visibility into active, queued, and completed sub-agent...
---
name: task-queue
description: >
Concurrent task queue management for sub-agent orchestration. Provides a /queue command
for real-time visibility into active, queued, and completed sub-agent tasks. Use when:
(1) user sends /queue or /quene to check task status, (2) spawning a sub-agent task that
should be tracked, (3) managing concurrent workload across multiple sub-agents,
(4) user asks about task capacity or current workload. Supports configurable concurrency
limits, automatic FIFO scheduling, typed task categorization, and portable deployment
across different machines. NOT for: task board/kanban management (use mc-task), simple
single-step tasks handled in main session, or project-level tracking.
---
# Task Queue
Manage concurrent sub-agent tasks with real-time visibility. Main session stays responsive;
heavy work runs in parallel sub-agents tracked by a queue.
## Setup
Initialize the queue state file on first use:
```bash
cat > /tmp/task-queue.json << 'EOF'
{
"maxConcurrent": 8,
"maxSameType": 3,
"active": [],
"queued": [],
"completed": [],
"stats": { "totalSpawned": 0, "totalCompleted": 0, "totalFailed": 0 },
"updatedAt": null
}
EOF
```
Adjust `maxConcurrent` by machine:
- Low-end (Mac Mini 16GB): 3-4
- Mid-range (Mac Studio 64GB): 6
- Server (64+ cores, 128GB+): 8
## Commands
| Command | Action |
|---------|--------|
| `/queue` or `/quene` | Show current queue status |
| `/queue clear` | Clear completed task history |
| `/queue kill <Q-ID>` | Terminate a specific task |
## Queue Protocol
### On new task (that needs sub-agent)
1. Generate sequential ID: `Q-001`, `Q-002`, ...
2. Classify type: `research | dev | report | search | translate | analysis | other`
3. Check capacity:
- `active.length < maxConcurrent` AND same-type count < `maxSameType` → spawn, add to `active`
- Otherwise → add to `queued`, notify user of position
4. Update `/tmp/task-queue.json`
### On task completion
1. Move from `active` to `completed` (keep last 20)
2. Pop next from `queued` if any, spawn it
3. Update stats
4. Report result to user
### On task failure
1. Record in `completed` with `"result": "failed"` and reason
2. Notify user with suggestion (retry / alternative / manual)
3. Continue dequeuing — failures don't block the queue
### /queue response format
```
📋 任务队列 (活跃 X/8 | 排队 Y)
🔄 运行中:
Q-001 [research] 海外媒体分析 (3m ago)
Q-002 [dev] 修复登录bug (1m ago)
⏳ 排队中:
Q-003 [report] 周报生成
✅ 最近完成:
Q-000 [search] KOL筛选 → 成功 (5m)
```
If empty: report "全空,随时可以塞活"
## Data Schema
See [references/schema.md](references/schema.md) for the complete JSON structure
of `/tmp/task-queue.json`.
## Dispatch Rules
Decide whether to queue (spawn sub-agent) or handle directly in main session:
**Queue it** (any one triggers):
- Estimated time > 2 minutes
- Batch operations (bulk search, multi-doc processing)
- Development / code tasks
- Deep research or analysis
- Long document generation
- User sends multiple independent tasks at once
**Handle directly** (all true):
- Simple Q&A, chat, confirmations
- Quick lookups (read file, check status)
- 1-2 step operations
- Needs multi-turn clarification first
When uncertain, prefer queuing — better to over-spawn than block the main session.
## Portable Deployment
To deploy on another machine (e.g., Mac with a different OpenClaw agent):
1. Install this skill to the target agent's skills directory
2. Create `/tmp/task-queue.json` with the init template above
3. Adjust `maxConcurrent` for the machine's resources
4. Add `/queue` trigger to the agent's routing config (AGENTS.md or equivalent)
FILE:references/schema.md
# Queue State Schema
## /tmp/task-queue.json
```json
{
"maxConcurrent": 8,
"maxSameType": 3,
"active": [
{
"id": "Q-001",
"task": "Task description",
"type": "research|dev|report|search|translate|analysis|other",
"sessionId": "subagent-session-id",
"startedAt": "2026-03-26T07:30:00Z",
"status": "running"
}
],
"queued": [
{
"id": "Q-002",
"task": "Task description",
"type": "research",
"queuedAt": "2026-03-26T07:31:00Z"
}
],
"completed": [
{
"id": "Q-001",
"task": "Task description",
"type": "research",
"startedAt": "2026-03-26T07:30:00Z",
"completedAt": "2026-03-26T07:35:00Z",
"result": "success|failed",
"summary": "One-line result summary"
}
],
"stats": {
"totalSpawned": 0,
"totalCompleted": 0,
"totalFailed": 0
},
"updatedAt": "2026-03-26T07:30:00Z"
}
```
## Field Reference
| Field | Type | Description |
|-------|------|-------------|
| `maxConcurrent` | number | Max simultaneous sub-agents |
| `maxSameType` | number | Max sub-agents of the same type |
| `active[].id` | string | Sequential ID (Q-NNN) |
| `active[].task` | string | Human-readable task description |
| `active[].type` | enum | Task category for concurrency grouping |
| `active[].sessionId` | string | OpenClaw sub-agent session ID |
| `active[].startedAt` | ISO 8601 | When the sub-agent was spawned |
| `queued[].queuedAt` | ISO 8601 | When the task entered the queue |
| `completed[].result` | enum | "success" or "failed" |
| `completed[].summary` | string | Brief outcome description |
| `stats.*` | number | Lifetime counters |
## Capacity Rules
- Total active ≤ `maxConcurrent`
- Active of same `type` ≤ `maxSameType`
- Completed list capped at 20 (oldest evicted)
- Queue is FIFO — first in, first out
Send rich interactive card messages to Feishu via Open API. Activate when: user wants to send a Feishu card, interactive message, rich notification, formatte...
---
name: feishu-card
description: >
Send rich interactive card messages to Feishu via Open API.
Activate when: user wants to send a Feishu card, interactive message, rich notification,
formatted alert, news digest card, data dashboard with charts, or any styled message
beyond plain text in Feishu. Supports: markdown cards, raw card JSON, template-based cards
(news_digest, report, alert, data_dashboard), and chart components (line/bar/pie).
NOT for: plain text messages, reading messages, or managing Feishu docs/wiki.
---
# Feishu Card Message Skill
Send rich interactive card messages through Feishu Open API via `scripts/feishu_card.py`.
## Prerequisites
- `FEISHU_APP_ID` and `FEISHU_APP_SECRET` env vars (or `--app-id`/`--app-secret` flags)
- Feishu app must have `im:message:send_as_bot` permission
- Target user/chat must be reachable by the bot
## Quick Start
```bash
SKILL_DIR=~/.openclaw/skills/feishu-card
# Simple markdown card
python3 $SKILL_DIR/scripts/feishu_card.py \
--to <receive_id> --type open_id \
--markdown "**Hello!** This is a card." \
--title "Greeting" --color blue
# Raw card JSON file
python3 $SKILL_DIR/scripts/feishu_card.py \
--to <receive_id> --type chat_id \
--card /path/to/card.json
# Template-based card
python3 $SKILL_DIR/scripts/feishu_card.py \
--to <receive_id> --type open_id \
--template news_digest --data /path/to/news.json
```
## Three Modes
### 1. Markdown Mode (`--markdown`)
Wrap markdown text into a card. Combine with `--title` and `--color`.
Colors: `blue` `wathet` `turquoise` `green` `yellow` `orange` `red` `carmine` `violet` `purple` `indigo` `grey` `default`
### 2. Raw Card Mode (`--card`)
Pass a pre-built card JSON file (schema 2.0). Full control over all components.
### 3. Template Mode (`--template` + `--data`)
Use bundled templates with a data JSON file.
| Template | Use Case | Key Data Fields |
|----------|----------|----------------|
| `news_digest` | Multi-item news | `title`, `footer`, `items[]` (title, summary, source, time, url) |
| `report` | Structured report | `title`, `summary`, `conclusion`, `footer`, `items[]` (title, content) |
| `alert` | Alert/notification | `title`, `level`, `time`, `detail`, `action`, `footer` |
| `data_dashboard` | Data dashboard with chart | `title`, `metric_1..3`, `chart_type`, `chart_title`, `chart_data`, `x_field`, `y_field`, `series_field`, `details`, `footer` |
## Chart Support
Feishu Schema 2.0 supports `chart` components (VChart-based). Three chart types: **line**, **bar**, **pie**.
## Image Support
Upload and embed images in cards. Supports local files and URLs.
```bash
# Append image to any card mode
python3 $SKILL_DIR/scripts/feishu_card.py \
--to <id> --type open_id \
--markdown "Check this out:" --title "Photo" \
--image /path/to/photo.png
# URL also works (auto-downloads then uploads to Feishu)
python3 $SKILL_DIR/scripts/feishu_card.py \
--to <id> --type open_id \
--markdown "News image:" \
--image "https://example.com/image.jpg"
```
### Programmatic image upload
```python
from feishu_card import get_tenant_token, upload_image, build_image_element
token = get_tenant_token(app_id, app_secret)
# From local file or URL
img_key = upload_image(token, "/path/to/image.png")
# or: img_key = upload_image(token, "https://example.com/photo.jpg")
# Build card element
img_el = build_image_element(img_key, alt_text="描述", mode="fit_horizontal")
# Insert img_el into card["body"]["elements"]
```
**Note:** Feishu only accepts real image files (PNG/JPG/GIF/BMP). SVG and HTML pages disguised as images will fail with error `234011`.
### Programmatic chart building
```python
import sys; sys.path.insert(0, "~/.openclaw/skills/feishu-card/scripts")
from feishu_card import build_chart_element, get_tenant_token, send_card
chart = build_chart_element(
chart_type="line",
data_values=[
{"date": "1月", "value": 100},
{"date": "2月", "value": 150},
],
title="月度趋势",
x_field="date",
y_field="value",
)
card = {
"schema": "2.0",
"config": {"wide_screen_mode": True},
"header": {"title": {"tag": "plain_text", "content": "📊 报表"}, "template": "blue"},
"body": {"elements": [chart]},
}
token = get_tenant_token(app_id, app_secret)
send_card(token, receive_id, "open_id", card)
```
For chart JSON structure details, see `references/card-components.md` → Chart 图表。
## Additional Options
- `--reply-to <message_id>` — Reply to an existing message
- `--type open_id|chat_id` — Receiver ID type
## Programmatic Use
```python
from feishu_card import get_tenant_token, build_card_from_markdown, send_card
token = get_tenant_token(app_id, app_secret)
card = build_card_from_markdown("**Hello**", title="Test", color="blue")
send_card(token, receive_id, "open_id", card)
```
### Building complex cards programmatically
```python
import json
from feishu_card import get_tenant_token, send_card, build_chart_element
token = get_tenant_token(app_id, app_secret)
card = {
"schema": "2.0",
"config": {"wide_screen_mode": True},
"header": {
"title": {"tag": "plain_text", "content": "周报"},
"template": "purple",
},
"body": {
"elements": [
{"tag": "markdown", "content": "**本周总结**\n完成了 3 个里程碑"},
{"tag": "hr"},
{
"tag": "column_set",
"flex_mode": "none",
"columns": [
{"tag": "column", "width": "weighted", "weight": 1,
"elements": [{"tag": "markdown", "content": "**完成率**\n<font color='green'>92%</font>"}]},
{"tag": "column", "width": "weighted", "weight": 1,
"elements": [{"tag": "markdown", "content": "**延期项**\n<font color='red'>2</font>"}]},
],
},
{"tag": "hr"},
build_chart_element("bar", [
{"task": "需求", "count": 15, "type": "完成"},
{"task": "需求", "count": 3, "type": "进行中"},
{"task": "Bug", "count": 8, "type": "完成"},
{"task": "Bug", "count": 1, "type": "进行中"},
], title="任务统计", x_field="task", y_field="count", series_field="type", stack=True),
{"tag": "hr"},
{
"tag": "collapsible_panel",
"expanded": False,
"header": {"title": {"tag": "plain_text", "content": "查看详情"}},
"elements": [{"tag": "markdown", "content": "详细内容..."}],
},
{"tag": "hr"},
{"tag": "markdown", "content": "<font color='grey'>自动生成 | 周报系统</font>"},
]
},
}
send_card(token, receive_id, "open_id", card)
```
## ⚠️ Schema 2.0 陷阱(实测踩坑记录)
这些是实际发送卡片时遇到的兼容性问题,会导致 `200861 unsupported tag` 错误:
| 陷阱 | 说明 | 解决方案 |
|------|------|---------|
| `action` 标签已废弃 | 按钮容器在 Schema 2.0 中不可用 | 用 markdown `[文字](url)` 链接替代 |
| `note` 标签已废弃 | 底部备注标签不可用 | 用 `markdown` + `<font color='grey'>...</font>` |
| `collapsible_panel.vertical_spacing` | 不接受 `"default"` 字符串值 | **省略此属性**,或用 `"8px"` 等像素值 |
## 已实测可用组件
| 组件 | 状态 | 说明 |
|------|------|------|
| `markdown` | ✅ 已验证 | 支持粗体/链接/列表/font color |
| `hr` | ✅ 已验证 | 分割线 |
| `column_set` | ✅ 已验证 | 多列布局 |
| `collapsible_panel` | ✅ 已验证 | 折叠面板(注意 vertical_spacing 陷阱) |
| `img` | ✅ 已验证 | 图片(upload_image 上传后嵌入,支持本地文件和URL) |
| `chart` | ✅ 已验证 | VChart 图表(line/bar/pie) |
完整组件参考:`references/card-components.md`
FILE:references/card-components.md
# 飞书卡片组件速查手册 (Schema 2.0)
> ⚠️ **实测日期:2026-03-25** — 所有标注 ✅ 的组件已在飞书 Open API 验证通过。
---
## ⚠️ Schema 2.0 废弃标签(重要!)
以下标签在 Schema 2.0 中**已废弃**,发送会报 `200861 unsupported tag` 错误:
| 废弃标签 | 说明 | 替代方案 |
|---------|------|---------|
| `action` | 按钮容器 | 用 markdown `[文字](url)` 链接替代 |
| `note` | 底部备注 | 用 markdown + `<font color='grey'>...</font>` 替代 |
### 按钮替代方案
```json
// ❌ 废弃写法
{"tag": "action", "actions": [{"tag": "button", "text": {"tag": "plain_text", "content": "查看"}, "url": "https://..."}]}
// ✅ 替代写法
{"tag": "markdown", "content": "[查看详情](https://...)"}
```
### 备注替代方案
```json
// ❌ 废弃写法
{"tag": "note", "elements": [{"tag": "plain_text", "content": "备注文字"}]}
// ✅ 替代写法
{"tag": "markdown", "content": "<font color='grey'>备注文字</font>"}
```
---
## Card 基本结构 ✅
```json
{
"schema": "2.0",
"config": {"wide_screen_mode": true},
"header": {
"title": {"tag": "plain_text", "content": "标题文字"},
"template": "blue"
},
"body": {"elements": [ ... ]}
}
```
**颜色模板:** `blue` `wathet` `turquoise` `green` `yellow` `orange` `red` `carmine` `violet` `purple` `indigo` `grey` `default`
---
## Markdown ✅
```json
{"tag": "markdown", "content": "**粗体** *斜体* ~~删除线~~ `代码`\n- 列表\n[链接](url)\n<at id=all></at>\n<font color='red'>彩色文字</font>"}
```
支持:粗体、斜体、删除线、行内代码、链接、列表、引用、@人、`<font color>` 标签
---
## HR 分割线 ✅
```json
{"tag": "hr"}
```
---
## Column Set 多列布局 ✅
```json
{
"tag": "column_set",
"flex_mode": "none",
"background_style": "default",
"columns": [
{
"tag": "column",
"width": "weighted",
"weight": 1,
"vertical_align": "top",
"elements": [{"tag": "markdown", "content": "左列"}]
},
{
"tag": "column",
"width": "weighted",
"weight": 1,
"vertical_align": "top",
"elements": [{"tag": "markdown", "content": "右列"}]
}
]
}
```
- **flex_mode:** `none` | `stretch` | `flow` | `bisect`
- **width:** `"weighted"` (配合 weight) | `"auto"` | 固定像素如 `"120px"`
---
## Collapsible Panel 折叠面板 ✅
```json
{
"tag": "collapsible_panel",
"expanded": false,
"header": {
"title": {"tag": "plain_text", "content": "展开查看详情"}
},
"elements": [
{"tag": "markdown", "content": "折叠内容..."}
]
}
```
> ⚠️ **陷阱:** `vertical_spacing` 属性不接受 `"default"` 等字符串值。建议**省略此属性**,或用像素值如 `"8px"`。
---
## Image 图片 ✅
```json
{
"tag": "img",
"img_key": "img_v2_xxx",
"alt": {"tag": "plain_text", "content": "alt text"},
"mode": "fit_horizontal",
"preview": true
}
```
需先通过飞书上传图片接口获取 `img_key`。
---
## Chart 图表 ✅
基于 VChart 的图表组件,支持折线图、柱状图、饼图。
### 折线图 (line)
```json
{
"tag": "chart",
"chart_spec": {
"type": "line",
"title": {"text": "趋势图"},
"data": {
"values": [
{"date": "1月", "value": 100, "type": "系列A"},
{"date": "2月", "value": 150, "type": "系列A"},
{"date": "1月", "value": 80, "type": "系列B"},
{"date": "2月", "value": 120, "type": "系列B"}
]
},
"xField": "date",
"yField": "value",
"seriesField": "type",
"point": {"visible": true}
}
}
```
### 柱状图 (bar)
```json
{
"tag": "chart",
"chart_spec": {
"type": "bar",
"title": {"text": "对比图"},
"data": {
"values": [
{"category": "产品A", "value": 200, "type": "Q1"},
{"category": "产品A", "value": 300, "type": "Q2"},
{"category": "产品B", "value": 150, "type": "Q1"},
{"category": "产品B", "value": 250, "type": "Q2"}
]
},
"xField": "category",
"yField": "value",
"seriesField": "type",
"stack": true
}
}
```
`stack: true` 堆叠模式;省略或 `false` 为分组模式。
### 饼图 (pie)
```json
{
"tag": "chart",
"chart_spec": {
"type": "pie",
"title": {"text": "占比分布"},
"data": {
"values": [
{"category": "分类A", "value": 40},
{"category": "分类B", "value": 30},
{"category": "分类C", "value": 30}
]
},
"categoryField": "category",
"valueField": "value"
}
}
```
---
## 完整示例:数据看板卡片
```json
{
"schema": "2.0",
"config": {"wide_screen_mode": true},
"header": {
"title": {"tag": "plain_text", "content": "📊 周度数据看板"},
"template": "turquoise"
},
"body": {
"elements": [
{
"tag": "column_set",
"flex_mode": "none",
"columns": [
{"tag": "column", "width": "weighted", "weight": 1,
"elements": [{"tag": "markdown", "content": "**总阅读量**\n<font color='blue'>12,345</font>"}]},
{"tag": "column", "width": "weighted", "weight": 1,
"elements": [{"tag": "markdown", "content": "**互动率**\n<font color='green'>8.5%</font>"}]},
{"tag": "column", "width": "weighted", "weight": 1,
"elements": [{"tag": "markdown", "content": "**新增粉丝**\n<font color='red'>+523</font>"}]}
]
},
{"tag": "hr"},
{
"tag": "chart",
"chart_spec": {
"type": "line",
"title": {"text": "每日阅读趋势"},
"data": {"values": [
{"date": "周一", "value": 1500},
{"date": "周二", "value": 1800},
{"date": "周三", "value": 2200}
]},
"xField": "date",
"yField": "value",
"point": {"visible": true}
}
},
{"tag": "hr"},
{
"tag": "collapsible_panel",
"expanded": false,
"header": {"title": {"tag": "plain_text", "content": "📋 查看明细"}},
"elements": [
{"tag": "markdown", "content": "| 日期 | 阅读 | 点赞 |\n|---|---|---|\n| 周一 | 1500 | 120 |\n| 周二 | 1800 | 150 |"}
]
},
{"tag": "hr"},
{"tag": "markdown", "content": "<font color='grey'>自动生成 | 数据看板</font>"}
]
}
}
```
FILE:scripts/feishu_card.py
#!/usr/bin/env python3
"""
Feishu Card Message Sender
Send rich interactive card messages via Feishu Open API.
Supports: raw card JSON, markdown wrapping, and template-based cards.
Usage:
# Raw card JSON file
python3 feishu_card.py --to <id> --type open_id --card card.json
# Markdown content wrapped as card
python3 feishu_card.py --to <id> --type open_id --markdown "**Hello**" --title "Title" --color blue
# Template-based
python3 feishu_card.py --to <id> --type open_id --template news --data data.json
Credentials: env vars FEISHU_APP_ID / FEISHU_APP_SECRET, or --app-id / --app-secret flags.
"""
import argparse
import json
import os
import sys
import tempfile
import time
import urllib.request
import urllib.error
from pathlib import Path
API_BASE = "https://open.feishu.cn/open-apis"
TEMPLATES_DIR = Path(__file__).parent / "templates"
# Token cache (module-level for reuse when imported)
_token_cache = {"token": None, "expires_at": 0}
# Available header color templates
COLORS = [
"blue", "wathet", "turquoise", "green", "yellow",
"orange", "red", "carmine", "violet", "purple",
"indigo", "grey", "default",
]
def _api_post(url, data, headers=None):
"""POST JSON to a URL and return parsed response."""
body = json.dumps(data).encode("utf-8")
hdrs = {"Content-Type": "application/json; charset=utf-8"}
if headers:
hdrs.update(headers)
req = urllib.request.Request(url, data=body, headers=hdrs, method="POST")
try:
with urllib.request.urlopen(req, timeout=30) as resp:
return json.loads(resp.read().decode("utf-8"))
except urllib.error.HTTPError as e:
err_body = e.read().decode("utf-8", errors="replace")
print(f"HTTP {e.code}: {err_body}", file=sys.stderr)
sys.exit(1)
except urllib.error.URLError as e:
print(f"Network error: {e.reason}", file=sys.stderr)
sys.exit(1)
def get_tenant_token(app_id, app_secret):
"""Get tenant_access_token with simple caching."""
now = time.time()
if _token_cache["token"] and now < _token_cache["expires_at"] - 60:
return _token_cache["token"]
url = f"{API_BASE}/auth/v3/tenant_access_token/internal"
resp = _api_post(url, {"app_id": app_id, "app_secret": app_secret})
if resp.get("code") != 0:
print(f"Token error: {resp.get('msg', 'unknown')}", file=sys.stderr)
sys.exit(1)
token = resp["tenant_access_token"]
expire = resp.get("expire", 7200)
_token_cache["token"] = token
_token_cache["expires_at"] = now + expire
return token
def build_chart_element(chart_type, data_values, title="",
x_field="category", y_field="value",
series_field=None, **kwargs):
"""Build a chart element for embedding in a card body.
Args:
chart_type: "line", "bar", or "pie"
data_values: list of dicts, e.g. [{"category":"A","value":100,"type":"s1"}, ...]
title: chart title text
x_field / y_field / series_field: field mappings
**kwargs: extra chart_spec keys (stack, point, categoryField, valueField)
Returns:
dict — a card element with tag "chart"
"""
spec = {
"type": chart_type,
"data": {"values": data_values},
}
if title:
spec["title"] = {"text": title}
if chart_type == "pie":
spec["categoryField"] = kwargs.get("categoryField", x_field)
spec["valueField"] = kwargs.get("valueField", y_field)
else:
spec["xField"] = x_field
spec["yField"] = y_field
if series_field:
spec["seriesField"] = series_field
if chart_type == "bar" and kwargs.get("stack"):
spec["stack"] = True
if chart_type == "line":
spec["point"] = {"visible": kwargs.get("point_visible", True)}
# merge any remaining kwargs into spec
for k, v in kwargs.items():
if k not in ("categoryField", "valueField", "stack", "point_visible"):
spec[k] = v
return {"tag": "chart", "chart_spec": spec}
def build_card_from_markdown(markdown, title=None, color="blue"):
"""Wrap markdown text into a Card JSON (schema 2.0)."""
card = {
"schema": "2.0",
"config": {"wide_screen_mode": True},
"body": {
"elements": [
{"tag": "markdown", "content": markdown}
]
}
}
if title:
card["header"] = {
"title": {"tag": "plain_text", "content": title},
"template": color if color in COLORS else "blue",
}
return card
def load_template(name):
"""Load a card template by name from templates/ dir."""
path = TEMPLATES_DIR / f"{name}.json"
if not path.exists():
avail = [f.stem for f in TEMPLATES_DIR.glob("*.json")]
print(f"Template '{name}' not found. Available: {', '.join(avail) or 'none'}", file=sys.stderr)
sys.exit(1)
with open(path, "r", encoding="utf-8") as f:
return json.load(f)
def fill_template(template, data):
"""
Fill a card template with data.
Templates use {{key}} placeholders in string values.
Special keys:
- {{items}} in elements array: replaced by generated elements from data["items"]
Data can also contain an "elements" key to inject raw card elements.
"""
raw = json.dumps(template, ensure_ascii=False)
# Simple string replacement for scalar values
for key, value in data.items():
if isinstance(value, str):
raw = raw.replace("{{" + key + "}}", value)
card = json.loads(raw)
# Handle items array for news/report templates
if "items" in data and isinstance(data["items"], list):
_inject_items(card, data["items"])
return card
def _inject_items(card, items):
"""Replace {{items}} placeholder element with generated elements from data."""
elements = card.get("body", {}).get("elements", [])
new_elements = []
for el in elements:
if el.get("tag") == "markdown" and el.get("content", "").strip() == "{{items}}":
for i, item in enumerate(items):
if i > 0:
new_elements.append({"tag": "hr"})
md = ""
if "title" in item:
md += f"**{item['title']}**\n"
if "summary" in item or "content" in item:
md += item.get("summary", item.get("content", "")) + "\n"
extras = []
if "source" in item:
extras.append(f"来源: {item['source']}")
if "time" in item:
extras.append(item["time"])
if "level" in item:
extras.append(f"级别: {item['level']}")
if extras:
md += f"\n{' | '.join(extras)}"
if "url" in item:
md += f"\n[查看详情]({item['url']})"
new_elements.append({"tag": "markdown", "content": md.strip()})
else:
new_elements.append(el)
card["body"]["elements"] = new_elements
def _multipart_upload(url, file_path, image_type, token):
"""Upload a file using multipart/form-data (stdlib only)."""
import mimetypes
boundary = f"----FeishuUpload{int(time.time()*1000)}"
filename = os.path.basename(file_path)
content_type = mimetypes.guess_type(filename)[0] or "image/png"
with open(file_path, "rb") as f:
file_data = f.read()
parts = []
# image_type field
parts.append(f"--{boundary}\r\n"
f'Content-Disposition: form-data; name="image_type"\r\n\r\n'
f"{image_type}\r\n".encode("utf-8"))
# image file field
parts.append(f"--{boundary}\r\n"
f'Content-Disposition: form-data; name="image"; filename="{filename}"\r\n'
f"Content-Type: {content_type}\r\n\r\n".encode("utf-8"))
parts.append(file_data)
parts.append(f"\r\n--{boundary}--\r\n".encode("utf-8"))
body = b"".join(parts)
req = urllib.request.Request(url, data=body, method="POST")
req.add_header("Authorization", f"Bearer {token}")
req.add_header("Content-Type", f"multipart/form-data; boundary={boundary}")
try:
with urllib.request.urlopen(req, timeout=60) as resp:
return json.loads(resp.read().decode("utf-8"))
except urllib.error.HTTPError as e:
err_body = e.read().decode("utf-8", errors="replace")
print(f"Upload HTTP {e.code}: {err_body}", file=sys.stderr)
return None
except urllib.error.URLError as e:
print(f"Upload network error: {e.reason}", file=sys.stderr)
return None
def upload_image(token, image_source, image_type="message"):
"""Upload an image to Feishu and return the img_key.
Args:
token: tenant_access_token
image_source: local file path or HTTP(S) URL
image_type: "message" (default, for IM cards) or "avatar"
Returns:
str: img_key on success, None on failure
"""
url = f"{API_BASE}/im/v1/images"
tmp_file = None
try:
# If URL, download to temp file first
if image_source.startswith(("http://", "https://")):
suffix = Path(image_source.split("?")[0]).suffix or ".png"
tmp_fd, tmp_file = tempfile.mkstemp(suffix=suffix)
os.close(tmp_fd)
print(f"Downloading image from URL...", file=sys.stderr)
req = urllib.request.Request(image_source, headers={
"User-Agent": "Mozilla/5.0 (compatible; FeishuCardBot/1.0)"
})
try:
with urllib.request.urlopen(req, timeout=30) as resp:
ct = resp.headers.get("Content-Type", "")
if not ct.startswith("image/"):
print(f"Warning: URL returned Content-Type '{ct}', expected image/*. "
f"Upload may fail.", file=sys.stderr)
with open(tmp_file, "wb") as f:
f.write(resp.read())
except (urllib.error.HTTPError, urllib.error.URLError) as e:
print(f"Failed to download image: {e}", file=sys.stderr)
return None
file_path = tmp_file
else:
file_path = image_source
if not os.path.exists(file_path):
print(f"Image file not found: {file_path}", file=sys.stderr)
return None
resp = _multipart_upload(url, file_path, image_type, token)
if not resp:
return None
if resp.get("code") != 0:
print(f"Upload error: {resp.get('msg', 'unknown')}", file=sys.stderr)
return None
img_key = resp.get("data", {}).get("image_key")
print(f"✅ Image uploaded: {img_key}", file=sys.stderr)
return img_key
finally:
if tmp_file and os.path.exists(tmp_file):
os.unlink(tmp_file)
def build_image_element(img_key, alt_text="image", mode="fit_horizontal", preview=True):
"""Build an image card element from an img_key.
Args:
img_key: Feishu image key (from upload_image)
alt_text: alt text for accessibility
mode: "fit_horizontal" | "crop_center" | "large" | "medium" | "small" | "tiny"
preview: enable click-to-preview
Returns:
dict: card element with tag "img"
"""
return {
"tag": "img",
"img_key": img_key,
"alt": {"tag": "plain_text", "content": alt_text},
"mode": mode,
"preview": preview,
}
def send_card(token, receive_id, receive_id_type, card, reply_to=None):
"""Send a card message via Feishu IM API."""
url = f"{API_BASE}/im/v1/messages?receive_id_type={receive_id_type}"
payload = {
"receive_id": receive_id,
"msg_type": "interactive",
"content": json.dumps(card, ensure_ascii=False),
}
if reply_to:
url = f"{API_BASE}/im/v1/messages/{reply_to}/reply"
payload = {
"msg_type": "interactive",
"content": json.dumps(card, ensure_ascii=False),
}
headers = {"Authorization": f"Bearer {token}"}
resp = _api_post(url, payload, headers)
code = resp.get("code", -1)
if code != 0:
print(f"Send failed (code={code}): {resp.get('msg', 'unknown')}", file=sys.stderr)
detail = resp.get("data", {})
if detail:
print(f"Detail: {json.dumps(detail, ensure_ascii=False)}", file=sys.stderr)
sys.exit(1)
msg_id = resp.get("data", {}).get("message_id", "unknown")
print(f"✅ Card sent! message_id={msg_id}")
return resp
def main():
parser = argparse.ArgumentParser(description="Send Feishu card messages")
parser.add_argument("--to", required=True, help="Receiver ID (open_id or chat_id)")
parser.add_argument("--type", dest="id_type", required=True,
choices=["open_id", "chat_id"], help="Receiver ID type")
parser.add_argument("--app-id", default=None, help="Feishu App ID (or env FEISHU_APP_ID)")
parser.add_argument("--app-secret", default=None, help="Feishu App Secret (or env FEISHU_APP_SECRET)")
parser.add_argument("--reply-to", default=None, help="Message ID to reply to")
# Mode 1: raw card JSON
parser.add_argument("--card", default=None, help="Path to card JSON file")
# Mode 2: markdown
parser.add_argument("--markdown", default=None, help="Markdown content to wrap as card")
parser.add_argument("--title", default=None, help="Card header title (for --markdown mode)")
parser.add_argument("--color", default="blue", help=f"Header color: {', '.join(COLORS)}")
# Mode 3: template
parser.add_argument("--template", default=None, help="Template name (news_digest, report, alert)")
parser.add_argument("--data", default=None, help="JSON data file to fill template")
# Image: upload and embed
parser.add_argument("--image", default=None, help="Image file path or URL to upload and embed in card")
args = parser.parse_args()
# Resolve credentials
app_id = args.app_id or os.environ.get("FEISHU_APP_ID")
app_secret = args.app_secret or os.environ.get("FEISHU_APP_SECRET")
if not app_id or not app_secret:
print("Error: Feishu credentials required. Set FEISHU_APP_ID/FEISHU_APP_SECRET or use --app-id/--app-secret.", file=sys.stderr)
sys.exit(1)
# Build card based on mode
modes = sum(1 for x in [args.card, args.markdown, args.template] if x)
if modes == 0:
print("Error: specify one of --card, --markdown, or --template.", file=sys.stderr)
sys.exit(1)
if modes > 1:
print("Error: use only one of --card, --markdown, or --template.", file=sys.stderr)
sys.exit(1)
if args.card:
with open(args.card, "r", encoding="utf-8") as f:
card = json.load(f)
elif args.markdown:
card = build_card_from_markdown(args.markdown, args.title, args.color)
elif args.template:
template = load_template(args.template)
data = {}
if args.data:
with open(args.data, "r", encoding="utf-8") as f:
data = json.load(f)
# Apply title/color overrides
if args.title and "header" in template:
template["header"]["title"]["content"] = args.title
if args.color and "header" in template:
template["header"]["template"] = args.color
card = fill_template(template, data) if data else template
# Get token and send
token = get_tenant_token(app_id, app_secret)
# Handle --image: upload and append to card body
if args.image:
img_key = upload_image(token, args.image)
if img_key:
img_el = build_image_element(img_key)
if "body" not in card:
card["body"] = {"elements": []}
card["body"]["elements"].append(img_el)
else:
print("Warning: image upload failed, sending card without image.", file=sys.stderr)
send_card(token, args.to, args.id_type, card, args.reply_to)
if __name__ == "__main__":
main()
FILE:scripts/templates/alert.json
{
"schema": "2.0",
"config": {"wide_screen_mode": true},
"header": {
"title": {"tag": "plain_text", "content": "🚨 {{title}}"},
"template": "red"
},
"body": {
"elements": [
{"tag": "markdown", "content": "**级别:** {{level}}\n**时间:** {{time}}"},
{"tag": "hr"},
{"tag": "markdown", "content": "{{detail}}"},
{"tag": "hr"},
{"tag": "markdown", "content": "**建议操作:**\n{{action}}"},
{"tag": "hr"},
{"tag": "markdown", "content": "<font color='grey'>{{footer}}</font>"}
]
}
}
FILE:scripts/templates/data_dashboard.json
{
"schema": "2.0",
"config": {"wide_screen_mode": true},
"header": {
"title": {"tag": "plain_text", "content": "📊 {{title}}"},
"template": "turquoise"
},
"body": {
"elements": [
{
"tag": "column_set",
"flex_mode": "none",
"background_style": "default",
"columns": [
{
"tag": "column",
"width": "weighted",
"weight": 1,
"vertical_align": "top",
"elements": [{"tag": "markdown", "content": "{{metric_1}}"}]
},
{
"tag": "column",
"width": "weighted",
"weight": 1,
"vertical_align": "top",
"elements": [{"tag": "markdown", "content": "{{metric_2}}"}]
},
{
"tag": "column",
"width": "weighted",
"weight": 1,
"vertical_align": "top",
"elements": [{"tag": "markdown", "content": "{{metric_3}}"}]
}
]
},
{"tag": "hr"},
{
"tag": "chart",
"chart_spec": {
"type": "{{chart_type}}",
"title": {"text": "{{chart_title}}"},
"data": {"values": "{{chart_data}}"},
"xField": "{{x_field}}",
"yField": "{{y_field}}",
"seriesField": "{{series_field}}"
}
},
{"tag": "hr"},
{
"tag": "collapsible_panel",
"expanded": false,
"header": {
"title": {"tag": "plain_text", "content": "📋 查看详细数据"}
},
"elements": [
{"tag": "markdown", "content": "{{details}}"}
]
},
{"tag": "hr"},
{"tag": "markdown", "content": "<font color='grey'>{{footer}}</font>"}
]
}
}
FILE:scripts/templates/news_digest.json
{
"schema": "2.0",
"config": {"wide_screen_mode": true},
"header": {
"title": {"tag": "plain_text", "content": "{{title}}"},
"template": "blue"
},
"body": {
"elements": [
{"tag": "markdown", "content": "{{items}}"},
{"tag": "hr"},
{"tag": "markdown", "content": "<font color='grey'>{{footer}}</font>"}
]
}
}
FILE:scripts/templates/report.json
{
"schema": "2.0",
"config": {"wide_screen_mode": true},
"header": {
"title": {"tag": "plain_text", "content": "{{title}}"},
"template": "purple"
},
"body": {
"elements": [
{"tag": "markdown", "content": "{{summary}}"},
{"tag": "hr"},
{"tag": "markdown", "content": "{{items}}"},
{"tag": "hr"},
{"tag": "markdown", "content": "**总结**\n{{conclusion}}"},
{"tag": "hr"},
{"tag": "markdown", "content": "<font color='grey'>{{footer}}</font>"}
]
}
}
Configure and manage AI models from BlueAI unified proxy service for OpenClaw. Use when: (1) adding new models to openclaw.json, (2) choosing the right model...
---
name: blueai-models
description: |
Configure and manage AI models from BlueAI unified proxy service for OpenClaw.
Use when: (1) adding new models to openclaw.json, (2) choosing the right model for a task,
(3) setting up multi-model strategy, (4) switching or comparing models,
(5) troubleshooting model connectivity, (6) user asks about available models or pricing,
(7) generating images via Gemini image models or GPT image models.
Covers: Claude, GPT, Gemini, DeepSeek, Qwen, Doubao, Kimi, Grok, MiniMax via BlueAI relay.
Image generation: Gemini 3.1 Flash Image, Gemini 3 Pro Image, Gemini 2.5 Flash Image (chat-based),
GPT Image 1/1.5, DALL-E 3 (images API).
---
# BlueAI Models for OpenClaw
## Quick Start
Add a model to OpenClaw:
```bash
python3 scripts/add_model.py gemini-2.5-flash --alias flash
python3 scripts/add_model.py claude-sonnet-4-6 --alias sonnet
openclaw gateway restart
```
Test connectivity:
```bash
python3 scripts/test_model.py gemini-2.5-flash
python3 scripts/test_model.py --all-configured
```
List available models:
```bash
python3 scripts/add_model.py --list
```
## Image Generation
Gemini image models generate images via **Chat Completions** (`/v1/chat/completions`), not the Images API. Send a prompt as a normal message; the model returns base64-encoded images in Markdown.
```bash
# Add image models
python3 scripts/add_model.py gemini-3.1-flash-image-preview
python3 scripts/add_model.py gemini-3-pro-image-preview
openclaw gateway restart
# Test image generation
python3 scripts/test_model.py gemini-3.1-flash-image-preview --image-gen
python3 scripts/test_model.py gemini-3-pro-image-preview --image-gen --save ./test-output
```
| Model | Speed | Quality | Edit Support | Best For |
|-------|-------|---------|-------------|----------|
| `gemini-3.1-flash-image-preview` | ⚡ Fast | Good | ❌ | Quick prototypes, batch |
| `gemini-3-pro-image-preview` | Medium | ⭐ Best | ✅ | High-quality creative |
| `gemini-2.5-flash-image` | ⚡ Fast | Good | ✅ | Image editing |
For detailed usage, prompt tips, Python examples, and edit workflows: read `references/image-generation.md`.
## Endpoints
| Type | Base URL | Note |
|------|----------|------|
| Claude (Anthropic) | `https://bmc-llm-relay.bluemediagroup.cn` | **No /v1** |
| Everything else (OpenAI) | `https://bmc-llm-relay.bluemediagroup.cn/v1` | **With /v1** |
Same API key works for all models.
## Model Selection Quick Guide
| Need | Model | Why |
|------|-------|-----|
| Cheapest + good | `gemini-2.5-flash` | $0.15/M in, 1M context |
| Best Chinese | `DeepSeek-V3.2` | Top Chinese quality, cheap |
| Vision + cheap | `gpt-4o-mini` or `gemini-2.5-flash` | Image input, low cost |
| Strong reasoning | `o4-mini` or `DeepSeek-R1` | CoT reasoning |
| Best overall | `claude-opus-4-6-v1` | 128K output, Agent coding |
| Balanced | `claude-sonnet-4-6` | 1/5 Opus price, most tasks |
| Code specialist | `gpt-5.2-codex` | 128K output, code focused |
| Ultra-long context | `xai.grok-4-fast-non-reasoning` | 2M tokens |
| **Image gen (fast)** | `gemini-3.1-flash-image-preview` | Chat-based, cheap |
| **Image gen (quality)** | `gemini-3-pro-image-preview` | Best Gemini quality |
| **Image edit** | `gemini-2.5-flash-image` | Send image + edit instruction |
## References
- **Full model catalog**: Read `references/model-catalog.md` for all 100+ models with specs
- **OpenClaw config guide**: Read `references/openclaw-config.md` for JSON structure and examples
- **Model selection decision tree**: Read `references/model-selection.md` for task-based recommendations
- **Image generation guide**: Read `references/image-generation.md` for Gemini image gen usage, prompts, and code examples
## Key Rules
1. Claude models use `api: "anthropic-messages"`, baseUrl without `/v1`
2. All other models use `api: "openai-completions"`, baseUrl with `/v1`
3. DeepSeek/Qwen text models: set `input: ["text"]` only (no image)
4. MiniMax: must use OpenAI endpoint, does not support Claude endpoint
5. `gemini-3-pro-preview` deprecated 2026-03-26 → use `gemini-3.1-pro-preview`
6. Gemini image models use chat completions, not images API — output is base64 in Markdown
7. After config changes: `openclaw gateway restart`
FILE:_meta.json
{
"ownerId": "kn7adb1sb9m0scbfdht8mhtax1839jvg",
"slug": "blueai-models",
"version": "1.0.0",
"publishedAt": 1774421386803
}
FILE:references/image-generation.md
# BlueAI 图像生成指南
## 概述
BlueAI 代理支持多种图像生成模型,其中 Gemini 图像模型通过 **Chat Completions** 接口生图(非传统 Images API),使用方式与普通对话一致,模型在回复中直接返回 base64 编码的图片。
## Gemini 图像生成模型
| 模型ID | 上下文 | 特点 | 推荐场景 |
|--------|--------|------|---------|
| `gemini-3.1-flash-image-preview` | 131K | Flash 速度,成本低 | 快速原型、批量生图 |
| `gemini-3-pro-image-preview` | 65K | Pro 品质,细节更好 | 高质量创意图 |
| `gemini-2.5-flash-image` | 32K | 支持图编辑 | 图像编辑/修改 |
## 使用方式
### 通过 Chat Completions 接口
Gemini 图像模型走标准 `/v1/chat/completions` 端点,**不需要**用 `/v1/images/generations`。
```bash
curl -s https://bmc-llm-relay.bluemediagroup.cn/v1/chat/completions \
-H "Authorization: Bearer $BLUEAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-3.1-flash-image-preview",
"messages": [
{"role": "user", "content": "画一只穿着宇航服的猫,卡通风格"}
],
"max_tokens": 4096
}'
```
### 响应格式
模型返回的 `content` 是 Markdown 格式,图片以 base64 嵌入:
```

```
有时也会伴随文字描述。
### 提取图片(Python)
```python
import json, base64, re, urllib.request
def generate_image(prompt, model="gemini-3.1-flash-image-preview", api_key=""):
"""通过 Gemini 图像模型生成图片,返回 PNG bytes"""
url = "https://bmc-llm-relay.bluemediagroup.cn/v1/chat/completions"
payload = {
"model": model,
"messages": [{"role": "user", "content": prompt}],
"max_tokens": 4096
}
req = urllib.request.Request(
url,
data=json.dumps(payload).encode(),
headers={
"Content-Type": "application/json",
"Authorization": f"Bearer {api_key}"
}
)
resp = urllib.request.urlopen(req, timeout=120)
data = json.loads(resp.read())
content = data["choices"][0]["message"]["content"]
# 提取 base64 图片
match = re.search(r'data:image/(png|jpeg|webp);base64,([A-Za-z0-9+/=]+)', content)
if match:
return base64.b64decode(match.group(2)), match.group(1)
return None, None
# 用法
img_bytes, fmt = generate_image("一只穿宇航服的猫", api_key="sk-xxx")
if img_bytes:
with open(f"output.{fmt}", "wb") as f:
f.write(img_bytes)
```
## 与 OpenAI 图像模型的区别
| 特性 | Gemini 图像模型 | GPT Image / DALL-E |
|------|----------------|-------------------|
| 接口 | `/v1/chat/completions` | `/v1/images/generations` |
| 输入 | 对话消息(可多轮) | 单次 prompt |
| 输出 | Markdown 中嵌 base64 | JSON 中 b64_json 或 url |
| 图片编辑 | ✅ 发送图片+指令即可 | 需要 mask 参数 |
| 多轮对话 | ✅ 可基于上文迭代修改 | ❌ 每次独立 |
| 中文 prompt | ✅ 原生支持 | ⚠️ 效果一般 |
## Prompt 技巧
1. **明确风格**:「卡通风格」「写实照片」「水彩画风」「赛博朋克风」
2. **指定细节**:颜色、构图、光线、背景
3. **中文直接写**:Gemini 对中文 prompt 理解很好,不需要翻译成英文
4. **迭代修改**:可以在多轮对话中要求「把背景换成蓝色」「加一顶帽子」
## 图片编辑(gemini-2.5-flash-image / gemini-3-pro-image-preview)
支持发送图片 + 修改指令:
```json
{
"model": "gemini-3-pro-image-preview",
"messages": [
{
"role": "user",
"content": [
{"type": "image_url", "image_url": {"url": "data:image/png;base64,<原图base64>"}},
{"type": "text", "text": "把背景改成星空"}
]
}
],
"max_tokens": 4096
}
```
## OpenClaw 配置
添加到 `openclaw.json`:
```json
{
"id": "gemini-3.1-flash-image-preview",
"name": "Gemini 3.1 Flash Image",
"api": "openai-completions",
"reasoning": false,
"input": ["text", "image"],
"cost": {"input": 0.15, "output": 3.5},
"contextWindow": 131072,
"maxTokens": 32768
}
```
或使用脚本:
```bash
python3 scripts/add_model.py gemini-3.1-flash-image-preview
python3 scripts/add_model.py gemini-3-pro-image-preview
openclaw gateway restart
```
## 测试
```bash
python3 scripts/test_model.py gemini-3.1-flash-image-preview --image-gen
python3 scripts/test_model.py gemini-3-pro-image-preview --image-gen
```
FILE:references/model-catalog.md
# BlueAI 模型目录
> 来源:BlueAI模型统一代理服务文档 | 更新:2026-03-25
## 端点信息
| 项目 | 值 |
|------|-----|
| 国内API | `https://bmc-llm-relay.bluemediagroup.cn` |
| 国外API | `https://bmc-llm-relay.nextblue.ai` |
| OpenAI端点 | `/v1/chat/completions` |
| Claude端点 | `/v1/messages` |
| Responses端点 | `/v1/responses` |
| 图像生成 | `/v1/images/generations` |
| Embedding | `/v1/embeddings` |
| 语音转文字 | `/v1/audio/transcriptions` |
| 文字转语音 | `/v1/audio/speech` |
---
## Claude 系列(AWS Bedrock)
| 模型ID | 上下文 | 最大输出 | 能力 | 推荐场景 |
|--------|--------|---------|------|---------|
| claude-opus-4-6-v1 | 200K | 128K | 文本+图片+PDF, 扩展思考, 代码, 函数调用, Agentic Coding | 超长输出、复杂编码、Agent |
| claude-opus-4-5-20251101 | 200K | 64K | 文本+图片+PDF, 推理, 代码, 函数调用 | 复杂决策、长文撰写 |
| claude-sonnet-4-6 | 200K | 64K | 同Opus但更快更便宜 | 日常任务、平衡性价比 |
| claude-sonnet-4-5-20250929 | 200K | 64K | 同上, 增强推理 | 需要推理的日常任务 |
| claude-sonnet-4-20250514 | 200K | 64K | 文本+图片+PDF, 代码, 函数调用 | 标准对话和代码 |
| claude-haiku-4-5-20251001 | 200K | 64K | 文本+图片+PDF, 代码, 快速响应 | 轻量快速、低延迟 |
| claude-3-7-sonnet-20250219 | 200K | 64K | 文本+图片+PDF, 扩展思考, 代码 | 兼容旧版workflow |
**请求端点**:Anthropic Messages (`/v1/messages`)
---
## GPT 系列(Azure)
| 模型ID | 上下文 | 最大输出 | 能力 | 推荐场景 |
|--------|--------|---------|------|---------|
| gpt-5.4 | 400K | 128K | 最新旗舰 | 最强综合能力 |
| gpt-5.2 | 400K | 128K | 文本+图片+音频, 深度推理, 代码 | 高级推理+多模态 |
| gpt-5.2-codex | 400K | 128K | 代码专精, Agent编码 | 大型代码生成 |
| gpt-5.1 | 400K | 128K | 文本+图片+音频, 推理, 代码 | GPT-5迭代版 |
| gpt-5 | 400K | 12K | 文本+图片+音频, 推理, 代码, Agent | 400K超长上下文旗舰 |
| gpt-4.1 | 128K | 32K | 文本+图片, 代码, 函数调用 | 编码和指令遵循 |
| gpt-4.1-mini | 128K | 32K | 同4.1轻量版 | **性价比首选** |
| gpt-4.1-nano | 128K | 32K | 最轻量 | 速度最快、成本最低 |
| gpt-4o | 128K | 16K | 文本+图片+音频, 代码, JSON模式 | 全能多模态 |
| gpt-4o-mini | 128K | 16K | 文本+图片, 代码 | 经济版多模态 |
| o4-mini | 200K | 100K | 文本+图片, 深度推理, 工具调用 | 高效推理+工具 |
| o3 | 200K | 100K | 最强推理 | 复杂逻辑/数学 |
| o3-mini | 200K | 100K | 推理, 可调effort | 轻量推理 |
| o1 | 200K | 100K | 深度推理, 内部思维链 | 科学/数学问题 |
| gpt-image-1 | - | - | 文生图+图编辑 | 图像生成 |
| gpt-image-1.5 | - | - | 升级版文生图 | 更好的图像生成 |
**请求端点**:OpenAI Completions (`/v1/chat/completions`)
---
## Gemini 系列(Google Cloud)
| 模型ID | 上下文 | 最大输出 | 能力 | 推荐场景 |
|--------|--------|---------|------|---------|
| gemini-3.1-pro-preview | 1M | 65K | 文本+图片+视频+音频+PDF, 推理, Agent | **最新旗舰** |
| gemini-3-flash-preview | 1M | 65K | 同上但更快 | 速度与效果平衡 |
| gemini-2.5-pro | 1M | 65K | 文本+多模态, 深度思考, Grounding | 长上下文推理 |
| gemini-2.5-flash | 1M | 65K | 同上, 思维链推理 | **超便宜+100万上下文** |
| gemini-2.5-flash-image | 32K | 32K | 文生图+图编辑 | 图像生成/编辑 |
| gemini-3-pro-image-preview | 65K | 32K | 文生图+图编辑 | 3代图像生成 |
| gemini-3.1-flash-image-preview | 131K | 32K | 图像生成 | Flash版图像 |
**请求端点**:OpenAI Completions (`/v1/chat/completions`)
**⚠️ gemini-3-pro-preview 将于2026-03-26弃用,迁移至 gemini-3.1-pro-preview**
---
## DeepSeek 系列(火山引擎/百炼)
| 模型ID | 上下文 | 最大输出 | 能力 | 推荐场景 |
|--------|--------|---------|------|---------|
| DeepSeek-R1 | 128K | 32K | 深度推理(CoT), 代码, 数学 | 复杂逻辑推理 |
| DeepSeek-V3 | 128K | 16K | 文本, 代码, 多语言, 函数调用 | 通用对话和代码 |
| DeepSeek-V3.1 | 128K | 32K | V3升级, 增强指令遵循 | 中文任务性价比 |
| DeepSeek-V3.2 | 128K | 32K | 最新版, 混合推理, 深度思考 | **中文最佳性价比** |
**请求端点**:OpenAI Completions
**注意**:纯文本模型,不支持图片/视频输入
---
## 豆包 Doubao 系列(火山引擎)
| 模型ID | 上下文 | 最大输出 | 能力 | 推荐场景 |
|--------|--------|---------|------|---------|
| Doubao-Seed-2.0-pro | 256K | 128K | 最新旗舰 | 顶级中文能力 |
| Doubao-Seed-2.0-lite | 256K | 128K | 轻量版 | 经济版 |
| Doubao-Seed-2.0-mini | 256K | 128K | 最小版 | 低成本 |
| Doubao-Seed-2.0-Code | 256K | 128K | 代码专精 | 编程任务 |
| Doubao-Seed-1.8 | 256K | 32K | 文本, 推理, 代码 | 综合能力 |
| Doubao-Seed-1.6-thinking | 256K | 32K | 多模态+思维链 | 需要推理的多模态 |
| Doubao-Seed-1.6-vision | 256K | 32K | 图片+视频理解, OCR | 视觉理解 |
| Doubao-Seed-1.6-flash | 256K | 32K | 多模态, 速度优化 | 低延迟场景 |
| Doubao-1.5-vision-pro-32k | 128K | 16K | 图片+视频, OCR | 图像/视频理解 |
| Doubao-Seedream-5.0-lite | - | - | 文生图 | 图像生成 |
| Doubao-Seedream-4.5 | - | - | 文生图 | 图像生成 |
| Doubao-embedding | 4K | - | 文本向量化 | 语义搜索/RAG |
**请求端点**:OpenAI Completions
---
## 通义千问 Qwen 系列(百炼)
| 模型ID | 上下文 | 最大输出 | 能力 | 推荐场景 |
|--------|--------|---------|------|---------|
| qwen3-235b-a22b | 131K | 16K | MoE旗舰, 混合推理 | 中文推理最强 |
| qwen3-32b | 131K | 16K | Dense架构 | 通用中文任务 |
| qwen3-14b | 131K | 8K | 中等规模 | 轻量中文 |
| qwen3-8b | 131K | 8K | 轻量级 | 最低成本 |
| qwen3-vl-plus | 262K | 32K | 图片+视频理解, OCR | 视觉理解 |
| qwen-vl-max-latest | 131K | 8K | 视觉旗舰 | 最强视觉理解 |
| qwen-vl-ocr-latest | 32K | 2K | OCR专用 | 文字识别 |
| qwen-omni-turbo-latest | 32K | 2K | 全模态(图片+视频+音频)+语音输出 | 语音对话 |
| qwen-max | 32K | 8K | 旗舰文本 | 通用对话 |
| qwen-plus | 131K | 16K | 长上下文 | 长文档 |
| text-embedding-v4 | 8K | - | 中英文向量化 | RAG/搜索 |
| gte-rerank-v2 | 4K | - | 重排序 | 搜索结果优化 |
**请求端点**:OpenAI Completions
---
## Kimi / 月之暗面
| 模型ID | 上下文 | 最大输出 | 能力 | 推荐场景 |
|--------|--------|---------|------|---------|
| kimi-k2.5 | 262K | - | 最新版 | 中文+Agent |
| kimi-k2-thinking | 262K | - | 深度思考, Agent | 长上下文推理+编码 |
| moonshot-v1-128k | 128K | - | 超长文本, 代码 | 长文档分析 |
| moonshot-v1-128k-vision-preview | 128K | - | 多模态 | 128K+图片 |
| moonshot-v1-32k | 32K | - | 文本, 代码 | 标准对话 |
---
## Grok 系列(Oracle/xAI)
| 模型ID | 上下文 | 最大输出 | 能力 | 推荐场景 |
|--------|--------|---------|------|---------|
| xai.grok-4 | 128K | 16K | 文本+图片, 深度推理, 代码 | 最强推理 |
| xai.grok-4-fast-reasoning | 2M | 16K | 推理+速度优化 | 超长上下文推理 |
| xai.grok-4-fast-non-reasoning | 2M | 16K | 极速回答, 跳过推理 | **2M上下文+最快** |
| xai.grok-code-fast-1 | 256K | 16K | 代码专精 | 大型代码库 |
| xai.grok-3 | 131K | 16K | 推理, 代码 | 标准版 |
| xai.grok-3-fast | 131K | 16K | 速度优化 | 快速版 |
---
## MiniMax 系列
| 模型ID | 上下文 | 最大输出 | 能力 | 推荐场景 |
|--------|--------|---------|------|---------|
| MiniMax-M2.7 | 204K | 2K | 最新版 | 编程+Agent |
| MiniMax-M2.5 | 204K | 2K | 编程+Agent | 通用 |
| MiniMax-M2.1-lightning | 204K | 2K | 极速版 | 低延迟 |
**⚠️ 不支持Claude端点,必须使用OpenAI端点**
---
## Embedding / 向量模型
| 模型ID | 维度 | 提供商 | 推荐场景 |
|--------|------|--------|---------|
| text-embedding-3-large | 3072 | OpenAI | 最强向量化 |
| text-embedding-3-small | 1536 | OpenAI | 轻量向量化 |
| text-embedding-ada-002 | 1536 | OpenAI | 旧版兼容 |
| text-embedding-v4 | - | 阿里 | 中英双语 |
| Doubao-embedding | - | 火山 | 中文向量化 |
---
## 图像生成模型
| 模型ID | 提供商 | 推荐场景 |
|--------|--------|---------|
| gpt-image-1.5 | OpenAI | 最佳文生图 |
| gpt-image-1 | OpenAI | 标准文生图 |
| dall-e-3 | OpenAI | 经典文生图 |
| gemini-2.5-flash-image | Google | 图像生成+编辑 |
| gemini-3-pro-image-preview | Google | 3代图像 |
| Doubao-Seedream-5.0-lite | 火山 | 中文文生图 |
| Doubao-Seedream-4.5 | 火山 | 中文文生图 |
---
## 语音模型
| 端点 | 用途 |
|------|------|
| `/v1/audio/speech` | 文字转语音 |
| `/v1/audio/transcriptions` | 语音转文字(whisper-1) |
| `/v1/audio/translations` | 语音翻译 |
FILE:references/model-selection.md
# BlueAI 模型选型决策树
## 按任务类型选模型
### 日常对话 / 问答
- 预算充足 → `claude-sonnet-4-6` 或 `gpt-4.1`
- 追求性价比 → `DeepSeek-V3.2`(中文)或 `gpt-4.1-mini`(中英)
- 最低成本 → `gpt-4.1-nano` 或 `gemini-2.5-flash`
### 复杂推理 / 数学 / 逻辑
- 最强推理 → `claude-opus-4-6-v1` 或 `o3`
- 性价比推理 → `o4-mini` 或 `DeepSeek-R1`
- 中文推理 → `qwen3-235b-a22b` 或 `DeepSeek-R1`
### 编码 / 代码生成
- Agent级编码 → `claude-opus-4-6-v1`(128K输出)
- 代码专精 → `gpt-5.2-codex` 或 `Doubao-Seed-2.0-Code`
- 轻量代码 → `claude-sonnet-4-6` 或 `gpt-4.1-mini`
### 图片/视觉理解
- 最强视觉 → `claude-opus-4-6-v1` 或 `gemini-3.1-pro-preview`
- 性价比视觉 → `gemini-2.5-flash`(100万上下文+图片)
- 中文OCR → `qwen-vl-ocr-latest`
- 视频理解 → `gemini-3.1-pro-preview` 或 `Doubao-Seed-1.6-vision`
### 超长文档处理
- 100万token → `gemini-2.5-flash`/`gemini-2.5-pro`
- 200万token → `xai.grok-4-fast-non-reasoning`
- 400K token → `gpt-5` 系列
- 262K token → `kimi-k2.5` 或 `qwen3-vl-plus`
### 图像生成
- 最佳质量(OpenAI) → `gpt-image-1.5`(Images API)
- 标准(OpenAI) → `gpt-image-1` 或 `dall-e-3`(Images API)
- **快速生图(Gemini)** → `gemini-3.1-flash-image-preview`(Chat Completions,速度快成本低)
- **高质量生图(Gemini)** → `gemini-3-pro-image-preview`(Chat Completions,Pro级品质)
- **图像编辑** → `gemini-2.5-flash-image` 或 `gemini-3-pro-image-preview`(发送图片+指令)
- 中文理解 → `Doubao-Seedream-5.0-lite`
- ⚡ Gemini 图像模型走 `/v1/chat/completions`,不走 Images API,详见 image-generation.md
### RAG / 语义搜索
- Embedding → `text-embedding-3-large`(英文)或 `text-embedding-v4`(中英)
- Rerank → `gte-rerank-v2`
---
## 按成本分层
### 💰 旗舰级(最贵,最强)
`claude-opus-4-6-v1`, `o3`, `gpt-5.2`, `xai.grok-4`
### 💵 专业级(均衡)
`claude-sonnet-4-6`, `gpt-4.1`, `gemini-2.5-pro`, `DeepSeek-R1`
### 💲 经济级(性价比)
`gpt-4.1-mini`, `gemini-2.5-flash`, `DeepSeek-V3.2`, `claude-haiku-4-5-20251001`
### 🆓 超低成本
`gpt-4.1-nano`, `qwen3-8b`, `Doubao-lite-4k`
---
## OpenClaw 分层策略建议
| 用途 | 推荐模型 | 理由 |
|------|---------|------|
| 主Agent(primary) | claude-opus-4-6-v1 | 最强综合+128K输出 |
| 子Agent任务 | claude-sonnet-4-6 或 gemini-2.5-flash | 省成本,大部分任务够用 |
| 截图/图片识别 | gemini-2.5-flash 或 gpt-4o-mini | 视觉+便宜 |
| 中文内容生成 | DeepSeek-V3.2 或 qwen3-235b-a22b | 中文质量高 |
| 批量/重复操作 | gpt-4.1-nano | 最低成本 |
| Heartbeat/文案 | gemini-3.1-pro-preview | 1M上下文+强推理 |
FILE:references/openclaw-config.md
# OpenClaw 模型配置指南
## openclaw.json 配置结构
OpenClaw 通过 `~/.openclaw/openclaw.json` 的 `models` 字段配置模型。
### 基本结构
```json
{
"models": {
"mode": "merge",
"providers": {
"<provider-name>": {
"baseUrl": "<api-endpoint>",
"apiKey": "<api-key>",
"api": "<api-type>",
"models": [ ... ]
}
}
},
"agents": {
"defaults": {
"model": { "primary": "<provider>/<model-id>" },
"models": {
"<provider>/<model-id>": { "alias": "<short-name>" }
}
}
}
}
```
### API 类型(api 字段)
| api 值 | 用于 | 端点 |
|--------|------|------|
| `anthropic-messages` | Claude 系列 | `https://bmc-llm-relay.bluemediagroup.cn` (无/v1) |
| `openai-completions` | GPT/Gemini/DeepSeek/Qwen等 | `https://bmc-llm-relay.bluemediagroup.cn/v1` (带/v1) |
**关键区别**:
- Anthropic 端点的 `baseUrl` **不带** `/v1`
- OpenAI 端点的 `baseUrl` **必须带** `/v1`
### 模型定义字段
```json
{
"id": "模型ID(必须与API文档一致)",
"name": "显示名称",
"api": "anthropic-messages 或 openai-completions",
"reasoning": true/false,
"input": ["text"] 或 ["text", "image"],
"cost": {
"input": 0.001,
"output": 0.005,
"cacheRead": 0.0001,
"cacheWrite": 0.00125
},
"contextWindow": 200000,
"maxTokens": 64000
}
```
- `reasoning: true` 表示模型支持思维链/扩展思考
- `input` 数组决定模型能否处理图片
- `cost` 单位为 $/1K tokens(用于 OpenClaw dashboard 估算费用)
- `cacheRead`/`cacheWrite` 仅 Anthropic 模型需要
### 别名配置
在 `agents.defaults.models` 中设置别名,方便通过 `/model <alias>` 快速切换:
```json
"models": {
"blueai/gemini-2.5-flash": { "alias": "flash" },
"anthropic/claude-sonnet-4-6": { "alias": "sonnet" }
}
```
---
## 完整配置示例
### 场景1:仅添加一个轻量模型(最小改动)
在 `models.providers` 中添加一个 provider:
```json
"blueai": {
"baseUrl": "https://bmc-llm-relay.bluemediagroup.cn/v1",
"apiKey": "sk-xxx",
"api": "openai-completions",
"models": [
{
"id": "gemini-2.5-flash",
"name": "Gemini 2.5 Flash",
"api": "openai-completions",
"reasoning": true,
"input": ["text", "image"],
"cost": {"input": 0.00015, "output": 0.0035},
"contextWindow": 1048576,
"maxTokens": 65535
}
]
}
```
### 场景2:分层策略(推荐)
```json
"providers": {
"anthropic": {
"baseUrl": "https://bmc-llm-relay.bluemediagroup.cn",
"api": "anthropic-messages",
"models": [
{"id": "claude-sonnet-4-6", "name": "Sonnet 4.6", ...},
{"id": "claude-haiku-4-5-20251001", "name": "Haiku 4.5", ...}
]
},
"blueai": {
"baseUrl": "https://bmc-llm-relay.bluemediagroup.cn/v1",
"apiKey": "sk-xxx",
"api": "openai-completions",
"models": [
{"id": "gemini-2.5-flash", ...},
{"id": "gpt-4.1-mini", ...},
{"id": "DeepSeek-V3.2", ...}
]
}
}
```
---
## 常见问题
### MiniMax 模型必须用 OpenAI 端点
MiniMax-M2.x 系列不支持 Claude 端点,`api` 必须设为 `openai-completions`。
### gemini-3-pro-preview 即将弃用
2026-03-26 起弃用,应迁移至 `gemini-3.1-pro-preview`。
### DeepSeek 是纯文本模型
`input` 只能设 `["text"]`,不支持图片。
### 价格查询
访问 `https://bmc-llm-relay.bluemediagroup.cn/pricing` 获取最新价格。
### API Key 申请
通过飞书多维表格申请:搜索"BlueAI 模型代理API Key申请"。
FILE:scripts/add_model.py
#!/usr/bin/env python3
"""
BlueAI 模型快速添加脚本
用法: python3 add_model.py <model-id> [--provider <name>] [--primary]
示例:
python3 add_model.py gemini-2.5-flash
python3 add_model.py claude-sonnet-4-6 --provider anthropic
python3 add_model.py gpt-4.1-mini --primary
"""
import json, sys, os, argparse
CONFIG_PATH = os.path.expanduser("~/.openclaw/openclaw.json")
# 预定义模型库(从BlueAI文档)
MODEL_DB = {
# Claude (anthropic-messages)
"claude-opus-4-6-v1": {"name": "Claude Opus 4.6", "api": "anthropic-messages", "reasoning": True, "input": ["text","image"], "cost": {"input":0.015,"output":0.075,"cacheRead":0.00187,"cacheWrite":0.01875}, "contextWindow": 200000, "maxTokens": 128000, "provider_type": "anthropic"},
"claude-opus-4-5-20251101": {"name": "Claude Opus 4.5", "api": "anthropic-messages", "reasoning": True, "input": ["text","image"], "cost": {"input":0.015,"output":0.075,"cacheRead":0.00187,"cacheWrite":0.01875}, "contextWindow": 200000, "maxTokens": 32000, "provider_type": "anthropic"},
"claude-sonnet-4-6": {"name": "Claude Sonnet 4.6", "api": "anthropic-messages", "reasoning": True, "input": ["text","image"], "cost": {"input":0.003,"output":0.015,"cacheRead":0.0003,"cacheWrite":0.00375}, "contextWindow": 200000, "maxTokens": 64000, "provider_type": "anthropic"},
"claude-sonnet-4-5-20250929": {"name": "Claude Sonnet 4.5", "api": "anthropic-messages", "reasoning": True, "input": ["text","image"], "cost": {"input":0.003,"output":0.015,"cacheRead":0.0003,"cacheWrite":0.00375}, "contextWindow": 200000, "maxTokens": 64000, "provider_type": "anthropic"},
"claude-haiku-4-5-20251001": {"name": "Claude Haiku 4.5", "api": "anthropic-messages", "reasoning": False, "input": ["text","image"], "cost": {"input":0.001,"output":0.005,"cacheRead":0.0001,"cacheWrite":0.00125}, "contextWindow": 200000, "maxTokens": 64000, "provider_type": "anthropic"},
# GPT (openai-completions)
"gpt-4.1": {"name": "GPT-4.1", "api": "openai-completions", "reasoning": False, "input": ["text","image"], "cost": {"input":0.002,"output":0.008}, "contextWindow": 128000, "maxTokens": 32768, "provider_type": "openai"},
"gpt-4.1-mini": {"name": "GPT-4.1 Mini", "api": "openai-completions", "reasoning": False, "input": ["text","image"], "cost": {"input":0.0004,"output":0.0016}, "contextWindow": 128000, "maxTokens": 32768, "provider_type": "openai"},
"gpt-4.1-nano": {"name": "GPT-4.1 Nano", "api": "openai-completions", "reasoning": False, "input": ["text","image"], "cost": {"input":0.0001,"output":0.0004}, "contextWindow": 128000, "maxTokens": 32768, "provider_type": "openai"},
"gpt-4o": {"name": "GPT-4o", "api": "openai-completions", "reasoning": False, "input": ["text","image"], "cost": {"input":0.0025,"output":0.01}, "contextWindow": 128000, "maxTokens": 16384, "provider_type": "openai"},
"gpt-4o-mini": {"name": "GPT-4o Mini", "api": "openai-completions", "reasoning": False, "input": ["text","image"], "cost": {"input":0.00015,"output":0.0006}, "contextWindow": 128000, "maxTokens": 16384, "provider_type": "openai"},
"o4-mini": {"name": "o4-mini", "api": "openai-completions", "reasoning": True, "input": ["text","image"], "cost": {"input":0.0011,"output":0.0044}, "contextWindow": 200000, "maxTokens": 100000, "provider_type": "openai"},
# Gemini (openai-completions)
"gemini-2.5-flash": {"name": "Gemini 2.5 Flash", "api": "openai-completions", "reasoning": True, "input": ["text","image"], "cost": {"input":0.00015,"output":0.0035}, "contextWindow": 1048576, "maxTokens": 65535, "provider_type": "openai"},
"gemini-2.5-pro": {"name": "Gemini 2.5 Pro", "api": "openai-completions", "reasoning": True, "input": ["text","image"], "cost": {"input":0.00125,"output":0.01}, "contextWindow": 1048576, "maxTokens": 65535, "provider_type": "openai"},
"gemini-3.1-pro-preview": {"name": "Gemini 3.1 Pro", "api": "openai-completions", "reasoning": True, "input": ["text","image"], "cost": {"input":0.00125,"output":0.01}, "contextWindow": 1048576, "maxTokens": 65536, "provider_type": "openai"},
"gemini-3-flash-preview": {"name": "Gemini 3 Flash", "api": "openai-completions", "reasoning": True, "input": ["text","image"], "cost": {"input":0.00015,"output":0.0035}, "contextWindow": 1048576, "maxTokens": 65536, "provider_type": "openai"},
# Gemini Image Generation (openai-completions, chat-based image output)
"gemini-3.1-flash-image-preview": {"name": "Gemini 3.1 Flash Image", "api": "openai-completions", "reasoning": False, "input": ["text", "image"], "cost": {"input": 0.00015, "output": 0.0035}, "contextWindow": 131072, "maxTokens": 32768, "provider_type": "openai"},
"gemini-3-pro-image-preview": {"name": "Gemini 3 Pro Image", "api": "openai-completions", "reasoning": False, "input": ["text", "image"], "cost": {"input": 0.00125, "output": 0.01}, "contextWindow": 65536, "maxTokens": 32768, "provider_type": "openai"},
"gemini-2.5-flash-image": {"name": "Gemini 2.5 Flash Image", "api": "openai-completions", "reasoning": False, "input": ["text", "image"], "cost": {"input": 0.00015, "output": 0.0035}, "contextWindow": 32768, "maxTokens": 32768, "provider_type": "openai"},
# DeepSeek (openai-completions, text only)
"DeepSeek-R1": {"name": "DeepSeek R1", "api": "openai-completions", "reasoning": True, "input": ["text"], "cost": {"input":0.00055,"output":0.0022}, "contextWindow": 128000, "maxTokens": 32000, "provider_type": "openai"},
"DeepSeek-V3.2": {"name": "DeepSeek V3.2", "api": "openai-completions", "reasoning": False, "input": ["text"], "cost": {"input":0.00027,"output":0.0011}, "contextWindow": 128000, "maxTokens": 32000, "provider_type": "openai"},
# Qwen
"qwen3-235b-a22b": {"name": "Qwen3 235B", "api": "openai-completions", "reasoning": True, "input": ["text"], "cost": {"input":0.0008,"output":0.002}, "contextWindow": 131072, "maxTokens": 16384, "provider_type": "openai"},
"qwen-vl-max-latest": {"name": "Qwen VL Max", "api": "openai-completions", "reasoning": False, "input": ["text","image"], "cost": {"input":0.003,"output":0.009}, "contextWindow": 131072, "maxTokens": 8192, "provider_type": "openai"},
}
def main():
parser = argparse.ArgumentParser(description="Add BlueAI model to OpenClaw config")
parser.add_argument("model_id", nargs="?", help="Model ID to add")
parser.add_argument("--provider", default=None, help="Provider name in config")
parser.add_argument("--primary", action="store_true", help="Set as primary model")
parser.add_argument("--alias", default=None, help="Short alias for /model command")
parser.add_argument("--list", action="store_true", help="List available models")
parser.add_argument("--api-key", default=None, help="API key (if not already configured)")
args = parser.parse_args()
if args.list:
print("Available models in BlueAI:")
for mid, info in sorted(MODEL_DB.items()):
pt = info["provider_type"]
ctx = info["contextWindow"] // 1000
print(f" {mid:<35} {info['name']:<25} {pt:<10} {ctx}K ctx")
return
if not args.model_id:
parser.print_help()
return
if args.model_id not in MODEL_DB:
print(f"❌ Unknown model: {args.model_id}")
print(f" Use --list to see available models")
print(f" Or add manually to openclaw.json")
return
model_info = MODEL_DB[args.model_id].copy()
provider_type = model_info.pop("provider_type")
with open(CONFIG_PATH) as f:
config = json.load(f)
providers = config.setdefault("models", {}).setdefault("providers", {})
# Determine provider name
if args.provider:
pname = args.provider
elif provider_type == "anthropic":
pname = "anthropic"
else:
pname = "blueai"
# Create provider if not exists
if pname not in providers:
if provider_type == "anthropic":
providers[pname] = {
"baseUrl": "https://bmc-llm-relay.bluemediagroup.cn",
"api": "anthropic-messages",
"models": []
}
else:
providers[pname] = {
"baseUrl": "https://bmc-llm-relay.bluemediagroup.cn/v1",
"api": "openai-completions",
"models": []
}
if args.api_key:
providers[pname]["apiKey"] = args.api_key
print(f"✅ Created provider: {pname}")
# Check if model already exists
existing_ids = [m["id"] for m in providers[pname].get("models", [])]
if args.model_id in existing_ids:
print(f"⚠️ Model {args.model_id} already exists in provider {pname}")
return
# Add model
model_entry = {"id": args.model_id, **model_info}
providers[pname]["models"].append(model_entry)
print(f"✅ Added {args.model_id} to provider {pname}")
# Set as primary if requested
if args.primary:
config.setdefault("agents", {}).setdefault("defaults", {}).setdefault("model", {})["primary"] = f"{pname}/{args.model_id}"
print(f"✅ Set as primary: {pname}/{args.model_id}")
# Add alias if provided
if args.alias:
config.setdefault("agents", {}).setdefault("defaults", {}).setdefault("models", {})[f"{pname}/{args.model_id}"] = {"alias": args.alias}
print(f"✅ Alias: {args.alias}")
with open(CONFIG_PATH, "w") as f:
json.dump(config, f, indent=2, ensure_ascii=False)
print(f"\n💡 Run 'openclaw gateway restart' to apply changes")
if __name__ == "__main__":
main()
FILE:scripts/test_model.py
#!/usr/bin/env python3
"""
验证 BlueAI 模型连通性
用法:
python3 test_model.py <model-id> # 文本测试
python3 test_model.py <model-id> --image-gen # 图像生成测试
python3 test_model.py --all-configured # 测试所有已配置模型
"""
import json, sys, urllib.request, os, argparse, re, base64
IMAGE_MODELS = {
"gemini-3.1-flash-image-preview", "gemini-3-pro-image-preview",
"gemini-2.5-flash-image", "gpt-image-1", "gpt-image-1.5"
}
def get_api_key():
"""从 openclaw.json 中提取 API key"""
config_path = os.path.expanduser("~/.openclaw/openclaw.json")
if os.path.exists(config_path):
with open(config_path) as f:
config = json.load(f)
for pconf in config.get("models", {}).get("providers", {}).values():
if pconf.get("apiKey"):
return pconf["apiKey"]
return None
def test_text(model_id, api_key, base_url):
"""Test a model with a simple text request"""
url = f"{base_url}/chat/completions"
payload = {
"model": model_id,
"messages": [{"role": "user", "content": "回复OK"}],
"max_tokens": 10
}
req = urllib.request.Request(
url,
data=json.dumps(payload).encode(),
headers={"Content-Type": "application/json", "Authorization": f"Bearer {api_key}"},
method="POST"
)
try:
resp = urllib.request.urlopen(req, timeout=30)
data = json.loads(resp.read())
content = data.get("choices", [{}])[0].get("message", {}).get("content", "")
usage = data.get("usage", {})
print(f"✅ {model_id}")
print(f" Response: {content[:50]}")
print(f" Model: {data.get('model', model_id)}")
if usage:
print(f" Tokens: {usage.get('prompt_tokens',0)} in / {usage.get('completion_tokens',0)} out")
return True
except urllib.error.HTTPError as e:
body = e.read().decode()[:200]
print(f"❌ {model_id} — HTTP {e.code}: {body}")
return False
except Exception as e:
print(f"❌ {model_id} — {e}")
return False
def test_image_gen(model_id, api_key, base_url, save_path=None):
"""Test a Gemini image generation model via chat completions"""
url = f"{base_url}/chat/completions"
payload = {
"model": model_id,
"messages": [{"role": "user", "content": "Generate a simple test image: a red circle on white background. Return the image."}],
"max_tokens": 4096
}
req = urllib.request.Request(
url,
data=json.dumps(payload).encode(),
headers={"Content-Type": "application/json", "Authorization": f"Bearer {api_key}"},
method="POST"
)
try:
resp = urllib.request.urlopen(req, timeout=120)
data = json.loads(resp.read())
content = data.get("choices", [{}])[0].get("message", {}).get("content", "")
usage = data.get("usage", {})
# Check for base64 image in response
match = re.search(r'data:image/(png|jpeg|webp);base64,([A-Za-z0-9+/=]+)', content)
if match:
fmt = match.group(1)
img_bytes = base64.b64decode(match.group(2))
print(f"✅ {model_id} — image generated ({len(img_bytes)} bytes, {fmt})")
if save_path:
out = f"{save_path}.{fmt}"
with open(out, "wb") as f:
f.write(img_bytes)
print(f" Saved: {out}")
else:
# Maybe text-only response
print(f"⚠️ {model_id} — response received but no image found")
print(f" Content preview: {content[:150]}")
if usage:
print(f" Tokens: {usage.get('prompt_tokens',0)} in / {usage.get('completion_tokens',0)} out")
return bool(match)
except urllib.error.HTTPError as e:
body = e.read().decode()[:200]
print(f"❌ {model_id} — HTTP {e.code}: {body}")
return False
except Exception as e:
print(f"❌ {model_id} — {e}")
return False
def main():
parser = argparse.ArgumentParser(description="Test BlueAI model connectivity")
parser.add_argument("model_id", nargs="?", help="Model ID to test")
parser.add_argument("--api-key", default=None, help="API key")
parser.add_argument("--base-url", default="https://bmc-llm-relay.bluemediagroup.cn/v1")
parser.add_argument("--all-configured", action="store_true", help="Test all models in openclaw.json")
parser.add_argument("--image-gen", action="store_true", help="Test as image generation model")
parser.add_argument("--save", default=None, help="Save generated image to path (without extension)")
args = parser.parse_args()
api_key = args.api_key or os.environ.get("OPENAI_API_KEY") or os.environ.get("BLUEAI_API_KEY") or get_api_key()
if not api_key:
print("❌ No API key found. Use --api-key or set BLUEAI_API_KEY")
return
if args.all_configured:
config_path = os.path.expanduser("~/.openclaw/openclaw.json")
with open(config_path) as f:
config = json.load(f)
ok = fail = 0
for pconf in config.get("models", {}).get("providers", {}).values():
for m in pconf.get("models", []):
if m.get("api") == "anthropic-messages":
continue
mid = m["id"]
if mid in IMAGE_MODELS:
result = test_image_gen(mid, api_key, args.base_url)
else:
result = test_text(mid, api_key, args.base_url)
if result:
ok += 1
else:
fail += 1
print(f"\nResults: {ok} ok, {fail} failed")
elif args.model_id:
is_image = args.image_gen or args.model_id in IMAGE_MODELS
if is_image:
test_image_gen(args.model_id, api_key, args.base_url, args.save)
else:
test_text(args.model_id, api_key, args.base_url)
else:
parser.print_help()
if __name__ == "__main__":
main()
Control Android devices via ADB (Android Debug Bridge) from a Mac. Use when: remotely operating an Android phone (tap, swipe, type, screenshot, screen record...
--- name: adb-android description: > Control Android devices via ADB (Android Debug Bridge) from a Mac. Use when: remotely operating an Android phone (tap, swipe, type, screenshot, screen recording, install/uninstall apps, file transfer, shell commands, logcat, wireless debugging, scrcpy mirroring). Triggers on "android", "adb", "phone", "手机操控", "安卓", "screen mirror", "scrcpy". Targets macOS hosts with USB or Wi-Fi connected Android devices. NOT for: iOS devices, emulators-only workflows, or Android app development/building. --- # ADB Android Control (macOS) Control Android devices from a Mac via ADB over USB or Wi-Fi. ## Prerequisites Install on macOS: ```bash brew install android-platform-tools # Verify adb version ``` Optional but recommended — scrcpy for screen mirroring: ```bash brew install scrcpy ``` ## Device Connection ### USB 1. Enable **Developer Options** on Android: Settings → About Phone → tap Build Number 7 times 2. Enable **USB Debugging** in Developer Options 3. Connect USB cable, approve the RSA key prompt on phone 4. Verify: `adb devices` should show device as `device` (not `unauthorized`) ### Wireless (Wi-Fi) — Android 11+ ```bash # On phone: Developer Options → Wireless Debugging → enable → Pair with code adb pair <phone-ip>:<pair-port> # Enter the 6-digit code adb connect <phone-ip>:<connect-port> adb devices # Should show connected ``` ### Wireless (Legacy, Android 10 and below) ```bash # Connect via USB first, then: adb tcpip 5555 adb connect <phone-ip>:5555 # Disconnect USB ``` ## Core Commands ### Device Info ```bash adb devices -l # List with details adb shell getprop ro.product.model # Device model adb shell getprop ro.build.version.release # Android version adb shell dumpsys battery # Battery info adb shell wm size # Screen resolution ``` ### App Management ```bash adb install app.apk # Install adb install -r app.apk # Reinstall keeping data adb uninstall com.example.app # Uninstall adb shell pm list packages # All packages adb shell pm list packages -3 # Third-party only adb shell am start -n com.example.app/.MainActivity # Launch app adb shell am force-stop com.example.app # Force stop adb shell pm clear com.example.app # Clear app data ``` ### File Transfer ```bash adb push local_file /sdcard/ # Mac → Phone adb pull /sdcard/file.jpg ./ # Phone → Mac adb shell ls /sdcard/ # List files ``` ### Screen Interaction (UI Automation) ```bash adb shell input tap 500 800 # Tap at (x,y) adb shell input swipe 500 1500 500 500 300 # Swipe (x1,y1,x2,y2,durationMs) adb shell input text "hello" # Type text (no spaces — use %s for space) adb shell input keyevent 66 # Press Enter adb shell input keyevent 4 # Press Back adb shell input keyevent 3 # Press Home adb shell input keyevent 26 # Power button adb shell input keyevent 187 # Recent apps ``` Common keyevent codes: See `references/keyevent-codes.md` ### Screenshot & Recording ```bash adb shell screencap /sdcard/screen.png && adb pull /sdcard/screen.png ./ adb shell screenrecord /sdcard/video.mp4 # Record (Ctrl+C to stop, max 3min) adb shell screenrecord --time-limit 10 /sdcard/video.mp4 # 10 seconds adb pull /sdcard/video.mp4 ./ ``` ### Logcat ```bash adb logcat # Full log stream adb logcat -d # Dump and exit adb logcat *:E # Errors only adb logcat -s "MyTag" # Filter by tag adb logcat --pid=$(adb shell pidof com.example.app) # App-specific adb logcat -c # Clear log buffer ``` ### Shell & System ```bash adb shell # Interactive shell adb shell whoami # Current user adb shell settings get system screen_brightness # Get brightness adb shell settings put system screen_brightness 128 # Set brightness (0-255) adb shell svc wifi enable # Enable Wi-Fi adb shell svc wifi disable # Disable Wi-Fi adb shell dumpsys activity top # Current foreground activity adb shell am broadcast -a android.intent.action.AIRPLANE_MODE # Toggle airplane adb reboot # Reboot device ``` ### Clipboard ```bash adb shell am broadcast -a clipper.set -e text "content to copy" # Requires Clipper app # Alternative for Android 10+: adb shell input text "paste this" ``` ## Screen Mirroring with scrcpy ```bash scrcpy # Mirror with default settings scrcpy --max-size 1024 # Limit resolution scrcpy --bit-rate 2M # Limit bitrate scrcpy --record file.mp4 # Mirror + record scrcpy --no-audio # Video only scrcpy --turn-screen-off # Mirror but keep phone screen off scrcpy --stay-awake # Prevent sleep while connected scrcpy --window-title "MyPhone" # Custom window title scrcpy --crop 1080:1920:0:0 # Crop region (w:h:x:y) ``` Wireless scrcpy (after adb connect): ```bash scrcpy --tcpip=<phone-ip>:<port> ``` ## Multi-Device When multiple devices are connected, specify the target: ```bash adb -s <serial> shell ... # By serial number adb -s <ip>:<port> shell ... # By IP (wireless) ``` Get serial: `adb devices` — first column is the serial. ## Automation Patterns ### Take screenshot → analyze → tap ```bash # 1. Screenshot adb shell screencap /sdcard/screen.png && adb pull /sdcard/screen.png ./screen.png # 2. Analyze image (use vision model or image tool) # 3. Tap target coordinates adb shell input tap <x> <y> ``` ### Batch install APKs ```bash for apk in *.apk; do adb install -r "$apk"; done ``` ### Open URL in browser ```bash adb shell am start -a android.intent.action.VIEW -d "https://example.com" ``` ### Send SMS (requires default SMS app handling) ```bash adb shell am start -a android.intent.action.SENDTO -d "sms:+1234567890" --es sms_body "Hello" ``` ## Troubleshooting | Issue | Fix | |-------|-----| | `unauthorized` in adb devices | Approve RSA prompt on phone; revoke & re-approve in Developer Options | | `offline` | Reconnect USB; `adb kill-server && adb start-server` | | Wireless disconnect | Re-pair: `adb pair` or reconnect: `adb connect` | | `no permissions` | On Linux: add udev rules; on Mac: usually not an issue | | Slow wireless | Use 5GHz Wi-Fi; keep phone and Mac on same network | | scrcpy black screen | Update scrcpy; try `--codec h264`; check USB debugging enabled | ## Node Execution (for OpenClaw on cloud servers) When the agent runs on a cloud server (not directly on the Mac), execute ADB commands on the Mac node: ``` Use exec with host="node" and node="<mac-node-name>" to run adb commands on the Mac that has the Android phone connected via USB. ``` This is the typical setup: the Android phone is USB-connected to the Mac, and the agent orchestrates from the cloud. FILE:references/keyevent-codes.md # ADB KeyEvent Codes Reference Common keyevent codes for `adb shell input keyevent <code>`. ## Navigation & System | Code | Key | Description | |------|-----|-------------| | 3 | HOME | Home button | | 4 | BACK | Back button | | 24 | VOLUME_UP | Volume up | | 25 | VOLUME_DOWN | Volume down | | 26 | POWER | Power/Lock | | 27 | CAMERA | Camera button | | 82 | MENU | Menu button | | 187 | APP_SWITCH | Recent apps | | 220 | BRIGHTNESS_DOWN | | | 221 | BRIGHTNESS_UP | | ## Text Input | Code | Key | Description | |------|-----|-------------| | 66 | ENTER | Enter/Return | | 67 | DEL | Backspace | | 112 | FORWARD_DEL | Delete forward | | 61 | TAB | Tab | | 62 | SPACE | Space | | 59 | SHIFT_LEFT | | | 113 | CTRL_LEFT | | ## D-Pad / Arrow Keys | Code | Key | |------|-----| | 19 | DPAD_UP | | 20 | DPAD_DOWN | | 21 | DPAD_LEFT | | 22 | DPAD_RIGHT | | 23 | DPAD_CENTER | ## Media | Code | Key | |------|-----| | 85 | MEDIA_PLAY_PAUSE | | 86 | MEDIA_STOP | | 87 | MEDIA_NEXT | | 88 | MEDIA_PREVIOUS | | 126 | MEDIA_PLAY | | 127 | MEDIA_PAUSE | | 164 | MUTE | ## Letters & Numbers - Letters: A=29, B=30, ... Z=54 - Numbers: 0=7, 1=8, ... 9=16 - F1-F12: 131-142 ## Usage Patterns ```bash # Press Home adb shell input keyevent 3 # Long press Power (3 seconds) — use sendevent for long press adb shell input keyevent --longpress 26 # Key combo: Ctrl+A (select all) — not directly supported, use: adb shell input keyevent 29 --meta CTRL_LEFT ```
macOS Gateway 24/7 watchdog with 4-layer health checks and auto-repair. Monitors: L1 process alive, L2 HTTP port, L3 WebSocket communication (1006 detection)...
---
name: openclaw-doctor
version: 1.0.0
description: >
macOS Gateway 24/7 watchdog with 4-layer health checks and auto-repair.
Monitors: L1 process alive, L2 HTTP port, L3 WebSocket communication (1006 detection),
L4 macOS sleep prevention (caffeinate). Deploys as a LaunchAgent running every 5 minutes.
Use when: setting up Gateway high-availability on macOS, diagnosing Gateway disconnections,
preventing Mac sleep from killing the assistant, or automating Gateway recovery.
NOT for: Linux/systemd setups, Windows, or non-Gateway health checks.
metadata:
openclaw:
requires:
os: [macos]
commands: [curl, pgrep, launchctl, caffeinate]
---
# OpenClaw Doctor — macOS Gateway 看门狗 v2
24/7 health watchdog for OpenClaw Gateway on macOS. Detects and auto-repairs four layers of failure.
## Why
OpenClaw Gateway is the message bridge — if it dies, the AI assistant goes silent. Common failure modes on macOS:
| Layer | Failure | Symptom |
|-------|---------|---------|
| L1 | Process crash | Complete silence |
| L2 | HTTP port stuck | Complete silence |
| L3 | WebSocket 1006 disconnect | Process alive, HTTP OK, but **messages don't arrive** (sneakiest!) |
| L4 | Mac sleep/hibernate | All connections die after lid close or idle timeout |
## Architecture
```
LaunchAgent (every 5 min)
→ L1: pgrep + launchctl (process alive?)
→ L2: curl HTTP probe (port responding?)
→ L3: Log scan for WS 1006 errors (communication healthy?)
→ L4: caffeinate keepalive (prevent sleep)
→ Auto-repair with minimum intervention principle
```
### Repair Strategy (escalating)
| Failure | Action | Rationale |
|---------|--------|-----------|
| Process down | `openclaw doctor --repair` → restart Gateway | Process crashed |
| HTTP unreachable | Restart Gateway | Port stuck |
| WS frequent disconnect | Restart Node first → then full restart | WS layer issue, Node restart usually sufficient |
| Post-sleep recovery | Gateway + Node dual restart | All connections need rebuild |
## Setup
### 1. Copy the script
```bash
cp scripts/doctor.sh ~/.openclaw/doctor.sh
chmod +x ~/.openclaw/doctor.sh
```
### 2. Configure (optional)
Environment variables for customization:
```bash
# In ~/.bashrc or ~/.zshrc (if non-default)
export OPENCLAW_DOCTOR_GATEWAY_URL="http://127.0.0.1:18789" # default
export OPENCLAW_DOCTOR_SERVICE_NAME="ai.openclaw.gateway" # default
export OPENCLAW_DOCTOR_NODE_SERVICE="ai.openclaw.node" # default
```
### 3. Install LaunchAgent
Edit `references/ai.openclaw.doctor.plist` — replace `REPLACE_WITH_HOME` with your actual home directory path (e.g. `/Users/yourname`).
```bash
# Copy and customize the plist
cp references/ai.openclaw.doctor.plist ~/Library/LaunchAgents/ai.openclaw.doctor.plist
sed -i '' "s|REPLACE_WITH_HOME|$HOME|g" ~/Library/LaunchAgents/ai.openclaw.doctor.plist
# Load the service
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.openclaw.doctor.plist
```
### 4. Verify
```bash
# Manual test run
bash ~/.openclaw/doctor.sh
# Check logs
tail -10 ~/.openclaw/logs/doctor.log
# Confirm caffeinate is running
pgrep -la caffeinate
# Confirm LaunchAgent is loaded
launchctl list | grep doctor
```
## Logs
Location: `~/.openclaw/logs/doctor.log`
| Prefix | Meaning |
|--------|---------|
| HEARTBEAT | Periodic health confirmation (hourly) |
| ALERT | Anomaly detected |
| DIAGNOSIS | Fault classification |
| ACTION | Repair in progress |
| RESOLVED | Fault repaired |
| CRITICAL | All repair attempts failed |
| INFO | General info (e.g. caffeinate started) |
Auto-rotates at 5MB (keeps last 1000 lines).
## Troubleshooting
**Process alive + HTTP OK but messages don't arrive?**
→ WS disconnect. Check: `grep "1006" /tmp/openclaw/openclaw-$(date +%Y-%m-%d).log | tail -10`
**Disconnects every night?**
→ Mac sleep. Verify caffeinate: `pgrep -la caffeinate`
**Doctor itself not running?**
→ Check LaunchAgent: `launchctl list | grep doctor`. Reload if missing.
**Temporarily disable:**
```bash
launchctl bootout gui/$(id -u)/ai.openclaw.doctor
```
## Files
- `scripts/doctor.sh` — Main watchdog script
- `references/ai.openclaw.doctor.plist` — LaunchAgent template
## Version History
| Version | Date | Changes |
|---------|------|---------|
| v1 | 2026-03-07 | Initial: process check + HTTP probe + Gateway restart |
| v2 | 2026-03-23 | WS health check + Mac sleep prevention + layered repair + Node restart |
FILE:scripts/doctor.sh
#!/bin/bash
# OpenClaw Doctor - 24/7 健康看门狗 v2
# macOS Gateway watchdog with L1-L4 health checks
# Requires: macOS, OpenClaw Gateway installed
set -euo pipefail
LOG_DIR="$HOME/.openclaw/logs"
LOG_FILE="$LOG_DIR/doctor.log"
GATEWAY_URL="-http://127.0.0.1:18789"
SERVICE_NAME="-ai.openclaw.gateway"
NODE_SERVICE_NAME="-ai.openclaw.node"
MAX_LOG_SIZE=5242880 # 5MB
mkdir -p "$LOG_DIR"
log() {
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $1" >> "$LOG_FILE"
}
rotate_log() {
if [ -f "$LOG_FILE" ] && [ "$(stat -f%z "$LOG_FILE" 2>/dev/null || echo 0)" -gt "$MAX_LOG_SIZE" ]; then
tail -1000 "$LOG_FILE" > "$LOG_FILE.tmp"
mv "$LOG_FILE.tmp" "$LOG_FILE"
log "LOG_ROTATED"
fi
}
# L1: Process alive check
check_process() {
pgrep -f "openclaw.*gateway" > /dev/null 2>&1 && return 0
launchctl list "$SERVICE_NAME" 2>/dev/null | grep -q '"PID"' && return 0
return 1
}
# L2: HTTP port responding
check_http() {
local status
status=$(curl -s -o /dev/null -w "%{http_code}" --connect-timeout 5 --max-time 10 "$GATEWAY_URL/" 2>/dev/null || echo "000")
[ "$status" != "000" ]
}
# L3: WebSocket communication health (log-based)
check_ws_health() {
local log_file="/tmp/openclaw/openclaw-$(date '+%Y-%m-%d').log"
[ ! -f "$log_file" ] && return 0
local recent_errors
recent_errors=$(tail -200 "$log_file" 2>/dev/null | grep -c "gateway closed (1006)" || echo "0")
[ "$recent_errors" -le 3 ]
}
# L4: Prevent macOS sleep
ensure_awake() {
if ! pgrep -f "caffeinate" > /dev/null 2>&1; then
nohup caffeinate -dis -t 3600 > /dev/null 2>&1 &
log "INFO - Started caffeinate to prevent sleep (1h)"
fi
}
restart_gateway() {
log "ACTION - Restarting gateway"
launchctl kickstart -k "gui/$(id -u)/$SERVICE_NAME" 2>&1 && return 0
launchctl bootout "gui/$(id -u)/$SERVICE_NAME" 2>/dev/null || true
sleep 2
launchctl bootstrap "gui/$(id -u)" "$HOME/Library/LaunchAgents/SERVICE_NAME.plist" 2>&1 && return 0
openclaw gateway start 2>&1 || true
}
restart_node() {
log "ACTION - Restarting node"
launchctl kickstart -k "gui/$(id -u)/$NODE_SERVICE_NAME" 2>&1 && return 0
return 1
}
# === Main logic ===
rotate_log
ensure_awake
HEALTHY=true
ISSUES=""
if ! check_process; then
HEALTHY=false; ISSUES="PROCESS_DOWN"
log "ALERT - Gateway process not found"
fi
if ! check_http; then
HEALTHY=false; ISSUES="+$ISSUES+HTTP_UNREACHABLE"
log "ALERT - Gateway HTTP probe failed"
fi
if [ "$HEALTHY" = true ] && ! check_ws_health; then
HEALTHY=false; ISSUES="WS_FREQUENT_DISCONNECT"
log "ALERT - Frequent WS disconnections detected"
fi
if [ "$HEALTHY" = false ]; then
log "DIAGNOSIS - $ISSUES"
case "$ISSUES" in
*WS_FREQUENT_DISCONNECT*)
restart_node; sleep 5
if ! check_ws_health; then
restart_gateway; sleep 3; restart_node; sleep 5
fi
check_http && log "RESOLVED - WS fix applied" || log "CRITICAL - Still unhealthy!"
;;
*)
openclaw doctor --repair --non-interactive --yes 2>&1 | tail -5 >> "$LOG_FILE" || true
sleep 3
if ! check_http; then
restart_gateway; sleep 5
check_http && log "RESOLVED - Gateway recovered" || log "CRITICAL - Gateway still down!"
else
log "RESOLVED - Doctor repair succeeded"
fi
;;
esac
else
MINUTE=$(date '+%M')
[ "$MINUTE" -lt 5 ] && log "HEARTBEAT - All checks passed ✓ (v2)"
fi
exit 0
Query social media data via TikHub API (https://api.tikhub.io). Covers 20+ platforms: Douyin, TikTok, Xiaohongshu, Instagram, YouTube, Twitter/X, Threads, Re...
---
name: tikhub-social-media
version: 1.0.0
description: >
Query social media data via TikHub API (https://api.tikhub.io). Covers 20+ platforms:
Douyin, TikTok, Xiaohongshu, Instagram, YouTube, Twitter/X, Threads, Reddit, LinkedIn,
Weibo, Kuaishou, Bilibili, WeChat (MP + Channels), Zhihu, Toutiao, Xigua, PiPiXia, Lemon8, NetEase Music.
Capabilities: user profiles, post/video details, search (keyword/hashtag/user), comments,
followers/following, trending/hot lists, hashtag/challenge data, live streams, creator analytics.
Use when: user asks to search social media, fetch platform data, get influencer/KOL info,
analyze social content, retrieve post/video details by URL or ID, check trending topics,
or any social media data retrieval task.
NOT for: web scraping (use scrapling), non-social-media data, posting/interaction actions.
metadata:
openclaw:
requires:
envs:
- TIKHUB_API_KEY
---
# TikHub Social Media Data Query
## Setup (Required)
Set your API key before using this skill:
```bash
export TIKHUB_API_KEY="<your-tikhub-api-key>"
```
Get your API key at: https://tikhub.io (register → dashboard → API Keys)
Optional proxy (if TikHub API is blocked in your network):
```bash
export TIKHUB_PROXY="http://your-proxy:port"
```
## Authentication
- **Base URL**: `https://api.tikhub.io`
- **Auth Header**: `Authorization: Bearer <TIKHUB_API_KEY>`
- All responses: unified `ResponseModel` → `{code, message, data, cache_url, ...}`
- Check balance: `GET /api/v1/tikhub/user/get_user_info`
## Helper Script
Use `scripts/tikhub_query.py` for all API calls:
```bash
python3 scripts/tikhub_query.py <endpoint_path> [param=value ...] [--method POST] [--body '{}']
```
Examples:
```bash
# Search Douyin videos
python3 scripts/tikhub_query.py /api/v1/douyin/web/fetch_search keyword=宁德时代
# Get TikTok user profile
python3 scripts/tikhub_query.py /api/v1/tiktok/web/fetch_user_profile secUid=MS4wLjABAAAA...
# Search Xiaohongshu notes
python3 scripts/tikhub_query.py /api/v1/xiaohongshu/web/get_note_by_keyword keyword=CATL
# Get Instagram user info
python3 scripts/tikhub_query.py /api/v1/instagram/v1/fetch_user_info username=cataborrecycling
# Search Twitter
python3 scripts/tikhub_query.py /api/v1/twitter/web/fetch_search_timeline keyword="CATL battery"
# Search YouTube
python3 scripts/tikhub_query.py /api/v1/youtube/web/search_videos keyword="CATL solid state battery"
# Get Weibo hot search
python3 scripts/tikhub_query.py /api/v1/weibo/web/fetch_hot_search
# Hybrid parse any video URL
python3 scripts/tikhub_query.py /api/v1/hybrid/video_data url=https://v.douyin.com/xxx
```
## Platform Quick Reference
### Endpoint Naming Convention
All endpoints follow: `/api/v1/{platform}/{source}/{action}`
- `platform`: douyin, tiktok, xiaohongshu, instagram, youtube, twitter, weibo, kuaishou, bilibili, etc.
- `source`: web, app, app/v3, web_v2, etc.
- `action`: fetch_user_profile, fetch_one_video, fetch_search, etc.
### Core Actions (available on most platforms)
| Action Pattern | Purpose |
|---|---|
| `fetch_user_profile` / `fetch_user_info` | Get user/account details |
| `fetch_user_post` / `fetch_user_posts` | Get user's posts/videos |
| `fetch_one_video` / `fetch_post_detail` | Get single post/video by ID |
| `fetch_search` / `search` | Keyword search |
| `fetch_post_comments` / `fetch_comments` | Get comments on a post |
| `fetch_user_fans` / `fetch_user_followers` | Follower list |
| `fetch_user_follow` / `fetch_user_followings` | Following list |
| `fetch_trending` / `fetch_hot_search` | Trending/hot topics |
### Platform → Preferred API Version
| Platform | Preferred Prefix | Notes |
|---|---|---|
| 抖音 Douyin | `/api/v1/douyin/web/` or `/api/v1/douyin/app/v3/` | Web for search, App V3 for details |
| 抖音搜索 | `/api/v1/douyin/search/` | Dedicated search APIs (latest) |
| 抖音创作者 | `/api/v1/douyin/creator_v2/` | Requires creator cookie |
| 抖音热榜 | `/api/v1/douyin/billboard/` | Hot lists, trending |
| 抖音星图 | `/api/v1/douyin/xingtu_v2/` | KOL marketplace data |
| TikTok | `/api/v1/tiktok/web/` or `/api/v1/tiktok/app/v3/` | Web for search, App V3 for details |
| 小红书 XHS | `/api/v1/xiaohongshu/app_v2/` | Most stable, recommended |
| Instagram | `/api/v1/instagram/v1/` | Prefer V1, V2/V3 as fallback |
| YouTube | `/api/v1/youtube/web/` | V2 for additional features |
| Twitter/X | `/api/v1/twitter/web/` | Search, user, posts, trending |
| Threads | `/api/v1/threads/web/` | User, posts, search |
| Reddit | `/api/v1/reddit/app/` | Full featured app API |
| LinkedIn | `/api/v1/linkedin/web/` | Profiles, posts, search |
| 微博 Weibo | `/api/v1/weibo/web_v2/` | V2 recommended |
| 快手 Kuaishou | `/api/v1/kuaishou/web/` or `/api/v1/kuaishou/app/` | |
| B站 Bilibili | `/api/v1/bilibili/web/` | |
| 微信公众号 | `/api/v1/wechat_mp/web/` | Article extraction |
| 微信视频号 | `/api/v1/wechat_channels/` | Requires special params |
| 知乎 Zhihu | `/api/v1/zhihu/web/` | Q&A, articles, search |
| 今日头条 | `/api/v1/toutiao/web/` or `/api/v1/toutiao/app/` | |
| Lemon8 | `/api/v1/lemon8/app/` | |
### Pagination
Most list endpoints support cursor-based pagination:
- `cursor` / `max_cursor` / `offset` / `after` — pass from previous response
- `count` / `page_size` — items per page (typically 10-30)
- Response includes `has_more`, `cursor`, `next_cursor` etc.
### Hybrid Video Parser
Parse any video URL from supported platforms automatically:
```
GET /api/v1/hybrid/video_data?url=<any_video_url>
```
Supports: Douyin, TikTok, Xiaohongshu, Kuaishou, Bilibili, Weibo, etc.
## Detailed Platform References
For full endpoint lists per platform, read the corresponding reference file:
- **references/douyin.md** — Douyin (Web + App + Search + Billboard + Creator + Xingtu)
- **references/tiktok.md** — TikTok (Web + App + Creator + Analytics + Ads + Shop)
- **references/xiaohongshu.md** — Xiaohongshu (App V2 + Web V2)
- **references/instagram.md** — Instagram (V1 + V2 + V3)
- **references/youtube.md** — YouTube (Web + V2)
- **references/twitter-threads.md** — Twitter/X + Threads
- **references/reddit-linkedin.md** — Reddit + LinkedIn
- **references/chinese-platforms.md** — Weibo, Kuaishou, Bilibili, WeChat, Zhihu, Toutiao, etc.
Only read the relevant reference file when you need endpoint details for a specific platform.
## Cost Awareness
- Most endpoints: $0.001-$0.005 per call
- Some premium endpoints (Instagram, creator analytics): up to $0.01
- Always prefer cached results when `cache_url` is returned
- Batch operations where available (e.g., Reddit batch post details)
- Check balance before bulk operations: `GET /api/v1/tikhub/user/get_user_info`
FILE:references/chinese-platforms.md
# Chinese Platforms API Reference
Total endpoints: 236
## /api/v1/xigua/app
### `GET /api/v1/xigua/app/v2/fetch_one_video`
**获取单个作品数据/Get single video data**
Parameters:
- `item_id`*: 作品id/Video id
### `GET /api/v1/xigua/app/v2/fetch_one_video_v2`
**获取单个作品数据 V2/Get single video data V2**
Parameters:
- `item_id`*: 作品id/Video id
### `GET /api/v1/xigua/app/v2/fetch_one_video_play_url`
**获取单个作品的播放链接/Get single video play URL**
Parameters:
- `item_id`*: 作品id/Video id
### `GET /api/v1/xigua/app/v2/fetch_video_comment_list`
**视频评论列表/Video comment list**
Parameters:
- `item_id`*: 作品id/Video id
- `offset`: 偏移量/Offset
- `count`: 数量/Count
### `GET /api/v1/xigua/app/v2/search_video`
**搜索视频/Search video**
Parameters:
- `keyword`*: 关键词/Keyword
- `offset`: 偏移量/Offset
- `order_type`: 排序方式/Order type
- `min_duration`: 最小时长/Minimum duration
- `max_duration`: 最大时长/Maximum duration
### `GET /api/v1/xigua/app/v2/fetch_user_info`
**个人信息/Personal information**
Parameters:
- `user_id`*: 用户id/User id
### `GET /api/v1/xigua/app/v2/fetch_user_post_list`
**获取个人作品列表/Get user post list**
Parameters:
- `user_id`*: 用户id/User id
- `max_behot_time`: 最大行为时间/Maximum behavior time
## /api/v1/toutiao/web
### `GET /api/v1/toutiao/web/get_article_info`
**获取指定文章的信息/Get information of specified article**
Parameters:
- `aweme_id`*: 作品ID/Post ID
### `GET /api/v1/toutiao/web/get_video_info`
**获取指定视频的信息/Get information of specified video**
Parameters:
- `aweme_id`*: 作品ID/Post ID
## /api/v1/toutiao/app
### `GET /api/v1/toutiao/app/get_article_info`
**获取指定文章的信息/Get information of specified article**
Parameters:
- `group_id`*: 作品ID/Post ID
### `GET /api/v1/toutiao/app/get_video_info`
**获取指定视频的信息/Get information of specified video**
Parameters:
- `group_id`*: 作品ID/Post ID
### `GET /api/v1/toutiao/app/get_comments`
**获取指定作品的评论/Get comments of specified post**
Parameters:
- `group_id`*: 作品ID/Post ID
- `offset`*: 偏移量/Offset
### `GET /api/v1/toutiao/app/get_user_info`
**获取指定用户的信息/Get information of specified user**
Parameters:
- `user_id`*: 用户ID/User ID
### `GET /api/v1/toutiao/app/get_user_id`
**从头条用户主页获取用户user_id/Get user_id from user profile**
Parameters:
- `user_profile_url`*: 用户主页链接/User profile URL
## /api/v1/lemon8/app
### `GET /api/v1/lemon8/app/fetch_user_profile`
**获取指定用户的信息/Get information of specified user**
Parameters:
- `user_id`*: 用户ID/User ID
### `GET /api/v1/lemon8/app/fetch_post_detail`
**获取指定作品的信息/Get information of specified post**
Parameters:
- `item_id`*: 作品ID/Post ID
### `GET /api/v1/lemon8/app/fetch_user_follower_list`
**获取指定用户的粉丝列表/Get fans list of specified user**
Parameters:
- `user_id`*: 用户ID/User ID
- `cursor`: 翻页参数/Pagination parameter
### `GET /api/v1/lemon8/app/fetch_user_following_list`
**获取指定用户的关注列表/Get following list of specified user**
Parameters:
- `user_id`*: 用户ID/User ID
- `cursor`: 翻页参数/Pagination parameter
### `GET /api/v1/lemon8/app/fetch_post_comment_list`
**获取指定作品的评论列表/Get comments list of specified post**
Parameters:
- `group_id`*: 作品的group_id/Post's group_id
- `item_id`*: 作品的item_id/Post's item_id
- `media_id`*: 作品的media_id/Post's media_id
- `offset`: 翻页参数/Pagination parameter
### `GET /api/v1/lemon8/app/fetch_discover_banners`
**获取发现页Banner/Get banners of discover page**
### `GET /api/v1/lemon8/app/fetch_discover_tab`
**获取发现页主体内容/Get main content of discover page**
### `GET /api/v1/lemon8/app/fetch_discover_tab_information_tabs`
**获取发现页的 Editor's Picks/Get Editor's Picks of discover page**
### `GET /api/v1/lemon8/app/fetch_hot_search_keywords`
**获取热搜关键词/Get hot search keywords**
### `GET /api/v1/lemon8/app/fetch_topic_info`
**获取话题信息/Get topic information**
Parameters:
- `forum_id`*: 话题ID/Topic ID
### `GET /api/v1/lemon8/app/fetch_topic_post_list`
**获取话题作品列表/Get topic post list**
Parameters:
- `category`*: 话题分类 ID/Topic category ID
- `max_behot_time`: 翻页参数/Pagination parameter
- `category_parameter`*: 分类参数/Category parameter
- `hashtag_name`*: Hashtag名称/Hashtag name
- `sort_type`: 排序方式/Sort type
### `GET /api/v1/lemon8/app/fetch_search`
**搜索接口/Search API**
Parameters:
- `query`*: 搜索关键词/Search keyword
- `max_cursor`: 翻页参数/Pagination parameter
- `filter_type`: 搜索过滤类型/Search filter type
- `order_by`: 搜索排序方式/Search sort type
- `search_tab`: 搜索类型/Search type
### `GET /api/v1/lemon8/app/get_item_id`
**通过分享链接获取作品ID/Get post ID through sharing link**
Parameters:
- `share_text`*: 分享链接/Share link
### `GET /api/v1/lemon8/app/get_user_id`
**通过分享链接获取用户ID/Get user ID through sharing link**
Parameters:
- `share_text`*: 分享链接/Share link
### `POST /api/v1/lemon8/app/get_item_ids`
**通过分享链接批量获取作品ID/Get post IDs in batch through sharing links**
### `POST /api/v1/lemon8/app/get_user_ids`
**通过分享链接批量获取用户ID/Get user IDs in batch through sharing links**
## /api/v1/kuaishou/web
### `GET /api/v1/kuaishou/web/fetch_one_video`
**获取单个作品数据 V1/Get single video data V1**
Parameters:
- `share_text`*:
### `GET /api/v1/kuaishou/web/fetch_one_video_v2`
**获取单个作品数据 V2/Get single video data V2**
Parameters:
- `photo_id`*:
### `GET /api/v1/kuaishou/web/fetch_one_video_by_url`
**链接获取作品数据/Fetch single video by URL**
Parameters:
- `url`*:
### `GET /api/v1/kuaishou/web/fetch_one_video_comment`
**获取作品一级评论/Fetch video comments**
Parameters:
- `photo_id`*:
- `pcursor`:
### `GET /api/v1/kuaishou/web/fetch_one_video_sub_comment`
**获取作品二级评论/Fetch video sub comments**
Parameters:
- `photo_id`*:
- `pcursor`:
- `root_comment_id`*:
### `GET /api/v1/kuaishou/web/generate_share_short_url`
**生成分享短连接/Generate share short URL**
Parameters:
- `photo_id`*:
### `GET /api/v1/kuaishou/web/fetch_user_info`
**获取用户信息/Fetch user info**
Parameters:
- `user_id`*:
### `GET /api/v1/kuaishou/web/fetch_user_post`
**获取用户发布作品/Fetch user posts**
Parameters:
- `user_id`*:
- `pcursor`:
### `GET /api/v1/kuaishou/web/fetch_user_live_replay`
**获取用户直播回放/Fetch user live replay**
Parameters:
- `user_id`*:
- `pcursor`:
### `GET /api/v1/kuaishou/web/fetch_user_collect`
**获取用户收藏作品/Fetch user collect**
Parameters:
- `user_id`*:
- `pcursor`:
### `GET /api/v1/kuaishou/web/fetch_kuaishou_hot_list_v1`
**获取快手热榜 V1/Fetch Kuaishou Hot List V1**
### `GET /api/v1/kuaishou/web/fetch_kuaishou_hot_list_v2`
**获取快手热榜 V2/Fetch Kuaishou Hot List V2**
Parameters:
- `board_type`:
### `GET /api/v1/kuaishou/web/fetch_get_user_id`
**获取用户ID/Fetch user ID**
Parameters:
- `share_link`*:
## /api/v1/kuaishou/app
### `GET /api/v1/kuaishou/app/fetch_one_video`
**视频详情V1/Video detailsV1**
Parameters:
- `photo_id`*:
### `GET /api/v1/kuaishou/app/fetch_videos_batch`
**快手批量视频查询接口/Kuaishou batch video query API**
Parameters:
- `photo_ids`*: 多个作品ID用逗号分隔,单次最多40个/Multiple photo IDs separated by commas,
### `GET /api/v1/kuaishou/app/fetch_one_video_by_url`
**根据链接获取单个作品数据/Fetch single video by URL**
Parameters:
- `share_text`*:
### `GET /api/v1/kuaishou/app/fetch_one_video_comment`
**获取单个作品评论数据/Get single video comment data**
Parameters:
- `photo_id`*:
- `pcursor`:
### `GET /api/v1/kuaishou/app/fetch_one_user_v2`
**获取单个用户数据V2/Get single user data V2**
Parameters:
- `user_id`*:
### `GET /api/v1/kuaishou/app/fetch_user_live_info`
**获取用户直播信息/Get user live info**
Parameters:
- `user_id`*:
### `GET /api/v1/kuaishou/app/fetch_user_hot_post`
**获取用户热门作品数据/Get user hot post data**
Parameters:
- `user_id`*:
- `pcursor`:
### `GET /api/v1/kuaishou/app/fetch_user_post_v2`
**用户视频列表V2/User video list V2**
Parameters:
- `user_id`*:
- `pcursor`:
### `GET /api/v1/kuaishou/app/search_comprehensive`
**综合搜索/Comprehensive search**
Parameters:
- `keyword`*:
- `pcursor`:
- `sort_type`: 可选值: all(综合排序), newest(最新发布), most_likes(最多点赞)
- `publish_time`: 可选值: all(全部), one_day(近一日), one_week(近一周), one_month(近一月)
- `duration`: 可选值: all(全部), under_1_min(1分钟以内), 1_to_5_min(1-5分钟), over_5_
- `search_scope`: 可选值: all(全部)
### `GET /api/v1/kuaishou/app/search_video_v2`
**搜索视频V2/Search video V2**
Parameters:
- `keyword`*:
- `page`:
### `GET /api/v1/kuaishou/app/search_user_v2`
**搜索用户V2/Search user V2**
Parameters:
- `keyword`*:
- `page`:
### `GET /api/v1/kuaishou/app/fetch_hot_board_categories`
**快手热榜分类/Kuaishou hot categories**
### `GET /api/v1/kuaishou/app/fetch_hot_board_detail`
**快手热榜详情/Kuaishou hot board detail**
Parameters:
- `boardType`:
- `boardId`:
### `GET /api/v1/kuaishou/app/fetch_hot_search_person`
**快手热搜人物榜单/Kuaishou hot search person board**
### `GET /api/v1/kuaishou/app/fetch_live_top_list`
**快手直播榜单/Kuaishou live top list**
Parameters:
- `subTabId`:
- `subTabName`:
### `GET /api/v1/kuaishou/app/fetch_shopping_top_list`
**快手购物榜单/Kuaishou shopping top list**
Parameters:
- `subTabId`:
- `subTabName`:
### `GET /api/v1/kuaishou/app/fetch_brand_top_list`
**快手品牌榜单/Kuaishou brand top list**
Parameters:
- `subTabId`:
- `subTabName`:
### `GET /api/v1/kuaishou/app/generate_kuaishou_share_link`
**生成快手分享链接/Generate Kuaishou share link**
Parameters:
- `shareObjectId`*:
### `GET /api/v1/kuaishou/app/fetch_magic_face_usage`
**获取魔法表情使用人数/Fetch magic face usage count**
Parameters:
- `magic_face_id`*:
### `GET /api/v1/kuaishou/app/fetch_magic_face_hot`
**获取魔法表情热门视频/Fetch magic face hot videos**
Parameters:
- `magic_face_id`*:
- `pcursor`:
- `count`:
## /api/v1/zhihu/web
### `GET /api/v1/zhihu/web/fetch_column_articles`
**获取知乎专栏文章列表/Get Zhihu Column Articles**
Parameters:
- `column_id`*: 专栏ID/Column ID
- `limit`: 每页文章数量/Number of articles per page
- `offset`: 偏移量/Offset
### `GET /api/v1/zhihu/web/fetch_column_article_detail`
**获取知乎专栏文章详情/Get Zhihu Column Article Detail**
Parameters:
- `article_id`*: 文章ID/Article ID
### `GET /api/v1/zhihu/web/fetch_column_recommend`
**获取知乎相似专栏推荐/Get Zhihu Similar Column Recommend**
Parameters:
- `article_id`*: 文章ID/Article ID
- `limit`: 每页专栏数量/Number of columns per page
- `offset`: 偏移量/Offset
### `GET /api/v1/zhihu/web/fetch_column_relationship`
**获取知乎专栏文章互动关系/Get Zhihu Column Article Relationship**
Parameters:
- `article_id`*: 文章ID/Article ID
### `GET /api/v1/zhihu/web/fetch_column_comment_config`
**获取知乎专栏评论区配置/Get Zhihu Column Comment Config**
Parameters:
- `article_id`*: 文章ID/Article ID
### `GET /api/v1/zhihu/web/fetch_hot_recommend`
**获取知乎首页推荐/Get Zhihu Hot Recommend**
Parameters:
- `offset`: 偏移量/Offset
- `page_number`: 页码/Page Number
- `session_token`: 会话令牌/Session Token
### `GET /api/v1/zhihu/web/fetch_hot_list`
**获取知乎首页热榜/Get Zhihu Hot List**
Parameters:
- `limit`: 每页文章数量/Number of articles per page
- `desktop`: 是否为桌面端/Is it a desktop
### `GET /api/v1/zhihu/web/fetch_video_list`
**获取知乎首页视频榜/Get Zhihu Video List**
Parameters:
- `offset`: 偏移量/Offset
- `limit`: 每页视频数量/Number of videos per page
### `GET /api/v1/zhihu/web/fetch_article_search_v3`
**获取知乎文章搜索V3/Get Zhihu Article Search V3**
Parameters:
- `keyword`*: 搜索关键词/Search Keywords
- `offset`: 偏移量/Offset
- `limit`: 每页文章数量/Number of articles per page
- `show_all_topics`: 显示所有主题/Show all topics
- `search_source`: 搜索来源/Search Source
- `search_hash_id`: 搜索哈希ID/Search Hash ID
- `vertical`: 垂类/Vertical Type
- `sort`: 排序/Sort
- `time_interval`: 时间间隔/Time Interval
- `vertical_info`: 垂类信息/Vertical Info
### `GET /api/v1/zhihu/web/fetch_user_search_v3`
**获取知乎用户搜索V3/Get Zhihu User Search V3**
Parameters:
- `keyword`*: 搜索关键词/Search Keywords
- `offset`: 偏移量/Offset
- `limit`: 每页用户数量/Number of users per page
### `GET /api/v1/zhihu/web/fetch_topic_search_v3`
**获取知乎话题搜索V3/Get Zhihu Topic Search V3**
Parameters:
- `keyword`*: 搜索关键词/Search Keywords
- `offset`: 偏移量/Offset
- `limit`: 每页话题数量/Number of topics per page
### `POST /api/v1/zhihu/web/fetch_scholar_search_v3`
**获取知乎论文搜索V3/Get Zhihu Scholar Search V3**
Parameters:
- `keyword`*: 搜索关键词/Search Keywords
- `offset`: 偏移量/Offset
- `limit`: 每页论文数量/Number of papers per page
### `GET /api/v1/zhihu/web/fetch_ai_search`
**获取知乎AI搜索/Get Zhihu AI Search**
Parameters:
- `message_content`*: 搜索内容/Search Content
### `GET /api/v1/zhihu/web/fetch_ai_search_result`
**获取知乎AI搜索结果/Get Zhihu AI Search Result**
Parameters:
- `message_id`*: 消息ID/Message ID
### `GET /api/v1/zhihu/web/fetch_video_search_v3`
**获取知乎视频搜索V3/Get Zhihu Video Search V3**
Parameters:
- `keyword`*: 搜索关键词/Search Keywords
- `limit`: 每页视频数量/Number of videos per page
- `offset`: 偏移量/Offset
- `search_hash_id`: 搜索哈希ID/Search Hash ID
### `GET /api/v1/zhihu/web/fetch_column_search_v3`
**获取知乎专栏搜索V3/Get Zhihu Column Search V3**
Parameters:
- `keyword`*: 搜索关键词/Search Keywords
- `offset`: 偏移量/Offset
- `limit`: 每页专栏数量/Number of columns per page
- `search_hash_id`: 搜索哈希ID/Search Hash ID
### `GET /api/v1/zhihu/web/fetch_salt_search_v3`
**获取知乎盐选内容搜索V3/Get Zhihu Salt Search V3**
Parameters:
- `keyword`*: 搜索关键词/Search Keywords
- `offset`: 偏移量/Offset
- `limit`: 每页内容数量/Number of contents per page
- `search_hash_id`: 搜索哈希ID/Search Hash ID
### `GET /api/v1/zhihu/web/fetch_ebook_search_v3`
**获取知乎电子书搜索V3/Get Zhihu Ebook Search V3**
Parameters:
- `keyword`*: 搜索关键词/Search Keywords
- `offset`: 偏移量/Offset
- `limit`: 每页电子书数量/Number of ebooks per page
- `search_hash_id`: 搜索哈希ID/Search Hash ID
### `GET /api/v1/zhihu/web/fetch_preset_search`
**获取知乎搜索预设词/Get Zhihu Preset Search**
### `GET /api/v1/zhihu/web/fetch_search_recommend`
**获取知乎搜索发现/Get Zhihu Search Recommend**
### `GET /api/v1/zhihu/web/fetch_search_suggest`
**知乎搜索预测词/Get Zhihu Search Suggest**
Parameters:
- `keyword`*: 搜索关键词/Search Keywords
### `GET /api/v1/zhihu/web/fetch_comment_v5`
**获取知乎评论区V5/Get Zhihu Comment V5**
Parameters:
- `answer_id`*: 回答ID/Answer ID
- `order_by`: 排序/Sort
- `limit`: 每页评论数量/Number of comments per page
- `offset`: 偏移量/Offset
### `GET /api/v1/zhihu/web/fetch_sub_comment_v5`
**获取知乎子评论区V5/Get Zhihu Sub Comment V5**
Parameters:
- `comment_id`*: 评论ID/Comment ID
- `order_by`: 排序/Sort
- `limit`: 每页评论数量/Number of comments per page
- `offset`: 偏移量/Offset
### `GET /api/v1/zhihu/web/fetch_user_info`
**获取知乎用户信息/Get Zhihu User Info**
Parameters:
- `user_url_token`*: 用户ID/User ID
### `GET /api/v1/zhihu/web/fetch_user_followees`
**获取知乎用户关注列表/Get Zhihu User Following**
Parameters:
- `user_url_token`*: 用户ID/User ID
- `offset`: 偏移量/Offset
- `limit`: 每页用户数量/Number of users per page
### `GET /api/v1/zhihu/web/fetch_user_followers`
**获取知乎用户粉丝列表/Get Zhihu User Followers**
Parameters:
- `user_url_token`*: 用户ID/User ID
- `offset`: 偏移量/Offset
- `limit`: 每页用户数量/Number of users per page
### `GET /api/v1/zhihu/web/fetch_user_follow_columns`
**获取知乎用户订阅的专栏/Get Zhihu User Columns**
Parameters:
- `user_url_token`*: 用户ID/User ID
- `offset`: 偏移量/Offset
- `limit`: 每页专栏数量/Number of columns per page
### `GET /api/v1/zhihu/web/fetch_user_follow_questions`
**获取知乎用户关注的问题/Get Zhihu User Follow Questions**
Parameters:
- `user_url_token`*: 用户ID/User ID
- `offset`: 偏移量/Offset
- `limit`: 每页问题数量/Number of questions per page
### `GET /api/v1/zhihu/web/fetch_user_follow_collections`
**获取知乎用户关注的收藏/Get Zhihu User Follow Collections**
Parameters:
- `user_url_token`*: 用户ID/User ID
- `offset`: 偏移量/Offset
- `limit`: 每页收藏数量/Number of collections per page
### `GET /api/v1/zhihu/web/fetch_user_follow_topics`
**获取知乎用户关注的话题/Get Zhihu User Follow Topics**
Parameters:
- `user_url_token`*: 用户ID/User ID
- `offset`: 偏移量/Offset
- `limit`: 每页话题数量/Number of topics per page
### `GET /api/v1/zhihu/web/fetch_recommend_followees`
**获取知乎推荐关注列表/Get Zhihu Recommend Followees**
### `GET /api/v1/zhihu/web/fetch_question_answers`
**获取知乎问题回答列表/Get Zhihu Question Answers**
Parameters:
- `question_id`*: 问题ID/Question ID
- `cursor`: 分页游标/Pagination cursor
- `limit`: 每页回答数量/Number of answers per page
- `offset`: 偏移量/Offset
- `order`: 排序方式:default=默认排序,updated=按时间排序/Sort order: default=default
- `session_id`: 会话ID/Session ID
## /api/v1/pipixia/app
### `GET /api/v1/pipixia/app/fetch_post_detail`
**获取单个作品数据/Get single video data**
Parameters:
- `cell_id`*: 作品id/Video id
- `cell_type`: 作品类型/Video type
### `GET /api/v1/pipixia/app/fetch_increase_post_view_count`
**增加作品浏览数/Increase post view count**
Parameters:
- `cell_id`*: 作品id/Video id
- `cell_type`: 作品类型/Video type
### `GET /api/v1/pipixia/app/fetch_post_statistics`
**获取作品统计数据/Get post statistics**
Parameters:
- `cell_id`*: 作品id/Video id
### `GET /api/v1/pipixia/app/fetch_user_info`
**获取用户信息/Get user information**
Parameters:
- `user_id`*: 用户id/User id
### `GET /api/v1/pipixia/app/fetch_user_post_list`
**获取用户作品列表/Get user post list**
Parameters:
- `user_id`*: 用户id/User id
- `cursor`: 翻页游标/Page cursor
- `feed_count`: 翻页数量/Page count
### `GET /api/v1/pipixia/app/fetch_user_follower_list`
**获取用户粉丝列表/Get user follower list**
Parameters:
- `user_id`*: 用户id/User id
- `cursor`: 翻页游标/Page cursor
### `GET /api/v1/pipixia/app/fetch_user_following_list`
**获取用户关注列表/Get user following list**
Parameters:
- `user_id`*: 用户id/User id
- `cursor`: 翻页游标/Page cursor
### `GET /api/v1/pipixia/app/fetch_post_comment_list`
**获取作品评论列表/Get post comment list**
Parameters:
- `cell_id`*: 作品id/Video id
- `cell_type`: 作品类型/Video type
- `offset`: 翻页游标/Page cursor
### `GET /api/v1/pipixia/app/fetch_short_url`
**生成短连接/Generate short URL**
Parameters:
- `original_url`*: 原始链接/Original URL
### `GET /api/v1/pipixia/app/fetch_home_feed`
**获取首页推荐/Get home feed**
Parameters:
- `cursor`: 翻页游标/Page cursor
### `GET /api/v1/pipixia/app/fetch_hot_search_words`
**获取热搜词条/Get hot search words**
### `GET /api/v1/pipixia/app/fetch_hot_search_board_list`
**获取热搜榜单列表/Get hot search board list**
### `GET /api/v1/pipixia/app/fetch_hot_search_board_detail`
**获取热搜榜单详情/Get hot search board detail**
Parameters:
- `block_type`*: 榜单类型/Board type
### `GET /api/v1/pipixia/app/fetch_search`
**搜索接口/Search API**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `offset`: 翻页游标/Page cursor
- `search_type`: 搜索类型/Search type
### `GET /api/v1/pipixia/app/fetch_hashtag_detail`
**获取话题详情/Get hashtag detail**
Parameters:
- `hashtag_id`*: 话题id/Hashtag id
### `GET /api/v1/pipixia/app/fetch_hashtag_post_list`
**获取话题作品列表/Get hashtag post list**
Parameters:
- `hashtag_id`*: 话题id/Hashtag id
- `cursor`: 翻页游标/Page cursor
- `feed_count`: 翻页数量/Page count
- `hashtag_request_type`: 话题请求类型/Hashtag request type
- `hashtag_sort_type`: 话题排序类型/Hashtag sort type
### `GET /api/v1/pipixia/app/fetch_home_short_drama_feed`
**获取首页短剧推荐/Get home short drama feed**
Parameters:
- `page`: 页码/Page number
## /api/v1/weibo/web
### `GET /api/v1/weibo/web/fetch_config_list`
**获取频道配置列表/Get channel config list**
### `GET /api/v1/weibo/web/fetch_trend_top`
**获取频道热门趋势/Get channel trend top**
Parameters:
- `containerid`*: 频道容器ID/Channel container ID
- `page`: 页码/Page number
### `GET /api/v1/weibo/web/fetch_channel_feed`
**根据频道名称获取热门内容/Get channel feed by name**
Parameters:
- `channel_name`: 频道名称,不传则使用默认频道/Channel name, use default if not provided
- `page`: 页码/Page number
### `GET /api/v1/weibo/web/fetch_user_info`
**获取用户信息/Get user information**
Parameters:
- `uid`*: 用户ID/User ID
### `GET /api/v1/weibo/web/fetch_user_posts`
**获取用户微博列表/Get user posts**
Parameters:
- `uid`*: 用户ID/User ID
- `page`: 页码/Page number
- `since_id`: 翻页ID,从上一页结果获取/Pagination ID from previous page
### `GET /api/v1/weibo/web/fetch_post_detail`
**获取微博详情/Get post detail**
Parameters:
- `post_id`*: 微博ID/Post ID
### `GET /api/v1/weibo/web/fetch_post_comments`
**获取微博评论/Get post comments**
Parameters:
- `post_id`*: 微博ID/Post ID
- `mid`*: 微博MID/Post MID
- `max_id`: 翻页ID/Pagination ID
- `max_id_type`: 翻页ID类型/Pagination ID type
### `GET /api/v1/weibo/web/fetch_comment_replies`
**获取评论子评论/Get comment replies**
Parameters:
- `cid`*: 根评论ID/Root comment ID
- `max_id`: 翻页ID,默认0为第一页/Pagination ID, default 0 for first page
### `GET /api/v1/weibo/web/fetch_search`
**搜索微博/Search Weibo**
Parameters:
- `keyword`*: 搜索关键词,支持话题搜索如 #话题名#/Search keyword, supports hashtag like #t
- `page`: 页码,从1开始递增(1,2,3...),每页约10-20条/Page number, starts from 1 (1,
- `search_type`: 搜索类型/Search type: 1=综合, 61=实时, 3=用户, 60=热门, 64=视频, 63=图片, 21
- `time_scope`: 时间范围/Time scope: hour=一小时内, day=一天内, week=一周内, month=一个月内, n
### `GET /api/v1/weibo/web/fetch_hot_search`
**获取热搜榜/Get hot search ranking**
### `GET /api/v1/weibo/web/fetch_search_topics`
**获取搜索页热搜词/Get search page hot topics**
## /api/v1/weibo/web_v2
### `GET /api/v1/weibo/web_v2/check_allow_comment_with_pic`
**检查微博是否允许带图评论/Check if Weibo allows image comments**
Parameters:
- `id`*: 微博ID/Weibo ID
### `GET /api/v1/weibo/web_v2/fetch_post_detail`
**获取单个作品数据/Get single post data**
Parameters:
- `id`*: 作品id/Post id
- `is_get_long_text`: 是否获取长微博全文/Whether to get the full text of long Weibo posts (
### `GET /api/v1/weibo/web_v2/fetch_user_info`
**获取用户信息/Get user information**
Parameters:
- `uid`: 用户id/User id
- `custom`: 自定义微博用户名/Custom Weibo username
### `GET /api/v1/weibo/web_v2/fetch_user_basic_info`
**获取用户基本信息/Get user basic information**
Parameters:
- `uid`*: 用户id/User id
### `GET /api/v1/weibo/web_v2/fetch_user_posts`
**获取微博用户文章数据/Get Weibo user posts**
Parameters:
- `uid`*: 用户id/User id
- `page`: 页数/Page number
- `feature`: 特征值,控制返回数据的数量和字段:0=返回10条基础数据,1=返回20条扩展数据,2=返回20条图片相关数据,3=返回2
- `since_id`: 翻页标识,用于获取下一页数据/Pagination identifier for getting next page d
### `GET /api/v1/weibo/web_v2/fetch_user_original_posts`
**获取微博用户原创微博数据/Get Weibo user original posts**
Parameters:
- `uid`*: 用户id/User id
- `page`: 页数/Page number
- `since_id`: 翻页标识,用于获取下一页数据/Pagination identifier for getting next page d
### `GET /api/v1/weibo/web_v2/fetch_post_comments`
**获取微博评论/Get Weibo comments**
Parameters:
- `id`*: 微博ID/Weibo ID
- `count`: 评论数量/Number of comments
- `max_id`: 页码/Page number
### `GET /api/v1/weibo/web_v2/fetch_post_sub_comments`
**获取微博子评论/Get Weibo sub-comments**
Parameters:
- `id`*: 主评论ID/Comment ID
- `count`: 子评论数量/Number of sub-comments
- `max_id`: 分页标识/Page identifier
### `GET /api/v1/weibo/web_v2/search_user_posts`
**搜索用户微博/Search user posts**
Parameters:
- `uid`*: 用户ID/User ID
- `q`*: 搜索关键词/Search keyword
- `page`: 页数/Page number
- `starttime`*: 开始时间戳/Start timestamp
- `endtime`*: 结束时间戳/End timestamp
- `hasori`: 是否包含原创微博,1=包含,0=不包含/Include original posts, 1=include, 0=exc
- `hasret`: 是否包含转发微博,1=包含,0=不包含/Include retweets, 1=include, 0=exclude
- `hastext`: 是否包含文字微博,1=包含,0=不包含/Include text posts, 1=include, 0=exclude
- `haspic`: 是否包含图片微博,1=包含,0=不包含/Include image posts, 1=include, 0=exclud
- `hasvideo`: 是否包含视频微博,1=包含,0=不包含/Include video posts, 1=include, 0=exclud
- `hasmusic`: 是否包含音乐微博,1=包含,0=不包含/Include music posts, 1=include, 0=exclud
### `GET /api/v1/weibo/web_v2/fetch_user_video_collection_list`
**获取用户微博视频收藏夹列表/Get user video collection list**
Parameters:
- `uid`*: 用户ID/User ID
### `GET /api/v1/weibo/web_v2/fetch_user_video_collection_detail`
**获取用户微博视频收藏夹详情/Get user video collection detail**
Parameters:
- `cid`*: 收藏夹ID/Collection ID
- `cursor`: 分页游标/Pagination cursor
- `tab_code`: 排序方式:0=默认,1=最热,2=最新/Sort type: 0=default, 1=hottest, 2=lates
### `GET /api/v1/weibo/web_v2/fetch_user_video_list`
**获取微博用户全部视频/Get user all videos**
Parameters:
- `uid`*: 用户ID/User ID
- `cursor`: 分页游标/Pagination cursor
### `GET /api/v1/weibo/web_v2/fetch_user_following`
**获取用户关注列表/Get user following list**
Parameters:
- `uid`*: 用户ID/User ID
- `page`: 页码/Page number
### `GET /api/v1/weibo/web_v2/fetch_user_fans`
**获取用户粉丝列表/Get user fans list**
Parameters:
- `uid`*: 用户ID/User ID
- `page`: 页码/Page number
### `GET /api/v1/weibo/web_v2/fetch_all_groups`
**获取所有分组信息/Get all groups information**
### `GET /api/v1/weibo/web_v2/fetch_user_recommend_timeline`
**获取微博主页推荐时间轴/Get user recommend timeline**
Parameters:
- `refresh`: 刷新类型,0=正常刷新,1=强制刷新/Refresh type, 0=normal refresh, 1=force r
- `group_id`: 分组ID/Group ID
- `containerid`: 容器ID/Container ID
- `extparam`: 扩展参数/Extended parameters
- `max_id`: 最大ID/Max ID
- `count`: 获取数量/Count
### `GET /api/v1/weibo/web_v2/fetch_hot_ranking_timeline`
**获取微博热门榜单时间轴/Get hot ranking timeline**
Parameters:
- `ranking_type`*: 榜单类型:hour=小时榜,yesterday=昨日榜,day_before=前日榜,week=周榜,male=男榜,f
- `since_id`: 分页标识,默认为0/Pagination identifier, default is 0
- `max_id`: 最大ID,默认为0/Max ID, default is 0
- `count`: 获取数量,默认10/Count, default is 10
### `GET /api/v1/weibo/web_v2/fetch_hot_search_index`
**获取微博热搜词条(10条)/Get Weibo hot search index (10 items)**
### `GET /api/v1/weibo/web_v2/fetch_hot_search_summary`
**获取微博完整热搜榜单(50条)/Get Weibo complete hot search ranking (50 items)**
### `GET /api/v1/weibo/web_v2/fetch_hot_search`
**获取微博热搜榜单/Get Weibo hot search ranking**
### `GET /api/v1/weibo/web_v2/fetch_entertainment_ranking`
**获取微博文娱榜单/Get Weibo entertainment ranking**
### `GET /api/v1/weibo/web_v2/fetch_life_ranking`
**获取微博生活榜单/Get Weibo life ranking**
### `GET /api/v1/weibo/web_v2/fetch_social_ranking`
**获取微博社会榜单/Get Weibo social ranking**
### `GET /api/v1/weibo/web_v2/fetch_similar_search`
**获取微博相似搜索词推荐/Get Weibo similar search recommendations**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
### `GET /api/v1/weibo/web_v2/fetch_ai_search`
**微博智能搜索/Weibo AI Search**
Parameters:
- `query`*: 搜索关键词/Search keyword
### `GET /api/v1/weibo/web_v2/fetch_ai_related_search`
**微博AI搜索内容扩展/Weibo AI Search Content Extension**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
### `GET /api/v1/weibo/web_v2/fetch_advanced_search`
**微博高级搜索/Weibo Advanced Search**
Parameters:
- `q`*: 搜索关键词/Search keyword
- `search_type`: 搜索类型/Search type: all(全部), hot(热门), original(原创), verified(认
- `include_type`: 包含类型/Include type: all(全部), pic(含图片), video(含视频), music(含音乐)
- `timescope`: 时间范围/Time scope (custom:start:end)
- `page`: 页码/Page number
### `GET /api/v1/weibo/web_v2/fetch_city_list`
**地区省市映射/Region City List**
Parameters:
- `normalized`: 是否返回标准化结构(省份列表+城市数组)/Whether to return normalized structure
### `GET /api/v1/weibo/web_v2/fetch_realtime_search`
**实时搜索/Weibo Realtime Search**
Parameters:
- `query`*: 搜索关键词/Search keyword
- `page`: 页码/Page number
### `GET /api/v1/weibo/web_v2/fetch_user_search`
**用户搜索/User search**
Parameters:
- `query`: 搜索关键词/Query(提供则视为“全部”搜索;留空则仅应用高级筛选参数)
- `page`: 页码/Page
- `region`: 地区编码,从 /city_list 获取/Region code from /city_list
- `auth`: 认证类型 org_vip(机构)/per_vip(个人)/ord(普通)/Auth type
- `gender`: 性别 man / women / Gender
- `age`: 年龄段 18y/22y/29y/39y/40y / Age bucket
- `nickname`: 昵称筛选/Nickname filter
- `tag`: 标签筛选/Tag filter
- `school`: 学校筛选/School filter
- `work`: 公司筛选/Company filter
### `GET /api/v1/weibo/web_v2/fetch_video_search`
**视频搜索(热门/全部)/Weibo video search (hot/all)**
Parameters:
- `query`*: 搜索关键词/Search keyword
- `mode`: 搜索模式:hot=热门 / all=全部
- `page`: 页码/Page number
### `GET /api/v1/weibo/web_v2/fetch_pic_search`
**图片搜索/Weibo picture search**
Parameters:
- `query`*: 搜索关键词/Search keyword
- `page`: 页码/Page number
### `GET /api/v1/weibo/web_v2/fetch_topic_search`
**话题搜索/Weibo topic search**
Parameters:
- `query`*: 搜索关键词/Search keyword
- `page`: 页码/Page number
## /api/v1/weibo/app
### `GET /api/v1/weibo/app/fetch_user_info`
**获取用户信息/Get user information**
Parameters:
- `uid`*: 用户ID
### `GET /api/v1/weibo/app/fetch_user_info_detail`
**获取用户详细信息/Get user detail information**
Parameters:
- `uid`*: 用户ID
### `GET /api/v1/weibo/app/fetch_user_timeline`
**获取用户发布的微博/Get user timeline**
Parameters:
- `uid`*: 用户ID
- `page`: 页码
- `filter_type`: 筛选类型
- `month`: 时间筛选(YYYYMMDD格式)
### `GET /api/v1/weibo/app/fetch_user_videos`
**获取用户视频列表/Get user videos**
Parameters:
- `uid`*: 用户ID
- `since_id`: 翻页游标
### `GET /api/v1/weibo/app/fetch_user_super_topics`
**获取用户参与的超话列表/Get user super topics**
Parameters:
- `uid`*: 用户ID
- `page`: 页码
### `GET /api/v1/weibo/app/fetch_user_album`
**获取用户相册/Get user album**
Parameters:
- `uid`*: 用户ID
- `since_id`: 翻页游标
### `GET /api/v1/weibo/app/fetch_user_articles`
**获取用户文章列表/Get user articles**
Parameters:
- `uid`*: 用户ID
- `since_id`: 翻页游标
### `GET /api/v1/weibo/app/fetch_user_audios`
**获取用户音频列表/Get user audios**
Parameters:
- `uid`*: 用户ID
- `since_id`: 翻页游标
### `GET /api/v1/weibo/app/fetch_user_profile_feed`
**获取用户主页动态/Get user profile feed**
Parameters:
- `uid`*: 用户ID
- `since_id`: 翻页游标
### `GET /api/v1/weibo/app/fetch_status_detail`
**获取微博详情/Get post detail**
Parameters:
- `status_id`*: 微博ID
### `GET /api/v1/weibo/app/fetch_status_comments`
**获取微博评论/Get post comments**
Parameters:
- `status_id`*: 微博ID
- `max_id`: 翻页游标
- `sort_type`: 排序类型: 0=按热度排序, 1=按时间排序
### `GET /api/v1/weibo/app/fetch_status_reposts`
**获取微博转发列表/Get post reposts**
Parameters:
- `status_id`*: 微博ID
- `max_id`: 翻页游标
### `GET /api/v1/weibo/app/fetch_status_likes`
**获取微博点赞列表/Get post likes**
Parameters:
- `status_id`*: 微博ID
- `attitude_type`: 点赞类型: 0=全部, 1=点赞, 2=开心, 3=惊讶, 4=伤心, 5=愤怒, 6=打赏, 8=抱抱
### `GET /api/v1/weibo/app/fetch_video_detail`
**获取视频详情/Get video detail**
Parameters:
- `mid`*: 视频微博ID
### `GET /api/v1/weibo/app/fetch_video_featured_feed`
**获取短视频精选Feed流/Get video featured feed**
Parameters:
- `page`: 页码,首页不传,第二页传2
### `GET /api/v1/weibo/app/fetch_search_all`
**综合搜索/Comprehensive search**
Parameters:
- `query`*: 搜索关键词
- `page`: 页码
- `search_type`: 搜索类型: 1=综合, 61=实时, 3=用户, 64=视频, 63=图片, 62=关注, 60=热门, 21=全网,
### `GET /api/v1/weibo/app/fetch_ai_smart_search`
**AI智搜/AI Smart Search**
Parameters:
- `query`*: 搜索关键词
- `page`: 页码
### `GET /api/v1/weibo/app/fetch_home_recommend_feed`
**获取首页推荐Feed流/Get home recommend feed**
Parameters:
- `page`: 页码,首页不传,第二页传2
- `count`: 每页数量
### `GET /api/v1/weibo/app/fetch_hot_search`
**获取热搜榜/Get hot search**
Parameters:
- `category`: 热搜分类: mineband=我的, realtimehot=热搜, social=社会, fun=文娱, techno
- `page`: 页码
- `count`: 每页数量
- `region_name`: 同城热搜城市名称,仅 category=region 时有效,支持: 北京/上海/广州/深圳/杭州/成都/重庆/武汉/南
### `GET /api/v1/weibo/app/fetch_hot_search_categories`
**获取热搜分类列表/Get hot search categories**
## /api/v1/wechat_mp/web
### `GET /api/v1/wechat_mp/web/fetch_mp_article_detail_json`
**获取微信公众号文章详情的JSON/Get Wechat MP Article Detail JSON**
Parameters:
- `url`*: 文章链接/Article URL
### `GET /api/v1/wechat_mp/web/fetch_mp_article_detail_html`
**获取微信公众号文章详情的HTML/Get Wechat MP Article Detail HTML**
Parameters:
- `url`*: 文章链接/Article URL
### `GET /api/v1/wechat_mp/web/fetch_mp_article_list`
**获取微信公众号文章列表/Get Wechat MP Article List**
Parameters:
- `ghid`*: 公众号ID/MP ID
- `offset`: 偏移量/Offset
### `GET /api/v1/wechat_mp/web/fetch_mp_article_read_count`
**获取微信公众号文章阅读量/Get Wechat MP Article Read Count**
Parameters:
- `url`*: 文章链接/Article URL
- `comment_id`*: 评论ID/Comment ID
### `GET /api/v1/wechat_mp/web/fetch_mp_article_url`
**获取微信公众号文章永久链接/Get Wechat MP Article URL**
Parameters:
- `sogou_url`*: 搜狗链接/Sogou URL
### `GET /api/v1/wechat_mp/web/fetch_mp_article_comment_list`
**获取微信公众号文章评论列表/Get Wechat MP Article Comment List**
Parameters:
- `url`*: 文章链接/Article URL
- `comment_id`: 评论ID/Comment ID
- `buffer`: 偏移量/Offset
### `GET /api/v1/wechat_mp/web/fetch_mp_article_comment_reply_list`
**获取微信公众号文章评论回复列表/Get Wechat MP Article Comment Reply List**
Parameters:
- `url`: 文章链接/Article URL
- `comment_id`*: 评论ID/Comment ID
- `content_id`*: 内容ID/Content ID
- `offset`: 偏移量/Offset
### `GET /api/v1/wechat_mp/web/fetch_mp_article_ad`
**获取微信公众号广告/Get Wechat MP Article Ad**
Parameters:
- `url`*: 文章链接/Article URL
### `GET /api/v1/wechat_mp/web/fetch_mp_article_url_conversion`
**获取微信公众号长链接转短链接/Get Wechat MP Long URL to Short URL**
Parameters:
- `url`*: 文章链接/Article URL
### `GET /api/v1/wechat_mp/web/fetch_mp_related_articles`
**获取微信公众号关联文章/Get Wechat MP Related Articles**
Parameters:
- `url`*: 文章链接/Article URL
## /api/v1/wechat_channels/fetch_default_search
### `POST /api/v1/wechat_channels/fetch_default_search`
**微信视频号默认搜索/WeChat Channels Default Search**
## /api/v1/wechat_channels/fetch_search_latest
### `GET /api/v1/wechat_channels/fetch_search_latest`
**微信视频号搜索最新视频/WeChat Channels Search Latest Videos**
Parameters:
- `keywords`*: 搜索关键词/Search keywords
## /api/v1/wechat_channels/fetch_search_ordinary
### `GET /api/v1/wechat_channels/fetch_search_ordinary`
**微信视频号综合搜索/WeChat Channels Comprehensive Search**
Parameters:
- `keywords`*: 搜索关键词/Search keywords
## /api/v1/wechat_channels/fetch_user_search
### `GET /api/v1/wechat_channels/fetch_user_search`
**微信视频号用户搜索/WeChat Channels User Search**
Parameters:
- `keywords`*: 搜索关键词/Search keywords
- `page`: 页码/Page number
## /api/v1/wechat_channels/fetch_video_detail
### `GET /api/v1/wechat_channels/fetch_video_detail`
**微信视频号视频详情/WeChat Channels Video Detail**
Parameters:
- `id`: 视频ID/Video ID
- `exportId`: 导出ID会过期,优先用视频ID,使用时可不传id/Export ID may expire, prefer to use
## /api/v1/wechat_channels/fetch_home_page
### `POST /api/v1/wechat_channels/fetch_home_page`
**微信视频号主页/WeChat Channels Home Page**
## /api/v1/wechat_channels/fetch_comments
### `POST /api/v1/wechat_channels/fetch_comments`
**微信视频号评论/WeChat Channels Comments**
## /api/v1/wechat_channels/fetch_live_history
### `GET /api/v1/wechat_channels/fetch_live_history`
**微信视频号直播回放/WeChat Channels Live History**
Parameters:
- `username`*: 用户名/Username
## /api/v1/wechat_channels/fetch_hot_words
### `GET /api/v1/wechat_channels/fetch_hot_words`
**微信视频号热门话题/WeChat Channels Hot Topics**
## /api/v1/bilibili/web
### `GET /api/v1/bilibili/web/fetch_one_video`
**获取单个视频详情信息/Get single video data**
Parameters:
- `bv_id`*: 作品id/Video id
### `GET /api/v1/bilibili/web/fetch_one_video_v2`
**获取单个视频详情信息V2/Get single video data V2**
Parameters:
- `a_id`*: 作品id/Video id
- `c_id`*: 作品cid/Video cid
### `GET /api/v1/bilibili/web/fetch_one_video_v3`
**获取单个视频详情信息V3/Get single video data V3**
Parameters:
- `url`*: 视频链接/Video URL
### `GET /api/v1/bilibili/web/fetch_video_detail`
**获取单个视频详情/Get single video detail**
Parameters:
- `aid`*: 作品id/Video id
### `GET /api/v1/bilibili/web/fetch_video_play_info`
**获取单个视频播放信息/Get single video play info**
Parameters:
- `url`*: 视频链接/Video URL
### `GET /api/v1/bilibili/web/fetch_video_subtitle`
**获取视频字幕信息/Get video subtitle info**
Parameters:
- `a_id`*: 作品id/Video id
- `c_id`*: 作品cid/Video cid
### `GET /api/v1/bilibili/web/fetch_hot_search`
**获取热门搜索信息/Get hot search data**
Parameters:
- `limit`*: 返回数量/Return number
### `GET /api/v1/bilibili/web/fetch_general_search`
**获取综合搜索信息/Get general search data**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `order`*: 排序方式/Order method
- `page`*: 页码/Page number
- `page_size`*: 每页数量/Number per page
- `duration`: 时长筛选/Duration filter
- `pubtime_begin_s`: 开始日期/Start date (10-digit timestamp)
- `pubtime_end_s`: 结束日期/End date (10-digit timestamp)
### `GET /api/v1/bilibili/web/fetch_video_playurl`
**获取视频流地址/Get video playurl**
Parameters:
- `bv_id`*: 作品id/Video id
- `cid`*: 作品cid/Video cid
### `POST /api/v1/bilibili/web/fetch_vip_video_playurl`
**获取大会员清晰度视频流地址/Get VIP video playurl**
### `GET /api/v1/bilibili/web/fetch_user_post_videos`
**获取用户主页作品数据/Get user homepage video data**
Parameters:
- `uid`*: 用户UID
- `pn`: 页码/Page number
- `order`: 排序方式/Order method
### `GET /api/v1/bilibili/web/fetch_collect_folders`
**获取用户所有收藏夹信息/Get user collection folders**
Parameters:
- `uid`*: 用户UID
### `GET /api/v1/bilibili/web/fetch_user_collection_videos`
**获取指定收藏夹内视频数据/Gets video data from a collection folder**
Parameters:
- `folder_id`*: 收藏夹id/collection folder id
- `pn`: 页码/Page number
### `GET /api/v1/bilibili/web/fetch_user_profile`
**获取指定用户的信息/Get information of specified user**
Parameters:
- `uid`*: 用户UID
### `GET /api/v1/bilibili/web/fetch_user_up_stat`
**获取UP主状态统计/Get UP stat (total likes and views)**
Parameters:
- `uid`*: 用户UID/User UID
### `GET /api/v1/bilibili/web/fetch_user_relation_stat`
**获取用户关系状态统计/Get user relation stat (following and followers)**
Parameters:
- `uid`*: 用户UID/User UID
### `GET /api/v1/bilibili/web/fetch_com_popular`
**获取综合热门视频信息/Get comprehensive popular video information**
Parameters:
- `pn`: 页码/Page number
### `GET /api/v1/bilibili/web/fetch_video_comments`
**获取指定视频的评论/Get comments on the specified video**
Parameters:
- `bv_id`*: 作品id/Video id
- `pn`: 页码/Page number
### `GET /api/v1/bilibili/web/fetch_comment_reply`
**获取视频下指定评论的回复/Get reply to the specified comment**
Parameters:
- `bv_id`*: 作品id/Video id
- `pn`: 页码/Page number
- `rpid`*: 回复id/Reply id
### `GET /api/v1/bilibili/web/fetch_user_dynamic`
**获取指定用户动态/Get dynamic information of specified user**
Parameters:
- `uid`*: 用户UID
- `offset`: 开始索引/offset
### `GET /api/v1/bilibili/web/fetch_dynamic_detail`
**获取动态详情/Get dynamic detail**
Parameters:
- `dynamic_id`*: 动态id/Dynamic id
### `GET /api/v1/bilibili/web/fetch_dynamic_detail_v2`
**获取动态详情v2/Get dynamic detail v2**
Parameters:
- `dynamic_id`*: 动态id/Dynamic id
### `GET /api/v1/bilibili/web/fetch_video_danmaku`
**获取视频实时弹幕/Get Video Danmaku**
Parameters:
- `cid`*: 作品cid/Video cid
### `GET /api/v1/bilibili/web/fetch_live_room_detail`
**获取指定直播间信息/Get information of specified live room**
Parameters:
- `room_id`*: 直播间ID/Live room ID
### `GET /api/v1/bilibili/web/fetch_live_videos`
**获取直播间视频流/Get live video data of specified room**
Parameters:
- `room_id`*: 直播间ID/Live room ID
### `GET /api/v1/bilibili/web/fetch_live_streamers`
**获取指定分区正在直播的主播/Get live streamers of specified live area**
Parameters:
- `area_id`*: 直播分区id/Live area ID
- `pn`: 页码/Page number
### `GET /api/v1/bilibili/web/fetch_all_live_areas`
**获取所有直播分区列表/Get a list of all live areas**
### `GET /api/v1/bilibili/web/bv_to_aid`
**通过bv号获得视频aid号/Generate aid by bvid**
Parameters:
- `bv_id`*: 作品id/Video id
### `GET /api/v1/bilibili/web/fetch_video_parts`
**通过bv号获得视频分p信息/Get Video Parts By bvid**
Parameters:
- `bv_id`*: 作品id/Video id
### `GET /api/v1/bilibili/web/fetch_get_user_id`
**提取用户ID/Extract user ID**
Parameters:
- `share_link`*: 用户分享链接/User share link
## /api/v1/bilibili/app
### `GET /api/v1/bilibili/app/fetch_one_video`
**获取单个视频详情信息/Get single video data**
Parameters:
- `av_id`: AV号/AV ID
- `bv_id`: BV号/BV ID
### `GET /api/v1/bilibili/app/fetch_video_comments`
**获取视频评论列表/Get video comments**
Parameters:
- `av_id`: AV号/AV ID
- `bv_id`: BV号/BV ID
- `mode`: 排序模式/Sort mode (3=热门/hot, 2=时间/time)
- `next_offset`: 分页游标/Pagination cursor
### `GET /api/v1/bilibili/app/fetch_reply_detail`
**获取二级评论回复/Get reply detail**
Parameters:
- `root`*: 一级评论ID/Root comment ID
- `av_id`: AV号/AV ID
- `bv_id`: BV号/BV ID
- `next_offset`: 下一页游标/Next page cursor
- `ps`: 每页数量/Page size
### `GET /api/v1/bilibili/app/fetch_user_videos`
**获取用户投稿视频/Get user videos**
Parameters:
- `user_id`*: 用户ID/User ID
- `post_filter`: 过滤类型/Filter type (archive/season/contribute)
- `page`: 页码/Page number
- `ps`: 每页数量/Page size
### `GET /api/v1/bilibili/app/fetch_user_info`
**获取用户信息/Get user info**
Parameters:
- `user_id`*: 用户ID/User ID
### `GET /api/v1/bilibili/app/fetch_home_feed`
**获取主页推荐视频流/Get home feed**
Parameters:
- `idx`: 页面索引/Page index
- `flush`: 刷新标记/Flush flag (0=普通加载, 1=刷新)
- `pull`: 是否下拉刷新/Pull to refresh
### `GET /api/v1/bilibili/app/fetch_popular_feed`
**获取热门推荐/Get popular feed**
Parameters:
- `idx`: 页面索引/Page index
- `last_param`: 上一页最后一个视频ID/Last video ID
### `GET /api/v1/bilibili/app/fetch_search_all`
**综合搜索/search all**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `page`: 页码/Page number
- `page_size`: 每页数量/Page size
- `order`: 排序方式/Sort order (0=综合排序)
### `GET /api/v1/bilibili/app/fetch_search_by_type`
**分类搜索/ search by type**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `search_type`: 搜索类型/Search type (video/bangumi/pgc/live/article/user)
- `page`: 页码/Page number
- `page_size`: 每页数量/Page size
- `order`: 排序方式/Sort order (0=综合, 1=最新, 2=播放量, 3=弹幕数)
### `GET /api/v1/bilibili/app/fetch_cinema_tab`
**获取影视推荐/Get cinema tab**
### `GET /api/v1/bilibili/app/fetch_bangumi_tab`
**获取番剧推荐/Get bangumi tab**
FILE:references/douyin.md
# Douyin API Reference
Total endpoints: 247
## /api/v1/douyin/web
### `GET /api/v1/douyin/web/fetch_one_video`
**获取单个作品数据/Get single video data**
Parameters:
- `aweme_id`*: 作品id/Video id
- `need_anchor_info`: 是否需要锚点信息/Whether anchor information is needed
### `GET /api/v1/douyin/web/fetch_one_video_v2`
**获取单个作品数据 V2/Get single video data V2**
Parameters:
- `aweme_id`*: 作品id/Video id
### `GET /api/v1/douyin/web/fetch_one_video_by_share_url`
**根据分享链接获取单个作品数据/Get single video data by sharing link**
Parameters:
- `share_url`*: 分享链接/Share link
### `GET /api/v1/douyin/web/fetch_video_high_quality_play_url`
**获取视频的最高画质播放链接/Get the highest quality play URL of the video**
Parameters:
- `aweme_id`: 作品id/Video id
- `share_url`: 可选,分享链接/Optional, share link
### `POST /api/v1/douyin/web/fetch_multi_video_high_quality_play_url`
**批量获取视频的最高画质播放链接/Batch get the highest quality play URL of videos**
### `POST /api/v1/douyin/web/fetch_multi_video`
**批量获取视频信息/Batch Get Video Information**
### `GET /api/v1/douyin/web/fetch_one_video_danmaku`
**获取单个作品视频弹幕数据/Get single video danmaku data**
Parameters:
- `item_id`*: 作品id/Video id
- `duration`*: 视频总时长/Video total duration
- `end_time`*: 结束时间/End time
- `start_time`*: 开始时间/Start time
### `GET /api/v1/douyin/web/fetch_home_feed`
**获取首页推荐数据/Get home feed data**
Parameters:
- `count`: 数量/Number
- `refresh_index`: 翻页索引/Paging index
### `GET /api/v1/douyin/web/fetch_related_posts`
**获取相关作品推荐数据/Get related posts recommendation data**
Parameters:
- `aweme_id`*: 作品id/Video id
- `refresh_index`: 翻页索引/Paging index
- `count`: 数量/Number
### `GET /api/v1/douyin/web/fetch_user_post_videos`
**获取用户主页作品数据/Get user homepage video data**
Parameters:
- `sec_user_id`*: 用户sec_user_id/User sec_user_id
- `max_cursor`: 最大游标/Maximum cursor
- `count`: 每页数量/Number per page
- `filter_type`: 过滤类型/Filter type
- `cookie`: 用户网页版抖音Cookie/Your web version of Douyin Cookie
### `POST /api/v1/douyin/web/fetch_user_like_videos`
**获取用户喜欢作品数据/Get user like video data**
### `POST /api/v1/douyin/web/fetch_user_collection_videos`
**获取用户收藏作品数据/Get user collection video data**
### `POST /api/v1/douyin/web/fetch_user_collects`
**获取用户收藏夹/Get user collection**
### `GET /api/v1/douyin/web/fetch_user_collects_videos`
**获取用户收藏夹数据/Get user collection data**
Parameters:
- `collects_id`*: 收藏夹id/Collection id
- `max_cursor`: 最大游标/Maximum cursor
- `counts`: 每页数量/Number per page
### `GET /api/v1/douyin/web/fetch_user_mix_videos`
**获取用户合辑作品数据/Get user mix video data**
Parameters:
- `mix_id`*: 合辑id/Mix id
- `max_cursor`: 最大游标/Maximum cursor
- `counts`: 每页数量/Number per page
### `GET /api/v1/douyin/web/fetch_user_live_videos`
**获取用户直播流数据/Get user live video data**
Parameters:
- `webcast_id`*: 直播间webcast_id/Room webcast_id
### `GET /api/v1/douyin/web/fetch_user_live_videos_by_sec_uid`
**通过sec_uid获取指定用户的直播流数据/Get live video data of specified user by sec_uid**
Parameters:
- `sec_uid`*: 用户sec_uid/User sec_uid
### `GET /api/v1/douyin/web/fetch_user_live_videos_by_room_id`
**通过room_id获取指定用户的直播流数据 V1/Get live video data of specified user by room_id V1**
Parameters:
- `room_id`*: 直播间room_id/Room room_id
### `GET /api/v1/douyin/web/fetch_user_live_videos_by_room_id_v2`
**通过room_id获取指定用户的直播流数据 V2/Gets the live stream data of the specified user by room_id V2**
Parameters:
- `room_id`*: 直播间room_id/Room room_id
### `GET /api/v1/douyin/web/fetch_live_gift_ranking`
**获取直播间送礼用户排行榜/Get live room gift user ranking**
Parameters:
- `room_id`*: 直播间room_id/Room room_id
- `rank_type`: 排行类型/Leaderboard type
### `GET /api/v1/douyin/web/fetch_live_room_product_result`
**抖音直播间商品信息/Douyin live room product information**
Parameters:
- `room_id`*: 直播间room_id/Room room_id
- `author_id`*: 作者id/Author id
- `offset`: 偏移量/Offset
- `limit`: 数量/Number
### `GET /api/v1/douyin/web/fetch_product_detail`
**获取商品详情/Get product detail**
Parameters:
- `product_id`*: 商品ID/Product ID
- `aweme_id`: 作品ID(可选)/Video ID (optional)
- `room_id`: 直播间ID(可选)/Room ID (optional)
- `sec_user_id`: 用户sec_user_id(可选)/User sec_user_id (optional)
### `GET /api/v1/douyin/web/fetch_product_sku_list`
**获取商品SKU列表/Get product SKU list**
Parameters:
- `product_id`*: 商品ID/Product ID
- `author_id`*: 作者ID/Author ID
### `GET /api/v1/douyin/web/fetch_product_coupon`
**获取商品优惠券信息/Get product coupon information**
Parameters:
- `product_id`*: 商品ID/Product ID
- `shop_id`*: 店铺ID/Shop ID
- `price`*: 价格/Price
- `author_id`*: 作者ID/Author ID
- `sec_user_id`*: 作者ID/Secure Author ID
### `GET /api/v1/douyin/web/fetch_product_review_score`
**获取商品评价评分/Get product review score**
Parameters:
- `product_id`*: 商品ID/Product ID
- `shop_id`*: 店铺ID/Shop ID
### `GET /api/v1/douyin/web/fetch_product_review_list`
**获取商品评价列表/Get product review list**
Parameters:
- `product_id`*: 商品ID/Product ID
- `shop_id`*: 店铺ID/Shop ID
- `cursor`: 游标/Cursor
- `count`: 数量/Count
- `sort_type`: 排序类型 (0: 默认排序, 1: 最新排序)/Sort Type (0: Default, 1: Latest)
### `GET /api/v1/douyin/web/fetch_user_profile_by_uid`
**使用UID获取用户信息/Get user information by UID**
Parameters:
- `uid`*: 用户UID/User UID
### `GET /api/v1/douyin/web/fetch_batch_user_profile_v1`
**获取批量用户信息(最多10个)/Get batch user profile (up to 10)**
Parameters:
- `sec_user_ids`*: 用户sec_user_id列表,用逗号分隔/User sec_user_id list, separated by co
### `GET /api/v1/douyin/web/fetch_batch_user_profile_v2`
**获取批量用户信息(最多50个)/Get batch user profile (up to 50)**
Parameters:
- `sec_user_ids`*: 用户sec_user_id列表,用逗号分隔/User sec_user_id list, separated by co
### `GET /api/v1/douyin/web/fetch_user_live_info_by_uid`
**使用UID获取用户开播信息/Get user live information by UID**
Parameters:
- `uid`*: 用户UID/User UID
### `GET /api/v1/douyin/web/fetch_user_profile_by_short_id`
**使用Short ID获取用户信息/Get user information by Short ID**
Parameters:
- `short_id`*: 用户Short ID/User Short ID
### `GET /api/v1/douyin/web/handler_shorten_url`
**生成短链接**
Parameters:
- `target_url`*: 待转换的短链接/Target URL to be converted
### `GET /api/v1/douyin/web/handler_user_profile`
**使用sec_user_id获取指定用户的信息/Get information of specified user by sec_user_id**
Parameters:
- `sec_user_id`*: 用户sec_user_id/User sec_user_id
### `GET /api/v1/douyin/web/handler_user_profile_v2`
**使用unique_id(抖音号)获取指定用户的信息/Get information of specified user by unique_id**
Parameters:
- `unique_id`*: 用户unique_id/User unique_id
### `GET /api/v1/douyin/web/encrypt_uid_to_sec_user_id`
**加密用户uid到sec_user_id/Encrypt user uid to sec_user_id**
Parameters:
- `uid`*: 用户uid(short_id)/User uid(short_id)
### `GET /api/v1/douyin/web/handler_user_profile_v3`
**根据抖音uid获取指定用户的信息/Get information of specified user by uid**
Parameters:
- `uid`*: 用户uid(short_id)/User uid(short_id)
### `GET /api/v1/douyin/web/handler_user_profile_v4`
**根据sec_user_id获取指定用户的信息(性别,年龄,直播等级、牌子)/Get information of specified user by sec_user_id (gender, age, live level、brand)**
Parameters:
- `sec_user_id`*: 用户sec_user_id/User sec_user_id
### `GET /api/v1/douyin/web/fetch_user_fans_list`
**获取用户粉丝列表/Get user fans list**
Parameters:
- `sec_user_id`: 用户sec_user_id/User sec_user_id
- `max_time`: 最大时间戳/Maximum timestamp
- `count`: 数量/Number
- `source_type`: 来源类型/Source type
### `GET /api/v1/douyin/web/fetch_user_following_list`
**获取用户关注列表/Get user following list**
Parameters:
- `sec_user_id`: 用户sec_user_id/User sec_user_id
- `max_time`: 最大时间戳/Maximum timestamp
- `count`: 数量/Number
- `source_type`: 来源类型/Source type
### `GET /api/v1/douyin/web/fetch_video_comments`
**获取单个视频评论数据/Get single video comments data**
Parameters:
- `aweme_id`*: 作品id/Video id
- `cursor`: 游标/Cursor
- `count`: 数量/Number
### `GET /api/v1/douyin/web/fetch_video_comment_replies`
**获取指定视频的评论回复数据/Get comment replies data of specified video**
Parameters:
- `item_id`*: 作品id/Video id
- `comment_id`*: 评论id/Comment id
- `cursor`: 游标/Cursor
- `count`: 数量/Number
### `GET /api/v1/douyin/web/fetch_general_search_result`
**[已弃用/Deprecated] 获取指定关键词的综合搜索结果/Get comprehensive search results of specified keywords**
Parameters:
- `keyword`*: 关键词/Keyword
- `offset`: 偏移量/Offset
- `count`: 数量/Number
- `sort_type`: 排序类型/Sort type
- `publish_time`: 发布时间/Publish time
- `filter_duration`: 视频时长/Duration filter
- `search_range`: 搜索范围/Search range
- `content_type`: 内容类型/Content type
- `search_id`: 搜索id,翻页时需要提供/Search id, need to provide when paging
### `GET /api/v1/douyin/web/fetch_video_search_result`
**[已弃用/Deprecated] 获取指定关键词的视频搜索结果/Get video search results of specified keywords**
Parameters:
- `keyword`*: 关键词/Keyword
- `offset`: 偏移量/Offset
- `count`: 数量/Number
- `sort_type`: 排序类型/Sort type
- `publish_time`: 发布时间/Publish time
- `filter_duration`: 视频时长/Duration filter
- `search_id`: 搜索id,翻页时需要提供/Search id, need to provide when paging
### `GET /api/v1/douyin/web/fetch_video_search_result_v2`
**获取指定关键词的视频搜索结果 V2 (废弃,替代接口请参考下方文档)/Get video search results of specified keywords V2 (Deprecated, please refer to the following document for replacement interface)**
Parameters:
- `keyword`*: 关键词/Keyword
- `sort_type`: 排序类型/Sort type
- `publish_time`: 发布时间/Publish time
- `filter_duration`: 视频时长/Duration filter
- `page`: 页码/Page
- `search_id`: 搜索id,翻页时需要提供/Search id, need to provide when paging
### `GET /api/v1/douyin/web/fetch_user_search_result`
**获取指定关键词的用户搜索结果(废弃,替代接口请参考下方文档)/Get user search results of specified keywords (deprecated, please refer to the following document for replacement interface)**
Parameters:
- `keyword`*: 关键词/Keyword
- `offset`: 偏移量/Offset
- `count`: 数量/Number
- `douyin_user_fans`: 粉丝数/Fans
- `douyin_user_type`: 用户类型/User type
- `search_id`: 搜索id,翻页时需要提供/Search id, need to provide when paging
### `GET /api/v1/douyin/web/fetch_user_search_result_v2`
**获取指定关键词的用户搜索结果 V2 (已弃用,替代接口请参考下方文档)/Get user search results of specified keywords V2 (deprecated, please refer to the following document for replacement interface)**
Parameters:
- `keyword`*: 关键词/Keyword
- `cursor`: 游标/Cursor
### `GET /api/v1/douyin/web/fetch_user_search_result_v3`
**获取指定关键词的用户搜索结果 V3 (已弃用,替代接口请参考下方文档)/Get user search results of specified keywords V3 (deprecated, please refer to the following document for replacement interface)**
Parameters:
- `keyword`*: 关键词/Keyword
- `cursor`: 游标/Cursor
- `douyin_user_type`: 用户类型/User type
- `douyin_user_fans`: 粉丝数/Fans
### `GET /api/v1/douyin/web/fetch_live_search_result`
**[已弃用/Deprecated] 获取指定关键词的直播搜索结果/Get live search results of specified keywords**
Parameters:
- `keyword`*: 关键词/Keyword
- `offset`: 偏移量/Offset
- `count`: 数量/Number
- `search_id`: 搜索id,翻页时需要提供/Search id, need to provide when paging
### `POST /api/v1/douyin/web/fetch_search_challenge`
**[已弃用/Deprecated] 搜索话题/Search Challenge**
### `POST /api/v1/douyin/web/fetch_challenge_posts`
**话题作品/Challenge Posts**
### `GET /api/v1/douyin/web/fetch_hot_search_result`
**获取抖音热榜数据/Get Douyin hot search results**
### `GET /api/v1/douyin/web/fetch_video_channel_result`
**抖音视频频道数据/Douyin video channel data**
Parameters:
- `tag_id`*: 标签id/Tag id
- `count`: 数量/Number
- `refresh_index`: 刷新索引/Refresh index
### `GET /api/v1/douyin/web/fetch_douyin_web_guest_cookie`
**获取抖音Web的游客Cookie/Get the guest Cookie of Douyin Web**
Parameters:
- `user_agent`*: 用户浏览器代理/User browser agent
### `GET /api/v1/douyin/web/generate_real_msToken`
**生成真实msToken/Generate real msToken**
### `GET /api/v1/douyin/web/generate_ttwid`
**生成ttwid/Generate ttwid**
Parameters:
- `user_agent`:
### `POST /api/v1/douyin/web/fetch_query_user`
**查询抖音用户基本信息/Query Douyin user basic information**
### `GET /api/v1/douyin/web/generate_verify_fp`
**生成verify_fp/Generate verify_fp**
### `GET /api/v1/douyin/web/generate_s_v_web_id`
**生成s_v_web_id/Generate s_v_web_id**
### `GET /api/v1/douyin/web/generate_wss_xb_signature`
**生成弹幕xb签名/Generate barrage xb signature**
Parameters:
- `user_agent`*: 用户浏览器代理/User browser agent
- `room_id`*: 房间号/Room ID
- `user_unique_id`*: 用户唯一ID/User unique ID
### `POST /api/v1/douyin/web/generate_x_bogus`
**使用接口网址生成X-Bogus参数/Generate X-Bogus parameter using API URL**
### `POST /api/v1/douyin/web/generate_a_bogus`
**使用接口网址生成A-Bogus参数/Generate A-Bogus parameter using API URL**
### `GET /api/v1/douyin/web/get_sec_user_id`
**提取单个用户id/Extract single user id**
Parameters:
- `url`*:
### `POST /api/v1/douyin/web/get_all_sec_user_id`
**提取列表用户id/Extract list user id**
### `GET /api/v1/douyin/web/get_aweme_id`
**提取单个作品id/Extract single video id**
Parameters:
- `url`*:
### `POST /api/v1/douyin/web/get_all_aweme_id`
**提取列表作品id/Extract list video id**
### `GET /api/v1/douyin/web/get_webcast_id`
**提取直播间号/Extract webcast id**
Parameters:
- `url`*:
### `POST /api/v1/douyin/web/get_all_webcast_id`
**提取列表直播间号/Extract list webcast id**
### `GET /api/v1/douyin/web/webcast_id_2_room_id`
**直播间号转房间号/Webcast id to room id**
Parameters:
- `webcast_id`*: 直播间号/Webcast id
### `GET /api/v1/douyin/web/douyin_live_room`
**提取直播间弹幕/Extract live room danmaku**
Parameters:
- `live_room_url`*: 直播间链接/Live room link
- `danmaku_type`*: 消息类型/Message type
### `GET /api/v1/douyin/web/fetch_live_im_fetch`
**抖音直播间弹幕参数获取/Douyin live room danmaku parameters**
Parameters:
- `room_id`*: 直播间号/Live room id
- `user_unique_id`*: 用户唯一ID/User unique ID
### `GET /api/v1/douyin/web/fetch_series_aweme`
**短剧作品/Series Video**
Parameters:
- `offset`*: 页码/Page number
- `count`*: 每页数量/Number per page
- `content_type`*: 短剧类型/Subtype
- `cookie`: 用户自行提供的Cookie/User provided Cookie
### `GET /api/v1/douyin/web/fetch_knowledge_aweme`
**知识作品推荐/Knowledge Video**
Parameters:
- `count`*: 每页数量/Number per page
- `refresh_index`: 翻页索引/Paging index
- `cookie`: 用户自行提供的Cookie/User provided Cookie
### `GET /api/v1/douyin/web/fetch_game_aweme`
**游戏作品推荐/Game Video**
Parameters:
- `count`*: 每页数量/Number per page
- `refresh_index`: 翻页索引/Paging index
- `cookie`: 用户自行提供的Cookie/User provided Cookie
### `GET /api/v1/douyin/web/fetch_cartoon_aweme`
**二次元作品推荐/Anime Video**
Parameters:
- `count`*: 每页数量/Number per page
- `refresh_index`: 翻页索引/Paging index
- `cookie`: 用户自行提供的Cookie/User provided Cookie
### `GET /api/v1/douyin/web/fetch_music_aweme`
**音乐作品推荐/Music Video**
Parameters:
- `count`*: 每页数量/Number per page
- `refresh_index`: 翻页索引/Paging index
- `cookie`: 用户自行提供的Cookie/User provided Cookie
### `GET /api/v1/douyin/web/fetch_food_aweme`
**美食作品推荐/Food Video**
Parameters:
- `count`*: 每页数量/Number per page
- `refresh_index`: 翻页索引/Paging index
- `cookie`: 用户自行提供的Cookie/User provided Cookie
## /api/v1/douyin/app
### `GET /api/v1/douyin/app/v3/fetch_one_video`
**获取单个作品数据/Get single video data**
Parameters:
- `aweme_id`*: 作品id/Video id
### `GET /api/v1/douyin/app/v3/fetch_one_video_v2`
**获取单个作品数据 V2/Get single video data V2**
Parameters:
- `aweme_id`*: 作品id/Video id
### `GET /api/v1/douyin/app/v3/fetch_one_video_v3`
**获取单个作品数据 V3 (无版权限制)/Get single video data V3 (No copyright restrictions)**
Parameters:
- `aweme_id`*: 作品或文章ID/Video or Article ID
### `GET /api/v1/douyin/app/v3/fetch_share_info_by_share_code`
**根据分享口令获取分享信息/Get share info by share code**
Parameters:
- `share_code`*: 分享口令/Share code
### `POST /api/v1/douyin/app/v3/fetch_multi_video`
**批量获取视频信息 V1/Batch Get Video Information V1**
### `POST /api/v1/douyin/app/v3/fetch_multi_video_v2`
**批量获取视频信息 V2/Batch Get Video Information V2**
### `GET /api/v1/douyin/app/v3/fetch_one_video_by_share_url`
**根据分享链接获取单个作品数据/Get single video data by sharing link**
Parameters:
- `share_url`*: 分享链接/Share link
### `GET /api/v1/douyin/app/v3/fetch_video_high_quality_play_url`
**获取视频的最高画质播放链接/Get the highest quality play URL of the video**
Parameters:
- `aweme_id`: 作品id/Video id
- `share_url`: 可选,分享链接/Optional, share link
### `POST /api/v1/douyin/app/v3/fetch_multi_video_high_quality_play_url`
**批量获取视频的最高画质播放链接/Batch get the highest quality play URL of videos**
### `GET /api/v1/douyin/app/v3/fetch_video_statistics`
**根据视频ID获取作品的统计数据(点赞数、下载数、播放数、分享数)/Get the statistical data of the Post according to the video ID (like count, download count, play count, share count)**
Parameters:
- `aweme_ids`*: 作品id/Video id
### `GET /api/v1/douyin/app/v3/fetch_multi_video_statistics`
**根据视频ID批量获取作品的统计数据(点赞数、下载数、播放数、分享数)/Get the statistical data of the Post according to the video ID (like count, download count, play count, share count)**
Parameters:
- `aweme_ids`*: 作品id/Video id
### `GET /api/v1/douyin/app/v3/add_video_play_count`
**根据视频ID来增加作品的播放数/Increase the number of plays of the work according to the video ID**
Parameters:
- `aweme_type`*: 作品类型/Video type
- `item_id`*: 作品id/Video id
- `cookie`: 可选,默认使用游客Cookie/Optional, use guest Cookie by default
### `GET /api/v1/douyin/app/v3/handler_user_profile`
**获取指定用户的信息/Get information of specified user**
Parameters:
- `sec_user_id`*: 用户sec_user_id/User sec_user_id
### `GET /api/v1/douyin/app/v3/fetch_user_fans_list`
**获取用户粉丝列表/Get user fans list**
Parameters:
- `sec_user_id`: 用户sec_user_id/User sec_user_id
- `max_time`: 最大时间戳/Maximum timestamp
- `count`: 数量/Number
### `GET /api/v1/douyin/app/v3/fetch_user_following_list`
**获取用户关注列表 (弃用,使用 /api/v1/douyin/web/fetch_user_following_list 替代)/Get user following list (Deprecated, use /api/v1/douyin/web/fetch_user_following_list instead)**
Parameters:
- `sec_user_id`: 用户sec_user_id/User sec_user_id
- `max_time`: 最大时间戳/Maximum timestamp
- `count`: 数量/Number
### `GET /api/v1/douyin/app/v3/fetch_user_post_videos`
**获取用户主页作品数据/Get user homepage video data**
Parameters:
- `sec_user_id`*: 用户sec_user_id/User sec_user_id
- `max_cursor`: 最大游标/Maximum cursor
- `count`: 每页数量/Number per page
- `sort_type`: 排序类型/Sort type
### `GET /api/v1/douyin/app/v3/fetch_user_like_videos`
**获取用户喜欢作品数据/Get user like video data**
Parameters:
- `sec_user_id`*: 用户sec_user_id/User sec_user_id
- `max_cursor`: 最大游标/Maximum cursor
- `counts`: 每页数量/Number per page
### `GET /api/v1/douyin/app/v3/fetch_video_comments`
**获取单个视频评论数据/Get single video comments data**
Parameters:
- `aweme_id`*: 作品id/Video id
- `cursor`: 游标/Cursor
- `count`: 数量/Number
### `GET /api/v1/douyin/app/v3/fetch_video_comment_replies`
**获取指定视频的评论回复数据/Get comment replies data of specified video**
Parameters:
- `item_id`*: 作品id/Video id
- `comment_id`*: 评论id/Comment id
- `cursor`: 游标/Cursor
- `count`: 数量/Number
### `GET /api/v1/douyin/app/v3/fetch_video_mix_detail`
**获取抖音视频合集详情数据/Get Douyin video mix detail data**
Parameters:
- `mix_id`*: 合集id/Mix id
### `GET /api/v1/douyin/app/v3/fetch_video_mix_post_list`
**获取抖音视频合集作品列表数据/Get Douyin video mix post list data**
Parameters:
- `mix_id`*: 合集id/Mix id
- `cursor`: 游标/Cursor
- `count`: 数量/Number
### `GET /api/v1/douyin/app/v3/fetch_user_series_list`
**获取用户短剧合集列表/Get user series list**
Parameters:
- `user_id`: 用户id/User id
- `sec_user_id`: 用户加密id/User sec id
- `cursor`: 游标/Cursor
### `GET /api/v1/douyin/app/v3/fetch_series_video_list`
**获取短剧视频列表/Get series video list**
Parameters:
- `series_id`*: 短剧id/Series id
- `cursor`: 游标/Cursor
### `GET /api/v1/douyin/app/v3/fetch_series_detail`
**获取短剧详情信息/Get series detail**
Parameters:
- `series_id`*: 短剧id/Series id
### `GET /api/v1/douyin/app/v3/fetch_general_search_result`
**获取指定关键词的综合搜索结果(弃用,替代接口见下方文档说明)/Get comprehensive search results of specified keywords (deprecated, see the documentation below for alternative interfaces)**
Parameters:
- `keyword`*: 关键词/Keyword
- `offset`: 偏移量/Offset
- `count`: 数量/Number
- `sort_type`: 排序类型/Sort type
- `publish_time`: 发布时间/Publish time
- `filter_duration`: 时长/Duration
- `content_type`: 内容类型/Content type
### `GET /api/v1/douyin/app/v3/fetch_video_search_result`
**获取指定关键词的视频搜索结果(弃用,替代接口见下方文档说明)/Get video search results of specified keywords (deprecated, see the documentation below for alternative interfaces)**
Parameters:
- `keyword`*: 关键词/Keyword
- `offset`: 偏移量/Offset
- `count`: 数量/Number
- `sort_type`: 排序类型/Sort type
- `publish_time`: 发布时间/Publish time
- `filter_duration`: 时长/Duration
### `GET /api/v1/douyin/app/v3/fetch_video_search_result_v2`
**获取指定关键词的视频搜索结果 V2 (弃用,替代接口见下方文档说明)/Get video search results of specified keywords V2 (deprecated, see the documentation below for alternative interfaces)**
Parameters:
- `keyword`*: 关键词/Keyword
- `sort_type`: 排序类型/Sort type
- `publish_time`: 发布时间/Publish time
- `filter_duration`: 视频时长/Duration filter
- `page`: 页码/Page
- `search_id`: 搜索id,翻页时需要提供/Search id, need to provide when paging
### `GET /api/v1/douyin/app/v3/fetch_user_search_result`
**获取指定关键词的用户搜索结果(弃用,替代接口见下方文档说明)/Get user search results of specified keywords (deprecated, see the documentation below for alternative interfaces)**
Parameters:
- `keyword`*: 关键词/Keyword
- `offset`: 偏移量/Offset
- `count`: 数量/Number
- `douyin_user_fans`: 粉丝数/Fans
- `douyin_user_type`: 用户类型/User type
### `GET /api/v1/douyin/app/v3/fetch_live_search_result`
**获取指定关键词的直播搜索结果(弃用,替代接口见下方文档说明)/Get live search results of specified keywords (deprecated, see the documentation below for alternative interfaces)**
Parameters:
- `keyword`*: 关键词/Keyword
- `cursor`: 偏移量/Offset
- `count`: 数量/Number
### `GET /api/v1/douyin/app/v3/fetch_music_search_result`
**获取指定关键词的音乐搜索结果(弃用,替代接口见下方文档说明)/Get music search results of specified keywords (deprecated, see the documentation below for alternative interfaces)**
Parameters:
- `keyword`*: 关键词/Keyword
- `offset`: 偏移量/Offset
- `count`: 数量/Number
### `GET /api/v1/douyin/app/v3/fetch_hashtag_search_result`
**获取指定关键词的话题搜索结果(弃用,替代接口见下方文档说明)/Get hashtag search results of specified keywords (deprecated, see the documentation below for alternative interfaces)**
Parameters:
- `keyword`*: 关键词/Keyword
- `offset`: 偏移量/Offset
- `count`: 数量/Number
### `GET /api/v1/douyin/app/v3/fetch_music_detail`
**获取指定音乐的详情数据/Get details of specified music**
Parameters:
- `music_id`*: 音乐id/Music id
### `GET /api/v1/douyin/app/v3/fetch_music_video_list`
**获取指定音乐的视频列表数据/Get video list of specified music**
Parameters:
- `music_id`*: 音乐id/Music id
- `cursor`: 游标/Cursor
- `count`: 数量/Number
### `GET /api/v1/douyin/app/v3/fetch_hashtag_detail`
**获取指定话题的详情数据/Get details of specified hashtag**
Parameters:
- `ch_id`*: 话题id/Hashtag id
### `GET /api/v1/douyin/app/v3/fetch_hashtag_video_list`
**获取指定话题的作品数据/Get video list of specified hashtag**
Parameters:
- `ch_id`*: 话题id/Hashtag id
- `cursor`: 游标/Cursor
- `sort_type`: 排序类型/Sort type
- `count`: 数量/Number
### `GET /api/v1/douyin/app/v3/fetch_hot_search_list`
**获取抖音热搜榜数据/Get Douyin hot search list data**
Parameters:
- `board_type`: 榜单类型/Board type
- `board_sub_type`: 榜单子类型/Board sub type
### `GET /api/v1/douyin/app/v3/fetch_live_hot_search_list`
**获取抖音直播热搜榜数据/Get Douyin live hot search list data**
### `GET /api/v1/douyin/app/v3/fetch_music_hot_search_list`
**获取抖音音乐榜数据/Get Douyin music hot search list data**
Parameters:
- `chart_type`: 榜单类型/Chart type
- `cursor`: 游标/Cursor
### `GET /api/v1/douyin/app/v3/fetch_brand_hot_search_list`
**获取抖音品牌热榜分类数据/Get Douyin brand hot search list data**
### `GET /api/v1/douyin/app/v3/fetch_brand_hot_search_list_detail`
**获取抖音品牌热榜具体分类数据/Get Douyin brand hot search list detail data**
Parameters:
- `category_id`*: 分类id/Category id
### `GET /api/v1/douyin/app/v3/generate_douyin_short_url`
**生成抖音短链接/Generate Douyin short link**
Parameters:
- `url`*: 抖音链接/Douyin link
### `GET /api/v1/douyin/app/v3/generate_douyin_video_share_qrcode`
**生成抖音视频分享二维码/Generate Douyin video share QR code**
Parameters:
- `object_id`*: 作品id/Video id
### `GET /api/v1/douyin/app/v3/register_device`
**抖音APP注册设备/Douyin APP register device**
Parameters:
- `proxy`: 代理/Proxy
### `GET /api/v1/douyin/app/v3/open_douyin_app_to_video_detail`
**生成抖音分享链接,唤起抖音APP,跳转指定作品详情页/Generate Douyin share link, call Douyin APP, and jump to the specified video details page**
Parameters:
- `aweme_id`*: 作品id/Video id
### `GET /api/v1/douyin/app/v3/open_douyin_app_to_user_profile`
**生成抖音分享链接,唤起抖音APP,跳转指定用户主页/Generate Douyin share link, call Douyin APP, and jump to the specified user profile**
Parameters:
- `uid`*: 用户id/User id
- `sec_uid`*: 用户sec_uid/User sec_uid
### `GET /api/v1/douyin/app/v3/open_douyin_app_to_keyword_search`
**生成抖音分享链接,唤起抖音APP,跳转指定关键词搜索结果/Generate Douyin share link, call Douyin APP, and jump to the specified keyword search result**
Parameters:
- `keyword`*: 关键词/Keyword
### `GET /api/v1/douyin/app/v3/open_douyin_app_to_send_private_message`
**生成抖音分享链接,唤起抖音APP,给指定用户发送私信/Generate Douyin share link, call Douyin APP, and send private messages to specified users**
Parameters:
- `uid`*: 用户id/User id
- `sec_uid`*: 用户sec_uid/User sec_uid
## /api/v1/douyin/creator
### `GET /api/v1/douyin/creator/fetch_creator_activity_list`
**获取创作者活动列表/Get creator activity list**
Parameters:
- `start_time`*: 开始时间戳/Start timestamp
- `end_time`*: 结束时间戳/End timestamp
### `GET /api/v1/douyin/creator/fetch_creator_activity_detail`
**获取创作者活动详情/Get creator activity detail**
Parameters:
- `activity_id`*: 活动ID/Activity ID
### `GET /api/v1/douyin/creator/fetch_creator_material_center_config`
**获取创作者中心配置/Get creator material center config**
### `GET /api/v1/douyin/creator/fetch_creator_material_center_billboard`
**获取创作者中心热门视频榜单/Get creator material center billboard**
Parameters:
- `billboard_tag`: 榜单标签,0=全部,其他值请通过config接口获取/Billboard tag, 0=all, other value
- `order_key`: 排序键: 1=播放最高, 2=点赞最多, 3=评论最多, 4=热度最高/Order key: 1=highest vie
- `time_filter`: 时间筛选: 1=24小时, 2=7天, 3=30天/Time filter: 1=24 hours, 2=7 days,
### `GET /api/v1/douyin/creator/fetch_creator_hot_spot_billboard`
**获取创作者中心创作热点/Get creator hot spot billboard**
Parameters:
- `billboard_tag`: 热点标签,多个标签用逗号分隔,如'1004,1000,1002'/Hot spot tag - multiple tag
- `hot_search_type`: 热搜类型: 1=热点总榜, 2=同城热点榜, 3=热点上升榜/Hot search type: 1=Overall ra
- `city_code`: 城市代码,当hot_search_type=2时必需/City code - required when hot_sea
### `GET /api/v1/douyin/creator/fetch_creator_hot_topic_billboard`
**获取创作者热门话题榜单/Get creator hot topic billboard**
Parameters:
- `billboard_tag`: 榜单标签,0=全部,其他值请通过config接口获取/Billboard tag, 0=all, other value
- `order_key`: 排序键: 1=播放最高, 2=点赞最多, 3=评论最多, 4=投稿最多/Order key: 1=highest vie
- `time_filter`: 时间筛选: 1=24小时, 2=7天, 3=30天/Time filter: 1=24 hours, 2=7 days,
### `GET /api/v1/douyin/creator/fetch_creator_hot_props_billboard`
**获取创作者热门道具榜单/Get creator hot props billboard**
Parameters:
- `billboard_tag`: 榜单标签,0=全部,其他值请通过config接口获取/Billboard tag, 0=all, other value
- `order_key`: 排序键: 1=播放最高, 5=投稿最多, 6=展现最高, 7=收藏最高/Order key: 1=highest vie
- `time_filter`: 时间筛选: 1=24小时, 2=7天, 3=30天/Time filter: 1=24 hours, 2=7 days,
### `GET /api/v1/douyin/creator/fetch_creator_hot_challenge_billboard`
**获取创作者热门挑战榜单/Get creator hot challenge billboard**
### `GET /api/v1/douyin/creator/fetch_creator_hot_music_billboard`
**获取创作者热门音乐榜单/Get creator hot music billboard**
Parameters:
- `billboard_tag`: 榜单标签/Billboard tag (0=全部,具体分类值可通过配置接口获取)
- `order_key`: 排序键/Order key (1=播放最高, 2=点赞最多, 4=热度最高, 5=投稿最多)
- `time_filter`: 时间筛选/Time filter (1=24小时, 2=7天, 3=30天)
### `GET /api/v1/douyin/creator/fetch_creator_hot_course`
**获取创作者热门课程/Get creator hot course**
Parameters:
- `order`: 排序方式/Order type (1=推荐排序, 2=最受欢迎, 3=最新上传)
- `limit`: 每页数量/Items per page (建议24)
- `offset`: 偏移量/Offset
- `category_id`: 精选专题分类ID/Selected topic category ID - 不传则为热门课程,传入则为精选专题
### `GET /api/v1/douyin/creator/fetch_creator_content_category`
**获取创作者内容创作合集分类/Get creator content creation category**
### `GET /api/v1/douyin/creator/fetch_creator_content_course`
**获取创作者内容创作课程/Get creator content creation course**
Parameters:
- `category_id`*: 分类ID/Category ID
- `order`: 排序方式/Order type (1=推荐排序, 2=最受欢迎, 3=最新上传)
- `limit`: 每页数量/Items per page
- `offset`: 偏移量/Offset (starting position)
### `GET /api/v1/douyin/creator/fetch_video_danmaku_list`
**获取作品弹幕列表/Get video danmaku list**
Parameters:
- `item_id`*: 作品ID/Video item ID
- `count`: 每页数量/Items per page
- `offset`: 偏移量/Offset (starting position)
- `order_type`: 排序类型/Order type (1=时间排序, 2=其他排序)
- `is_blocked`: 是否被屏蔽/Is blocked
### `GET /api/v1/douyin/creator/fetch_user_search`
**搜索用户/Search users**
Parameters:
- `user_name`*: 用户名/Username (支持抖音号和抖音昵称)
### `GET /api/v1/douyin/creator/fetch_mission_task_list`
**获取商单任务列表/Get mission task list**
Parameters:
- `cursor`: 游标/Cursor (分页)
- `limit`: 每页数量/Items per page
- `mission_type`: 任务类型/Mission type
- `tab_scene`: 场景类型/Scene type (1=可投稿, 2=可报名, 3=好物测评)
- `industry_lv1`: 一级行业/Primary industry (-1=全部)
- `industry_lv2`: 二级行业/Secondary industry (-1=全部)
- `platform_channel`: 平台渠道/Platform channel (1=抖音视频, 2=抖音直播, 3=抖音图文)
- `pay_type`: 付费类型/Pay type (1=视频等级, 2=自定义, 3=按转化付费, 4=按有效播放量, 5=按销售量, 9=按
- `greater_than_cost_progress`: 成本进度/Cost progress (20=高于20%, 50=高于50%, 80=高于80%)
- `publish_time_start`: 发布开始时间/Publish start time (时间戳)
- `quick_selector_scene`: 快速选择场景/Quick selector (1=高收益, 4=保底收入, 5=合作过)
- `keyword`: 关键词/Keyword (任务名称或ID)
### `GET /api/v1/douyin/creator/fetch_industry_category_config`
**获取行业分类配置/Get industry category config**
## /api/v1/douyin/creator_v2
### `POST /api/v1/douyin/creator_v2/fetch_item_overview_data`
**获取作品总览数据/Fetch item overview data**
### `POST /api/v1/douyin/creator_v2/fetch_item_play_source`
**获取作品流量来源统计/Fetch item play source statistics**
### `POST /api/v1/douyin/creator_v2/fetch_item_search_keyword`
**获取作品搜索关键词统计/Fetch item search keywords statistics**
### `POST /api/v1/douyin/creator_v2/fetch_item_watch_trend`
**获取作品观看趋势分析/Fetch item watch trend analysis**
### `POST /api/v1/douyin/creator_v2/fetch_item_danmaku_analysis`
**获取作品弹幕分析/Fetch item bullet analysis**
### `POST /api/v1/douyin/creator_v2/fetch_item_audience_portrait`
**获取作品观众数据分析/Fetch item audience portrait**
### `POST /api/v1/douyin/creator_v2/fetch_item_audience_others`
**获取作品观众其他数据分析/Fetch item audience others analysis**
### `POST /api/v1/douyin/creator_v2/fetch_item_analysis_involved_vertical`
**获取作品垂类标签/Fetch item analysis involved vertical**
### `POST /api/v1/douyin/creator_v2/fetch_item_analysis_overview`
**获取投稿分析概览/Fetch item analysis overview**
### `POST /api/v1/douyin/creator_v2/fetch_item_analysis_item_performance`
**获取投稿表现数据/Fetch item analysis item performance**
### `POST /api/v1/douyin/creator_v2/fetch_item_list`
**获取投稿作品列表/Fetch item list**
### `POST /api/v1/douyin/creator_v2/fetch_item_list_download`
**导出投稿作品列表/Download item list**
### `POST /api/v1/douyin/creator_v2/fetch_live_room_history_list`
**获取直播场次历史记录/Fetch live room history list**
### `POST /api/v1/douyin/creator_v2/fetch_author_diagnosis`
**获取创作者账号诊断/Fetch author diagnosis**
## /api/v1/douyin/search
### `POST /api/v1/douyin/search/fetch_general_search_v1`
**获取综合搜索 V1/Fetch general search V1**
### `POST /api/v1/douyin/search/fetch_general_search_v2`
**获取综合搜索 V2/Fetch general search V2**
### `POST /api/v1/douyin/search/fetch_general_search_v3`
**获取综合搜索 V3/Fetch general search V3**
### `POST /api/v1/douyin/search/fetch_search_suggest`
**获取搜索关键词推荐/Fetch search keyword suggestions**
### `POST /api/v1/douyin/search/fetch_video_search_v1`
**获取视频搜索 V1/Fetch video search V1**
### `POST /api/v1/douyin/search/fetch_video_search_v2`
**获取视频搜索 V2/Fetch video search V2**
### `POST /api/v1/douyin/search/fetch_multi_search`
**获取多重搜索/Fetch multi-type search**
### `POST /api/v1/douyin/search/fetch_user_search`
**获取用户搜索/Fetch user search**
### `POST /api/v1/douyin/search/fetch_user_search_v2`
**获取用户搜索 V2/Fetch user search V2**
### `POST /api/v1/douyin/search/fetch_image_search`
**获取图片搜索/Fetch image search**
### `POST /api/v1/douyin/search/fetch_image_search_v3`
**获取图文搜索 V3/Fetch image-text search V3**
### `POST /api/v1/douyin/search/fetch_live_search_v1`
**获取直播搜索 V1/Fetch live search V1**
### `POST /api/v1/douyin/search/fetch_challenge_search_v1`
**获取话题搜索 V1/Fetch hashtag search V1**
### `POST /api/v1/douyin/search/fetch_challenge_search_v2`
**获取话题搜索 V2/Fetch hashtag search V2**
### `POST /api/v1/douyin/search/fetch_challenge_suggest`
**获取话题推荐搜索/Fetch hashtag suggestions**
### `POST /api/v1/douyin/search/fetch_experience_search`
**获取经验搜索/Fetch experience search**
### `POST /api/v1/douyin/search/fetch_music_search`
**获取音乐搜索/Fetch music search**
### `POST /api/v1/douyin/search/fetch_discuss_search`
**获取讨论搜索/Fetch discussion search**
### `POST /api/v1/douyin/search/fetch_school_search`
**获取学校搜索/Fetch school search**
### `POST /api/v1/douyin/search/fetch_vision_search`
**获取图像识别搜索/Fetch vision search (image-based search)**
## /api/v1/douyin/billboard
### `GET /api/v1/douyin/billboard/fetch_city_list`
**获取中国城市列表/Fetch Chinese city list**
### `GET /api/v1/douyin/billboard/fetch_content_tag`
**获取垂类内容标签/Fetch vertical content tags**
### `GET /api/v1/douyin/billboard/fetch_hot_category_list`
**获取热点榜分类/Fetch hot list category**
Parameters:
- `billboard_type`*: 榜单类型
- `snapshot_time`: 快照时间 格式yyyyMMddHHmmss
- `start_date`: 快照开始时间 格式yyyyMMdd
- `end_date`: 快照结束时间 格式yyyyMMdd
- `keyword`: 热点搜索词
### `GET /api/v1/douyin/billboard/fetch_hot_rise_list`
**获取上升热点榜/Fetch rising hot list**
Parameters:
- `page`*: 页码
- `page_size`*: 每页数量
- `order`*: 排序方式
- `sentence_tag`: 热点分类标签,从热点榜分类获取,多个分类用逗号分隔,空为全部
- `keyword`: 热点搜索词
### `GET /api/v1/douyin/billboard/fetch_hot_city_list`
**获取同城热点榜/Fetch city hot list**
Parameters:
- `page`*: 页码
- `page_size`*: 每页数量
- `order`*: 排序方式
- `city_code`: 城市编码,从城市列表获取,空为全部
- `sentence_tag`: 热点分类标签,从热点榜分类获取,多个分类用逗号分隔,空为全部
- `keyword`: 热点搜索词
### `GET /api/v1/douyin/billboard/fetch_hot_challenge_list`
**获取挑战热榜/Fetch hot challenge list**
Parameters:
- `page`*: 页码
- `page_size`*: 每页数量
- `keyword`: 热点搜索词
### `GET /api/v1/douyin/billboard/fetch_hot_total_list`
**获取热点总榜/Fetch total hot list**
Parameters:
- `page`*: 页码
- `page_size`*: 每页数量
- `type`*: 快照类型 snapshot 按时刻查看 range 按时间范围
- `snapshot_time`: 快照时间 格式yyyyMMddHHmmss
- `start_date`: 快照开始时间 格式yyyyMMdd
- `end_date`: 快照结束时间 格式yyyyMMdd
- `sentence_tag`: 热点分类标签,从热点榜分类获取,多个分类用逗号分隔,空为全部
- `keyword`: 热点搜索词
### `POST /api/v1/douyin/billboard/fetch_hot_calendar_list`
**获取活动日历/Fetch activity calendar**
### `GET /api/v1/douyin/billboard/fetch_hot_calendar_detail`
**获取活动日历详情/Fetch activity calendar detail**
Parameters:
- `calendar_id`*: 活动id
### `GET /api/v1/douyin/billboard/fetch_hot_user_portrait_list`
**获取作品点赞观众画像-仅限热门榜/Fetch work like audience portrait - hot list only**
Parameters:
- `aweme_id`*: 作品id
- `option`: 选项,1 手机价格分布 2 性别分布 3 年龄分布 4 地域分布-省份 5 地域分布-城市 6 城市等级 7 手机品牌分
### `GET /api/v1/douyin/billboard/fetch_hot_comment_word_list`
**获取作品评论分析-词云权重/Fetch work comment analysis word cloud weight**
Parameters:
- `aweme_id`*: 作品id
### `GET /api/v1/douyin/billboard/fetch_hot_item_trends_list`
**获取作品数据趋势/Fetch post data trend**
Parameters:
- `aweme_id`: 作品id
- `option`: 选项,7 点赞量 8 分享量 9 评论量
- `date_window`: 时间窗口,1 按小时 2 按天
### `POST /api/v1/douyin/billboard/fetch_hot_account_list`
**获取热门账号/Fetch hot account list**
### `GET /api/v1/douyin/billboard/fetch_hot_account_search_list`
**搜索用户名或抖音号/Fetch account search list**
Parameters:
- `keyword`*: 搜索的用户名或抖音号
- `cursor`*: 游标,默认空
### `GET /api/v1/douyin/billboard/fetch_hot_account_trends_list`
**获取账号粉丝数据趋势/Fetch account fan data trend**
Parameters:
- `sec_uid`*: 用户sec_id
- `option`: 选项,2 新增点赞量 3 新增作品量 4 新增评论量 5 新增分享量
- `date_window`: 时间窗口,1 按小时 2 按天
### `GET /api/v1/douyin/billboard/fetch_hot_account_item_analysis_list`
**获取账号作品分析-上周/Fetch account work analysis - last week**
Parameters:
- `sec_uid`*: 用户sec_id
### `GET /api/v1/douyin/billboard/fetch_hot_account_fans_portrait_list`
**获取粉丝画像/Fetch fan portrait**
Parameters:
- `sec_uid`*: 用户sec_id
- `option`: 选项,1 手机价格分布 2 性别分布 3 年龄分布 4 地域分布-省份 5 地域分布-城市 6 城市等级 7 手机品牌分
### `GET /api/v1/douyin/billboard/fetch_hot_account_fans_interest_account_list`
**获取粉丝兴趣作者 20个用户/Fetch fan interest author 20 users**
Parameters:
- `sec_uid`*: 用户sec_id
### `GET /api/v1/douyin/billboard/fetch_hot_account_fans_interest_topic_list`
**获取粉丝近3天感兴趣的话题 10个话题/Fetch fan interest topic in the last 3 days 10 topics**
Parameters:
- `sec_uid`*: 用户sec_id
### `GET /api/v1/douyin/billboard/fetch_hot_account_fans_interest_search_list`
**获取粉丝近3天搜索词 10个搜索词/Fetch fan interest search term in the last 3 days 10 search terms**
Parameters:
- `sec_uid`*: 用户sec_id
### `POST /api/v1/douyin/billboard/fetch_hot_total_video_list`
**获取视频热榜/Fetch video hot list**
### `POST /api/v1/douyin/billboard/fetch_hot_total_low_fan_list`
**获取低粉爆款榜/Fetch low fan explosion list**
### `POST /api/v1/douyin/billboard/fetch_hot_total_high_play_list`
**获取高完播率榜/Fetch high completion rate list**
### `POST /api/v1/douyin/billboard/fetch_hot_total_high_like_list`
**获取高点赞率榜/Fetch high like rate list**
### `POST /api/v1/douyin/billboard/fetch_hot_total_high_fan_list`
**获取高涨粉率榜/Fetch high fan rate list**
### `POST /api/v1/douyin/billboard/fetch_hot_total_topic_list`
**获取话题热榜/Fetch topic hot list**
### `POST /api/v1/douyin/billboard/fetch_hot_total_high_topic_list`
**获取热度飙升的话题榜/Fetch topic list with rising popularity**
### `POST /api/v1/douyin/billboard/fetch_hot_total_search_list`
**获取搜索热榜/Fetch search hot list**
### `POST /api/v1/douyin/billboard/fetch_hot_total_high_search_list`
**获取热度飙升的搜索榜/Fetch search list with rising popularity**
### `POST /api/v1/douyin/billboard/fetch_hot_total_hot_word_list`
**获取全部热门内容词/Fetch all hot content words**
### `GET /api/v1/douyin/billboard/fetch_hot_total_hot_word_detail_list`
**获取内容词详情/Fetch content word details**
Parameters:
- `keyword`*: 搜索关键字
- `word_id`*: 内容词id
- `query_day`*: 查询日期,格式为YYYYMMDD,需为当日
## /api/v1/douyin/xingtu
### `GET /api/v1/douyin/xingtu/get_sign_image`
**获取加密图片解析/Get Sign Image**
Parameters:
- `uri`*: 图片的uri/Image URI
- `durationTS`: 有效期时长(秒)/Duration in seconds
- `format`: 图片格式/Image format
### `GET /api/v1/douyin/xingtu/get_xingtu_kolid_by_uid`
**根据抖音用户ID获取游客星图kolid/Get XingTu kolid by Douyin User ID**
Parameters:
- `uid`*: 抖音用户ID/Douyin User ID
### `GET /api/v1/douyin/xingtu/get_xingtu_kolid_by_sec_user_id`
**根据抖音sec_user_id获取游客星图kolid/Get XingTu kolid by Douyin sec_user_id**
Parameters:
- `sec_user_id`*: 抖音用户sec_user_id/Douyin User sec_user_id
### `GET /api/v1/douyin/xingtu/get_xingtu_kolid_by_unique_id`
**根据抖音号获取游客星图kolid/Get XingTu kolid by Douyin unique_id**
Parameters:
- `unique_id`*: 抖音号/Douyin User unique_id
### `GET /api/v1/douyin/xingtu/kol_base_info_v1`
**获取kol基本信息V1/Get kol Base Info V1**
Parameters:
- `kolId`*: 用户的kolId/User kolId
- `platformChannel`*: 平台渠道/Platform Channel
### `GET /api/v1/douyin/xingtu/kol_audience_portrait_v1`
**获取kol观众画像V1/Get kol Audience Portrait V1**
Parameters:
- `kolId`*: 用户的kolId/User kolId
### `GET /api/v1/douyin/xingtu/kol_fans_portrait_v1`
**获取kol粉丝画像V1/Get kol Fans Portrait V1**
Parameters:
- `kolId`*: 用户的kolId/User kolId
- `fansType`: 粉丝类型/Fans Type
### `GET /api/v1/douyin/xingtu/kol_service_price_v1`
**获取kol服务报价V1/Get kol Service Price V1**
Parameters:
- `kolId`*: 用户的kolId/User kolId
- `platformChannel`*: 平台渠道/Platform Channel
### `GET /api/v1/douyin/xingtu/kol_data_overview_v1`
**获取kol数据概览V1/Get kol Data Overview V1**
Parameters:
- `kolId`*: 用户的kolId/User kolId
- `_type`*: 类型/Type
- `_range`*: 范围/Range
- `flowType`*: 流量类型/Flow Type
- `onlyAssign`: 是否指派/Whether assigned (optional)
### `GET /api/v1/douyin/xingtu/search_kol_v1`
**关键词搜索kol V1/Search Kol V1**
Parameters:
- `keyword`*: 关键词/Keyword
- `platformSource`*: 平台来源/Platform Source
- `page`*: 页码/Page
### `GET /api/v1/douyin/xingtu/search_kol_v2`
**高级搜索kol V2/Search Kol Advanced V2**
Parameters:
- `keyword`*: 关键词/Keyword
- `followerRange`: 粉丝范围(可选)/Follower Range (optional), 例如 10-100 表示10万-100万粉丝
- `contentTag`: 内容标签(可选)/Content Tag (optional), 例如 tag-1 或 tag_level_two-7
### `GET /api/v1/douyin/xingtu/kol_conversion_ability_analysis_v1`
**获取kol转化能力分析V1/Get kol Conversion Ability Analysis V1**
Parameters:
- `kolId`*: 用户的kolId/User kolId
- `_range`*: 时间范围/Time Range
### `GET /api/v1/douyin/xingtu/kol_video_performance_v1`
**获取kol视频表现V1/Get kol Video Performance V1**
Parameters:
- `kolId`*: 用户的kolId/User kolId
- `onlyAssign`*: 是否只显示分配作品/Whether to display only assigned works
### `GET /api/v1/douyin/xingtu/kol_xingtu_index_v1`
**获取kol星图指数V1/Get kol Xingtu Index V1**
Parameters:
- `kolId`*: 用户的kolId/User kolId
### `GET /api/v1/douyin/xingtu/kol_convert_video_display_v1`
**获取kol转化视频展示V1/Get kol Convert Video Display V1**
Parameters:
- `kolId`*: 用户的kolId/User kolId
- `detailType`*: 详情类型/Detail Type
- `page`*: 页码/Page
### `GET /api/v1/douyin/xingtu/kol_link_struct_v1`
**获取kol连接用户V1/Get kol Link Struct V1**
Parameters:
- `kolId`*: 用户的kolId/User kolId
### `GET /api/v1/douyin/xingtu/kol_touch_distribution_v1`
**获取kol连接用户来源V1/Get kol Touch Distribution V1**
Parameters:
- `kolId`*: 用户的kolId/User kolId
### `GET /api/v1/douyin/xingtu/kol_cp_info_v1`
**获取kol性价比能力分析V1/Get kol Cp Info V1**
Parameters:
- `kolId`*: 用户的kolId/User kolId
### `GET /api/v1/douyin/xingtu/kol_rec_videos_v1`
**获取kol内容表现V1/Get kol Rec Videos V1**
Parameters:
- `kolId`*: 用户的kolId/User kolId
### `GET /api/v1/douyin/xingtu/kol_daily_fans_v1`
**获取kol粉丝趋势V1/Get kol Daily Fans V1**
Parameters:
- `kolId`*: 用户的kolId/User kolId
- `startDate`*: 开始日期/Start Date
- `endDate`*: 结束日期/End Date
### `GET /api/v1/douyin/xingtu/author_hot_comment_tokens_v1`
**获取kol热词分析评论V1/Get Author Hot Comment Tokens V1**
Parameters:
- `kolId`*: 用户的kolId/User kolId
### `GET /api/v1/douyin/xingtu/author_content_hot_comment_keywords_v1`
**获取kol热词分析内容V1/Get Author Content Hot Comment Keywords V1**
Parameters:
- `kolId`*: 用户的kolId/User kolId
## /api/v1/douyin/xingtu_v2
### `GET /api/v1/douyin/xingtu_v2/get_ranking_list_catalog`
**获取星图热榜分类/Get Ranking List Catalog**
Parameters:
- `codes`: 分类代码,默认为空字符串/Classification codes, default is empty string
- `biz_scene`: 业务场景/Business scene
### `GET /api/v1/douyin/xingtu_v2/get_ranking_list_data`
**获取星图达人商业榜数据/Get Ranking List Data**
Parameters:
- `code`: 榜单类型代码/Ranking type code
- `qualifier`: 榜单分类ID,从get_ranking_list_catalog获取/Category qualifier_id
- `version`: 版本/Version
- `period`: 统计周期,7=周榜,30=月榜/Period, 7=weekly, 30=monthly
- `date`: 统计日期,格式YYYYMMDD/Date, format YYYYMMDD
- `limit`: 返回数量/Result limit
### `POST /api/v1/douyin/xingtu_v2/get_playlet_actor_rank_catalog`
**获取短剧演员热榜分类/Get Playlet Actor Rank Catalog**
### `GET /api/v1/douyin/xingtu_v2/get_playlet_actor_rank_list`
**获取短剧演员热榜/Get Playlet Actor Rank List**
Parameters:
- `category`: 分类/Category
- `name`: 榜单名称/Ranking name
- `qualifier`: 达人类型,空字符串=不限/Actor type, empty=all
- `period`: 统计周期,7=周榜,30=月榜/Period, 7=weekly, 30=monthly
- `date`: 统计日期,格式YYYYMMDD/Date, format YYYYMMDD
- `limit`: 返回数量/Result limit
### `GET /api/v1/douyin/xingtu_v2/get_author_market_fields`
**获取达人广场筛选字段/Get Author Market Fields**
Parameters:
- `market_scene`: 市场场景,1=默认场景/Market scene, 1=default
### `GET /api/v1/douyin/xingtu_v2/get_author_base_info`
**获取创作者基本信息/Get Author Base Info**
Parameters:
- `o_author_id`*: 创作者ID/Creator author ID
- `platform_source`: 平台来源/Platform source
- `platform_channel`: 平台渠道/Platform channel
- `recommend`: 是否返回推荐信息/Whether to return recommendation info
- `need_sec_uid`: 是否返回sec_uid/Whether to return sec_uid
- `need_linkage_info`: 是否返回联动信息/Whether to return linkage info
### `GET /api/v1/douyin/xingtu_v2/get_author_business_card_info`
**获取创作者商业卡片信息/Get Author Business Card Info**
Parameters:
- `o_author_id`*: 创作者ID/Creator author ID
### `GET /api/v1/douyin/xingtu_v2/get_author_local_info`
**获取创作者位置信息/Get Author Local Info**
Parameters:
- `o_author_id`*: 创作者ID/Creator author ID
- `platform_source`: 平台来源/Platform source
- `platform_channel`: 平台渠道/Platform channel
- `time_range`: 时间范围(天)/Time range in days
### `GET /api/v1/douyin/xingtu_v2/get_author_show_items`
**获取创作者视频列表/Get Author Show Items**
Parameters:
- `o_author_id`*: 创作者ID/Creator author ID
- `platform_source`: 平台来源/Platform source
- `platform_channel`: 平台渠道/Platform channel
- `limit`: 返回数量/Result limit
- `only_assign`: 仅看指派视频/Only show assigned videos
- `flow_type`: 流量类型/Flow type
### `GET /api/v1/douyin/xingtu_v2/get_author_hot_comment_tokens`
**获取创作者评论热词/Get Author Hot Comment Tokens**
Parameters:
- `author_id`*: 创作者ID/Creator author ID
- `num`: 返回热词数量/Number of hot tokens
- `without_emoji`: 是否排除emoji/Whether to exclude emoji
### `GET /api/v1/douyin/xingtu_v2/get_author_content_hot_keywords`
**获取创作者内容热词/Get Author Content Hot Keywords**
Parameters:
- `author_id`*: 创作者ID/Creator author ID
- `keyword_type`: 热词类型/Keyword type
### `POST /api/v1/douyin/xingtu_v2/get_recommend_for_star_authors`
**获取相似创作者推荐/Get Recommend Similar Star Authors**
### `GET /api/v1/douyin/xingtu_v2/get_excellent_case_category_list`
**获取优秀行业分类列表/Get Excellent Case Category List**
Parameters:
- `platform_source`: 平台来源/Platform source
### `GET /api/v1/douyin/xingtu_v2/get_author_spread_info`
**获取创作者传播价值/Get Author Spread Info**
Parameters:
- `o_author_id`*: 创作者ID/Creator author ID
- `platform_source`: 平台来源/Platform source
- `platform_channel`: 平台渠道/Platform channel
- `type`: 视频类型,1=个人视频/Video type, 1=personal video
- `flow_type`: 流量类型/Flow type
- `only_assign`: 仅看指派视频/Only assigned videos
- `range`: 时间范围,2=近30天,3=近90天/Time range, 2=last 30 days, 3=last 90 day
### `GET /api/v1/douyin/xingtu_v2/get_user_profile_qrcode`
**获取用户主页二维码/Get User Profile QRCode**
Parameters:
- `core_user_id`: 用户核心ID(与sec_uid二选一)/User core ID (pick one with sec_uid)
- `sec_uid`: 用户sec_uid(与core_user_id二选一)/User sec_uid (pick one with core
### `GET /api/v1/douyin/xingtu_v2/get_content_trend_guide`
**获取内容趋势指南/Get Content Trend Guide**
### `GET /api/v1/douyin/xingtu_v2/get_ip_activity_industry_list`
**获取星图IP日历行业列表/Get IP Activity Industry List**
### `POST /api/v1/douyin/xingtu_v2/get_ip_activity_list`
**获取星图IP日历活动列表/Get IP Activity List**
### `GET /api/v1/douyin/xingtu_v2/get_ip_activity_detail`
**获取星图IP活动详情/Get IP Activity Detail**
Parameters:
- `id`*: 活动ID,从get_ip_activity_list获取/Activity ID from get_ip_activit
### `GET /api/v1/douyin/xingtu_v2/get_resource_list`
**获取营销活动案例/Get Resource List**
Parameters:
- `resource_id`*: 资源ID/Resource ID
### `GET /api/v1/douyin/xingtu_v2/get_demander_mcn_list`
**搜索MCN机构列表/Get Demander MCN List**
Parameters:
- `mcn_name`: MCN机构名称,支持模糊搜索/MCN name, supports fuzzy search
- `page`: 页码/Page number
- `limit`: 每页数量/Page size
- `order_by`: 排序方式/Sort by
FILE:references/instagram.md
# Instagram API Reference
Total endpoints: 83
## /api/v1/instagram/v1
### `GET /api/v1/instagram/v1/shortcode_to_media_id`
**Shortcode转Media ID/Convert shortcode to media ID**
Parameters:
- `shortcode`*: 帖子Shortcode/Post shortcode
### `GET /api/v1/instagram/v1/media_id_to_shortcode`
**Media ID转Shortcode/Convert media ID to shortcode**
Parameters:
- `media_id`*: 帖子Media ID/Post media ID
### `GET /api/v1/instagram/v1/user_id_to_username`
**用户ID转用户信息/Get user info by user ID**
Parameters:
- `user_id`*: 用户ID/User ID
### `GET /api/v1/instagram/v1/fetch_user_info_by_username`
**根据用户名获取用户数据/Get user data by username**
Parameters:
- `username`*: Instagram用户名/Instagram username
### `GET /api/v1/instagram/v1/fetch_user_info_by_username_v2`
**根据用户名获取用户数据V2/Get user data by username V2**
Parameters:
- `username`*: Instagram用户名/Instagram username
### `GET /api/v1/instagram/v1/fetch_user_info_by_username_v3`
**根据用户名获取用户数据V3/Get user data by username V3**
Parameters:
- `username`*: Instagram用户名/Instagram username
### `GET /api/v1/instagram/v1/fetch_user_info_by_id`
**根据用户ID获取用户数据/Get user data by user ID**
Parameters:
- `user_id`*: Instagram用户ID/Instagram user ID
### `GET /api/v1/instagram/v1/fetch_user_info_by_id_v2`
**根据用户ID获取用户数据V2/Get user data by user ID V2**
Parameters:
- `user_id`*: Instagram用户ID/Instagram user ID
### `GET /api/v1/instagram/v1/fetch_user_about_info`
**获取用户的About信息/Get user about info**
Parameters:
- `user_id`*: Instagram用户ID/Instagram user ID
### `GET /api/v1/instagram/v1/fetch_user_posts`
**获取用户帖子列表/Get user posts list**
Parameters:
- `user_id`*: Instagram用户ID/Instagram user ID
- `count`: 每页数量/Count per page
- `max_id`: 分页游标,用于获取下一页/Pagination cursor for next page
### `GET /api/v1/instagram/v1/fetch_user_posts_v2`
**获取用户帖子列表V2/Get user posts list V2**
Parameters:
- `user_id`*: Instagram用户ID/Instagram user ID
- `count`: 每页数量/Count per page
- `end_cursor`: 分页游标,用于获取下一页/Pagination cursor for next page
### `GET /api/v1/instagram/v1/fetch_user_reels`
**获取用户Reels列表/Get user Reels list**
Parameters:
- `user_id`*: Instagram用户ID/Instagram user ID
- `count`: 每页数量/Count per page
- `max_id`: 分页游标,用于获取下一页/Pagination cursor for next page
### `GET /api/v1/instagram/v1/fetch_user_reposts`
**获取用户转发列表/Get user reposts list**
Parameters:
- `user_id`*: Instagram用户ID/Instagram user ID
- `max_id`: 分页游标,用于获取下一页/Pagination cursor for next page
### `GET /api/v1/instagram/v1/fetch_user_tagged_posts`
**获取用户被标记的帖子/Get user tagged posts**
Parameters:
- `user_id`*: Instagram用户ID/Instagram user ID
- `count`: 每页数量/Count per page
- `end_cursor`: 分页游标,用于获取下一页/Pagination cursor for next page
### `GET /api/v1/instagram/v1/fetch_related_profiles`
**获取相关用户推荐/Get related profiles**
Parameters:
- `user_id`*: Instagram用户ID/Instagram user ID
### `GET /api/v1/instagram/v1/fetch_search`
**搜索用户/话题/地点/Search users/hashtags/places**
Parameters:
- `query`*: 搜索关键词/Search keyword
- `select`: 筛选类型:users/hashtags/places,不传则返回全部/Filter type: users/hashta
### `GET /api/v1/instagram/v1/fetch_post_by_url`
**通过URL获取帖子详情/Get post by URL**
Parameters:
- `post_url`*: 帖子URL/Post URL
### `GET /api/v1/instagram/v1/fetch_post_by_url_v2`
**通过URL获取帖子详情 V2/Get post by URL V2**
Parameters:
- `post_url`*: 帖子URL/Post URL
### `GET /api/v1/instagram/v1/fetch_post_by_id`
**通过ID获取帖子详情/Get post by ID**
Parameters:
- `post_id`*: 帖子ID/Post ID
### `GET /api/v1/instagram/v1/fetch_post_comments_v2`
**获取帖子评论列表V2/Get post comments V2**
Parameters:
- `media_id`*: 帖子ID(媒体ID)/Post ID (Media ID)
- `sort_order`: 排序方式:popular(热门)/recent(最新)/Sorting: popular/recent
- `min_id`: 分页游标,从上一次响应的next_min_id获取/Pagination cursor from previous re
### `GET /api/v1/instagram/v1/fetch_comment_replies`
**获取评论的子评论列表/Get comment replies**
Parameters:
- `media_id`*: 帖子ID(媒体ID)/Post ID (Media ID)
- `comment_id`*: 父评论ID/Parent comment ID
- `min_id`: 分页游标,从上一次响应的next_min_id获取/Pagination cursor from previous re
### `GET /api/v1/instagram/v1/fetch_music_posts`
**获取使用特定音乐的帖子/Get posts using specific music**
Parameters:
- `music_id`: 音乐ID/Music ID
- `music_url`: 音乐URL(与music_id二选一)/Music URL (alternative to music_id)
- `max_id`: 分页游标,用于获取下一页/Pagination cursor for next page
### `GET /api/v1/instagram/v1/fetch_hashtag_posts`
**获取话题标签下的帖子/Get posts by hashtag**
Parameters:
- `hashtag`*: 话题标签名称(不含#号)/Hashtag name (without #)
- `end_cursor`: 分页游标,用于获取下一页/Pagination cursor for next page
### `GET /api/v1/instagram/v1/fetch_location_info`
**获取地点信息/Get location info**
Parameters:
- `location_id`*: 地点ID/Location ID
### `GET /api/v1/instagram/v1/fetch_location_posts`
**获取地点下的帖子/Get posts by location**
Parameters:
- `location_id`*: 地点ID/Location ID
- `tab`: 排序方式:ranked(热门)/recent(最新)/Sorting: ranked(top)/recent(lates
- `end_cursor`: 分页游标,用于获取下一页/Pagination cursor for next page
### `GET /api/v1/instagram/v1/fetch_cities`
**获取国家城市列表/Get cities by country**
Parameters:
- `country_code`*: 国家代码(如US、CN、JP)/Country code (e.g. US, CN, JP)
- `page`: 页码/Page number
### `GET /api/v1/instagram/v1/fetch_locations`
**获取城市地点列表/Get locations by city**
Parameters:
- `city_id`*: 城市ID(从fetch_cities获取)/City ID (from fetch_cities)
- `page`: 页码/Page number
### `GET /api/v1/instagram/v1/fetch_explore_sections`
**获取探索页面分类/Get explore page sections**
### `GET /api/v1/instagram/v1/fetch_section_posts`
**获取分类下的帖子/Get posts by section**
Parameters:
- `section_id`*: 分类ID(从fetch_explore_sections获取)/Section ID (from fetch_explo
- `count`: 每页数量/Count per page
- `max_id`: 分页游标,用于获取下一页/Pagination cursor for next page
## /api/v1/instagram/v2
### `GET /api/v1/instagram/v2/shortcode_to_media_id`
**Shortcode转Media ID/Convert shortcode to media ID**
Parameters:
- `shortcode`*: 帖子Shortcode/Post shortcode
### `GET /api/v1/instagram/v2/media_id_to_shortcode`
**Media ID转Shortcode/Convert media ID to shortcode**
Parameters:
- `media_id`*: 帖子Media ID/Post media ID
### `GET /api/v1/instagram/v2/user_id_to_username`
**用户ID转用户信息/Get user info by user ID**
Parameters:
- `user_id`*: 用户ID/User ID
### `GET /api/v1/instagram/v2/fetch_user_info`
**获取用户信息/Get user info**
Parameters:
- `username`: 用户名/Username
- `user_id`: 用户ID/User ID
### `GET /api/v1/instagram/v2/fetch_user_posts`
**获取用户帖子/Get user posts**
Parameters:
- `username`: 用户名/Username
- `user_id`: 用户ID/User ID
- `pagination_token`: 分页token/Pagination token
### `GET /api/v1/instagram/v2/fetch_user_reels`
**获取用户Reels/Get user reels**
Parameters:
- `username`: 用户名/Username
- `user_id`: 用户ID/User ID
- `pagination_token`: 分页token/Pagination token
### `GET /api/v1/instagram/v2/fetch_user_followers`
**获取用户粉丝/Get user followers**
Parameters:
- `username`: 用户名/Username
- `user_id`: 用户ID/User ID
- `pagination_token`: 分页token/Pagination token
### `GET /api/v1/instagram/v2/fetch_user_following`
**获取用户关注/Get user following**
Parameters:
- `username`: 用户名/Username
- `user_id`: 用户ID/User ID
- `pagination_token`: 分页token/Pagination token
### `GET /api/v1/instagram/v2/fetch_user_stories`
**获取用户故事/Get user stories**
Parameters:
- `username`: 用户名/Username
- `user_id`: 用户ID/User ID
### `GET /api/v1/instagram/v2/fetch_user_highlights`
**获取用户精选/Get user highlights**
Parameters:
- `username`: 用户名/Username
- `user_id`: 用户ID/User ID
### `GET /api/v1/instagram/v2/fetch_highlight_stories`
**获取精选故事详情/Get highlight stories**
Parameters:
- `highlight_id`*: 精选ID/Highlight ID
### `GET /api/v1/instagram/v2/fetch_user_tagged_posts`
**获取用户被标记的帖子/Get user tagged posts**
Parameters:
- `username`: 用户名/Username
- `user_id`: 用户ID/User ID
- `pagination_token`: 分页token/Pagination token
### `GET /api/v1/instagram/v2/fetch_similar_users`
**获取相似用户/Get similar users**
Parameters:
- `username`: 用户名/Username
- `user_id`: 用户ID/User ID
### `GET /api/v1/instagram/v2/search_users`
**搜索用户/Search users**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
### `GET /api/v1/instagram/v2/general_search`
**综合搜索/General search**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `pagination_token`: 分页token/Pagination token
### `GET /api/v1/instagram/v2/search_reels`
**搜索Reels/Search reels**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `pagination_token`: 分页token/Pagination token
### `GET /api/v1/instagram/v2/search_music`
**搜索音乐/Search music**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
### `GET /api/v1/instagram/v2/search_hashtags`
**搜索话题标签/Search hashtags**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
### `GET /api/v1/instagram/v2/search_locations`
**搜索地点/Search locations**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
### `GET /api/v1/instagram/v2/search_by_coordinates`
**根据坐标搜索地点/Search locations by coordinates**
Parameters:
- `latitude`*: 纬度/Latitude
- `longitude`*: 经度/Longitude
### `GET /api/v1/instagram/v2/fetch_post_info`
**获取帖子详情/Get post info**
Parameters:
- `code_or_url`*: 帖子Shortcode或URL/Post shortcode or URL
### `GET /api/v1/instagram/v2/fetch_post_likes`
**获取帖子点赞列表/Get post likes**
Parameters:
- `code_or_url`*: 帖子Shortcode或URL/Post shortcode or URL
- `end_cursor`: 分页游标/Pagination cursor
### `GET /api/v1/instagram/v2/fetch_post_comments`
**获取帖子评论/Get post comments**
Parameters:
- `code_or_url`*: 帖子Shortcode或URL/Post shortcode or URL
- `sort_by`: 排序方式: recent(最新) 或 popular(热门)/Sort by: recent or popular
- `pagination_token`: 分页token/Pagination token
### `GET /api/v1/instagram/v2/fetch_comment_replies`
**获取评论回复/Get comment replies**
Parameters:
- `code_or_url`*: 帖子Shortcode或URL/Post shortcode or URL
- `comment_id`*: 评论ID/Comment ID
- `pagination_token`: 分页token/Pagination token
### `GET /api/v1/instagram/v2/fetch_music_posts`
**获取音乐帖子/Get music posts**
Parameters:
- `audio_canonical_id`*: 音频ID/Audio ID
- `pagination_token`: 分页token/Pagination token
### `GET /api/v1/instagram/v2/fetch_location_posts`
**获取地点帖子/Get location posts**
Parameters:
- `location_id`*: 地点ID/Location ID
- `pagination_token`: 分页token/Pagination token
### `GET /api/v1/instagram/v2/fetch_hashtag_posts`
**获取话题帖子/Get hashtag posts**
Parameters:
- `keyword`*: 话题关键词(不含#号)/Hashtag keyword (without #)
- `feed_type`: 帖子类型: top(热门), recent(最新), reels(仅Reels)/Feed type: top, rec
- `pagination_token`: 分页token/Pagination token
## /api/v1/instagram/v3
### `GET /api/v1/instagram/v3/search_users`
**搜索用户/Search users**
Parameters:
- `query`*: 搜索关键词/Search keyword
### `GET /api/v1/instagram/v3/search_hashtags`
**搜索话题标签/Search hashtags**
Parameters:
- `query`*: 搜索关键词/Search keyword
### `GET /api/v1/instagram/v3/search_places`
**搜索地点/Search places**
Parameters:
- `query`*: 搜索关键词/Search keyword
### `GET /api/v1/instagram/v3/general_search`
**综合搜索(支持分页)/General search (with pagination)**
Parameters:
- `query`*: 搜索关键词/Search keyword
- `next_max_id`: 分页ID,首次请求不传,从上一次响应的next_max_id获取/Pagination ID, omit for fir
- `rank_token`: 排序token,首次请求不传,从上一次响应获取/Rank token, omit for first request,
- `enable_metadata`: 是否启用元数据/Enable metadata
### `GET /api/v1/instagram/v3/get_user_profile`
**获取用户信息/Get user profile**
Parameters:
- `user_id`: 用户ID/User ID
- `username`: 用户名/Username
### `GET /api/v1/instagram/v3/get_user_brief`
**获取用户短详情/Get user brief info**
Parameters:
- `user_id`*: 用户ID/User ID
- `username`*: 用户名/Username
### `GET /api/v1/instagram/v3/get_user_posts`
**获取用户帖子列表/Get user posts**
Parameters:
- `username`: 用户名/Username
- `user_id`: 用户ID/User ID
- `first`: 获取帖子数量/Number of posts to fetch
- `after`: 分页游标(从上次响应的page_info.end_cursor获取)/Pagination cursor (from p
### `GET /api/v1/instagram/v3/get_user_tagged_posts`
**获取用户被标记的帖子/Get user tagged posts**
Parameters:
- `user_id`: 用户ID/User ID
- `username`: 用户名/Username
- `first`: 获取帖子数量/Number of posts to fetch
- `after`: 分页游标(从上次响应的page_info.end_cursor获取)/Pagination cursor (from p
### `GET /api/v1/instagram/v3/get_user_reels`
**获取用户Reels列表/Get user reels**
Parameters:
- `user_id`: 用户ID/User ID
- `username`: 用户名/Username
- `first`: 获取数量/Number of reels to fetch
- `after`: 分页游标(从上次响应的page_info.end_cursor获取)/Pagination cursor (from p
### `GET /api/v1/instagram/v3/get_user_highlights`
**获取用户精选Highlights列表/Get user highlights**
Parameters:
- `user_id`: 用户ID/User ID
- `username`: 用户名/Username
- `first`: 获取数量/Number of highlights to fetch
- `after`: 分页游标(从上次响应的page_info.end_cursor获取)/Pagination cursor (from p
### `GET /api/v1/instagram/v3/get_highlight_stories`
**获取Highlight精选详情/Get highlight stories**
Parameters:
- `highlight_id`*: 精选ID/Highlight ID (格式/format: highlight:xxx)
- `reel_ids`: 精选ID列表,逗号分隔,如不提供则仅查询highlight_id/Highlight ID list, comma se
### `GET /api/v1/instagram/v3/get_user_about`
**获取用户账户简介/Get user about info**
Parameters:
- `user_id`: 用户ID/User ID
- `username`: 用户名/Username
### `GET /api/v1/instagram/v3/get_user_former_usernames`
**获取用户曾用用户名/Get user former usernames**
Parameters:
- `user_id`: 用户ID/User ID
- `username`: 用户名/Username
### `GET /api/v1/instagram/v3/get_user_stories`
**获取用户Stories(快拍)/Get user stories**
Parameters:
- `user_id`: 用户ID/User ID
- `username`: 用户名/Username
- `reel_ids`: 用户ID列表,逗号分隔,可同时获取多个用户的Stories(如不提供则仅查询user_id)/User ID list,
### `GET /api/v1/instagram/v3/get_recommended_reels`
**获取Reels推荐列表/Get recommended Reels feed**
Parameters:
- `first`: 获取数量/Number of reels to fetch
- `after`: 分页游标,首次请求不传,从上一次响应的 page_info.end_cursor 获取/Pagination curso
### `GET /api/v1/instagram/v3/get_post_info`
**获取帖子详情/Get post info (media_id or URL)**
Parameters:
- `media_id`: 帖子媒体ID/Post media ID
- `url`: 帖子URL/Post URL
### `GET /api/v1/instagram/v3/get_post_info_by_code`
**获取帖子详情(code)/Get post info by shortcode**
Parameters:
- `code`: 帖子短代码/Post shortcode
- `url`: 帖子URL(自动提取短代码)/Post URL (auto extract shortcode)
### `GET /api/v1/instagram/v3/get_post_comments`
**获取帖子评论/Get post comments**
Parameters:
- `media_id`: 帖子媒体ID/Post media ID
- `code`: 帖子短代码/Post shortcode (e.g., DUajw4YkorV)
- `url`: 帖子URL/Post URL
- `min_id`: 分页游标,首次请求不传,从上一次响应的 next_min_id 获取/Pagination cursor, omit f
- `sort_order`: 排序方式: popular(热门), newest(最新)/Sort order: popular, newest
### `GET /api/v1/instagram/v3/get_comment_replies`
**获取评论的子评论/回复/Get comment replies**
Parameters:
- `media_id`: 帖子媒体ID/Post media ID
- `code`: 帖子短代码/Post shortcode
- `url`: 帖子URL/Post URL
- `comment_id`*: 父评论ID/Parent comment ID
- `min_id`: 分页游标,首次请求不传,从上一次响应的 next_min_child_cursor 获取/Pagination curs
### `GET /api/v1/instagram/v3/get_post_oembed`
**获取帖子oEmbed内嵌信息/Get post oEmbed info**
Parameters:
- `url`*: Instagram帖子的完整URL/Full URL of Instagram post
- `hidecaption`: 是否隐藏帖子文本/Whether to hide caption
- `maxwidth`: 最大宽度(像素)/Max width in pixels
### `GET /api/v1/instagram/v3/translate_comment`
**翻译评论/帖子文本/Translate comment or caption**
Parameters:
- `comment_id`*: 帖子媒体ID/Post media ID
### `GET /api/v1/instagram/v3/bulk_translate_comments`
**批量翻译评论/Bulk translate comments**
Parameters:
- `comment_ids`*: 评论ID列表,逗号分隔/Comment ID list, comma separated
### `GET /api/v1/instagram/v3/get_explore`
**获取探索页推荐帖子/Get explore feed**
Parameters:
- `max_id`: 分页游标,首次请求不传,从上一次响应的 next_max_id 获取/Pagination cursor, omit f
### `GET /api/v1/instagram/v3/get_user_following`
**获取用户关注列表/Get user following list**
Parameters:
- `user_id`: 用户ID/User ID
- `username`: 用户名/Username
- `count`: 每次获取数量/Number of users to fetch per request
- `max_id`: 分页游标,首次请求不传,从上一次响应的 next_max_id 获取/Pagination cursor, omit f
### `GET /api/v1/instagram/v3/get_user_followers`
**获取用户粉丝列表/Get user followers list**
Parameters:
- `user_id`: 用户ID/User ID
- `username`: 用户名/Username
- `count`: 每次获取数量/Number of users to fetch per request
- `max_id`: 分页游标,首次请求不传,从上一次响应的 next_max_id 获取/Pagination cursor, omit f
### `GET /api/v1/instagram/v3/get_location_info`
**获取地点详情/Get location info**
Parameters:
- `location_id`*: 地点ID/Location ID
- `show_nearby`: 是否显示附近地点/Whether to show nearby places
### `GET /api/v1/instagram/v3/get_location_posts`
**获取地点相关帖子/Get location posts**
Parameters:
- `location_id`*: 地点ID/Location ID
- `tab`: 帖子类型: ranked(热门), recent(最新)/Post type: ranked(top), recent(
- `page_size_override`: 每页数量/Page size
FILE:references/reddit-linkedin.md
# Reddit Linkedin API Reference
Total endpoints: 49
## /api/v1/linkedin/web
### `GET /api/v1/linkedin/web/get_user_profile`
**获取用户资料/Get user profile**
Parameters:
- `username`*: LinkedIn用户名/LinkedIn username
- `include_follower_and_connection`: 包含粉丝和连接数(额外消耗1次请求)/Include follower and connection count (+1
- `include_experiences`: 包含工作经历(额外消耗1次请求)/Include work experiences (+1 request)
- `include_skills`: 包含技能(额外消耗1次请求)/Include skills (+1 request)
- `include_certifications`: 包含认证(额外消耗1次请求)/Include certifications (+1 request)
- `include_publications`: 包含出版物(额外消耗1次请求)/Include publications (+1 request)
- `include_educations`: 包含教育背景(额外消耗1次请求)/Include educational background (+1 request)
- `include_volunteers`: 包含志愿者经历(额外消耗1次请求)/Include volunteer experiences (+1 request)
- `include_honors`: 包含荣誉奖项(额外消耗1次请求)/Include honors and awards (+1 request)
- `include_interests`: 包含兴趣(额外消耗1次请求)/Include interests (+1 request)
- `include_bio`: 包含个人简介(额外消耗1次请求)/Include bio/about (+1 request)
### `GET /api/v1/linkedin/web/get_user_posts`
**获取用户帖子/Get user posts**
Parameters:
- `urn`*: 用户URN,可通过get_user_profile接口获取/User URN, can be obtained from
- `page`: 页码/Page number
- `pagination_token`: 分页令牌/Pagination token
### `GET /api/v1/linkedin/web/get_user_comments`
**获取用户评论/Get user comments**
Parameters:
- `urn`*: 用户URN,可通过get_user_profile接口获取/User URN, can be obtained from
- `page`: 页码/Page number
- `pagination_token`: 分页令牌/Pagination token
### `GET /api/v1/linkedin/web/get_user_contact`
**获取用户联系信息/Get user contact information**
Parameters:
- `username`*: LinkedIn用户名/LinkedIn username
### `GET /api/v1/linkedin/web/get_user_recommendations`
**获取用户推荐信/Get user recommendations**
Parameters:
- `urn`*: 用户URN,可通过get_user_profile接口获取/User URN, can be obtained from
- `page`: 页码/Page number
- `type`: 推荐类型:received(收到的)或given(给出的)/Type: received or given
- `pagination_token`: 分页令牌/Pagination token
### `GET /api/v1/linkedin/web/get_user_videos`
**获取用户视频/Get user videos**
Parameters:
- `urn`*: 用户URN,可通过get_user_profile接口获取/User URN, can be obtained from
- `page`: 页码/Page number
- `pagination_token`: 分页令牌/Pagination token
### `GET /api/v1/linkedin/web/get_user_images`
**获取用户图片/Get user images**
Parameters:
- `urn`*: 用户URN,可通过get_user_profile接口获取/User URN, can be obtained from
- `page`: 页码/Page number
- `pagination_token`: 分页令牌/Pagination token
### `GET /api/v1/linkedin/web/get_company_profile`
**获取公司资料/Get company profile**
Parameters:
- `company`: 公司名称/Company name
- `company_id`: 公司ID(额外消耗1次请求)/Company ID (+1 request)
### `GET /api/v1/linkedin/web/get_company_people`
**获取公司员工/Get company people**
Parameters:
- `company_id`*: 公司ID/Company ID
- `page`: 页码/Page number
### `GET /api/v1/linkedin/web/get_company_posts`
**获取公司帖子/Get company posts**
Parameters:
- `company_id`*: 公司ID/Company ID
- `page`: 页码/Page number
- `sort_by`: 排序方式:top(热门)或recent(最新)/Sort by: top or recent
### `GET /api/v1/linkedin/web/get_company_jobs`
**获取公司职位/Get company jobs**
Parameters:
- `company_id`*: 公司ID/Company ID
- `page`: 页码/Page number
- `sort_by`: 排序方式:recent(最新)或relevant(相关)/Sort by: recent or relevant
- `date_posted`: 发布时间过滤:anytime, past_month, past_week, past_24_hours
- `experience_level`: 经验级别:internship, entry_level, associate, mid_senior, directo
- `remote`: 工作地点类型:onsite, remote, hybrid
- `job_type`: 工作类型:full_time, part_time, contract, temporary, volunteer, i
- `easy_apply`: 是否易申请/Filter easy apply jobs
- `under_10_applicants`: 是否少于10个申请者/Filter jobs with under 10 applicants
- `fair_chance_employer`: 是否公平机会雇主/Filter fair chance employer jobs
### `GET /api/v1/linkedin/web/get_company_job_count`
**获取公司职位数量/Get company job count**
Parameters:
- `company_id`*: 公司ID/Company ID
### `GET /api/v1/linkedin/web/get_user_about`
**获取用户简介/Get user about**
Parameters:
- `urn`*: 用户URN,可通过get_user_profile接口获取/User URN, can be obtained from
### `GET /api/v1/linkedin/web/get_user_follower_and_connection`
**获取用户粉丝和连接数/Get user follower and connection**
Parameters:
- `username`*: LinkedIn用户名/LinkedIn username
### `GET /api/v1/linkedin/web/get_user_experience`
**获取用户工作经历/Get user experience**
Parameters:
- `urn`*: 用户URN,可通过get_user_profile接口获取/User URN, can be obtained from
- `page`: 页码/Page number
### `GET /api/v1/linkedin/web/get_user_skills`
**获取用户技能/Get user skills**
Parameters:
- `urn`*: 用户URN,可通过get_user_profile接口获取/User URN, can be obtained from
- `page`: 页码/Page number
### `GET /api/v1/linkedin/web/get_user_educations`
**获取用户教育背景/Get user educations**
Parameters:
- `urn`*: 用户URN,可通过get_user_profile接口获取/User URN, can be obtained from
- `page`: 页码/Page number
### `GET /api/v1/linkedin/web/get_user_publications`
**获取用户出版物/Get user publications**
Parameters:
- `urn`*: 用户URN,可通过get_user_profile接口获取/User URN, can be obtained from
- `page`: 页码/Page number
### `GET /api/v1/linkedin/web/get_user_certifications`
**获取用户认证/Get user certifications**
Parameters:
- `urn`*: 用户URN,可通过get_user_profile接口获取/User URN, can be obtained from
- `page`: 页码/Page number
### `GET /api/v1/linkedin/web/get_user_honors`
**获取用户荣誉奖项/Get user honors**
Parameters:
- `urn`*: 用户URN,可通过get_user_profile接口获取/User URN, can be obtained from
- `page`: 页码/Page number
### `GET /api/v1/linkedin/web/get_user_interests_groups`
**获取用户感兴趣的群组/Get user interests groups**
Parameters:
- `urn`*: 用户URN,可通过get_user_profile接口获取/User URN, can be obtained from
- `page`: 页码/Page number
### `GET /api/v1/linkedin/web/get_user_interests_companies`
**获取用户感兴趣的公司/Get user interests companies**
Parameters:
- `urn`*: 用户URN,可通过get_user_profile接口获取/User URN, can be obtained from
- `page`: 页码/Page number
### `GET /api/v1/linkedin/web/get_job_detail`
**获取职位详情/Get job detail**
Parameters:
- `job_id`*: 职位ID/Job ID
- `include_skills`: 包含职位技能要求(额外消耗1次请求)/Include job skills (+1 request)
### `GET /api/v1/linkedin/web/search_jobs`
**搜索职位/Search jobs**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `page`: 页码/Page number
- `sort_by`: 排序方式:recent(最新)或relevant(相关)/Sort by: recent or relevant
- `date_posted`: 发布时间过滤:anytime, past_month, past_week, past_24_hours
- `geocode`: 地理位置代码,可通过Search Geocode Location获取/Geocode for location
- `company`: 公司ID过滤/Company ID filter (e.g., 1441 for Google)
- `experience_level`: 经验级别:internship, entry_level, associate, mid_senior, directo
- `remote`: 工作地点类型:onsite, remote, hybrid
- `job_type`: 工作类型:full_time, part_time, contract, temporary, volunteer, i
- `easy_apply`: 是否易申请/Filter easy apply jobs
- `has_verifications`: 是否有公司认证/Filter jobs with company verifications
- `under_10_applicants`: 是否少于10个申请者/Filter jobs with under 10 applicants
- `fair_chance_employer`: 是否公平机会雇主/Filter fair chance employer jobs
### `GET /api/v1/linkedin/web/search_people`
**搜索用户/Search people**
Parameters:
- `name`: 搜索关键词/Search keyword for people
- `first_name`: 名/First name
- `last_name`: 姓/Last name
- `title`: 职位/Title
- `company`: 公司/Company
- `school`: 学校/School
- `page`: 页码/Page number
- `geocode_location`: 地理位置代码/Geocode for location (e.g., 103644278 for United Stat
- `current_company`: 当前公司ID/Current company ID
- `profile_language`: 个人资料语言/Profile language
- `industry`: 行业ID/Industry ID
- `service_category`: 服务类别ID/Service category ID
## /api/v1/reddit/app
### `GET /api/v1/reddit/app/fetch_home_feed`
**获取Reddit APP首页推荐内容/Fetch Reddit APP Home Feed**
Parameters:
- `sort`: 排序方式/Sort method: HOT, NEW, TOP, BEST, CONTROVERSIAL
- `filter_posts`: 过滤掉指定的帖子ID列表/Filter out specified post IDs
- `after`: 分页参数/Pagination parameter for fetching next page
- `need_format`: 是否需要清洗数据/Whether to clean and format the data
### `GET /api/v1/reddit/app/fetch_popular_feed`
**获取Reddit APP流行推荐内容/Fetch Reddit APP Popular Feed**
Parameters:
- `sort`: 排序方式/Sort method: BEST, HOT, NEW, TOP, CONTROVERSIAL, RISING
- `time`: 时间范围/Time range: ALL, HOUR, DAY, WEEK, MONTH, YEAR
- `filter_posts`: 过滤帖子ID列表/Filter post IDs
- `after`: 分页参数/Pagination parameter
- `need_format`: 是否需要清洗数据/Whether to clean and format the data
### `GET /api/v1/reddit/app/fetch_games_feed`
**获取Reddit APP游戏推荐内容/Fetch Reddit APP Games Feed**
Parameters:
- `sort`: 排序方式/Sort method: NEW, HOT, TOP, RISING
- `time`: 时间范围/Time range: ALL, HOUR, DAY, WEEK, MONTH, YEAR
- `after`: 分页参数/Pagination parameter
- `need_format`: 是否需要清洗数据/Whether to clean and format the data
### `GET /api/v1/reddit/app/fetch_news_feed`
**获取Reddit APP资讯推荐内容/Fetch Reddit APP News Feed**
Parameters:
- `subtopic_ids`: 子话题ID列表/Subtopic IDs list
- `after`: 分页参数/Pagination parameter
- `need_format`: 是否需要清洗数据/Whether to clean and format the data
### `GET /api/v1/reddit/app/fetch_post_details`
**获取单个Reddit帖子详情/Fetch Single Reddit Post Details**
Parameters:
- `post_id`*: 帖子ID/Post ID (e.g., t3_1ojnh50)
- `include_comment_id`: 是否包含特定评论ID/Include specific comment ID
- `comment_id`: 评论ID/Comment ID (when include_comment_id is True)
- `need_format`: 是否需要清洗数据/Whether to clean and format the data
### `GET /api/v1/reddit/app/fetch_post_details_batch`
**批量获取Reddit帖子详情(最多5条)/Fetch Reddit Post Details in Batch (Max 5)**
Parameters:
- `post_ids`*: 帖子ID列表,逗号分隔,最多5条/Post IDs comma-separated, max 5 (e.g., t3_1
- `include_comment_id`: 是否包含特定评论ID/Include specific comment ID
- `comment_id`: 评论ID/Comment ID (when include_comment_id is True)
- `need_format`: 是否需要清洗数据/Whether to clean and format the data
### `GET /api/v1/reddit/app/fetch_post_details_batch_large`
**大批量获取Reddit帖子详情(最多30条)/Fetch Reddit Post Details in Large Batch (Max 30)**
Parameters:
- `post_ids`*: 帖子ID列表,逗号分隔,最多30条/Post IDs comma-separated, max 30 (e.g., t3
- `include_comment_id`: 是否包含特定评论ID/Include specific comment ID
- `comment_id`: 评论ID/Comment ID (when include_comment_id is True)
- `need_format`: 是否需要清洗数据/Whether to clean and format the data
### `GET /api/v1/reddit/app/fetch_post_comments`
**获取Reddit APP帖子评论/Fetch Reddit APP Post Comments**
Parameters:
- `post_id`*: 帖子ID/Post ID
- `sort_type`: 排序方式/Sort method: CONFIDENCE, NEW, TOP, HOT, CONTROVERSIAL,
- `after`: 分页参数/Pagination parameter for fetching next page
- `need_format`: 是否需要清洗数据/Whether to clean and format the data
### `GET /api/v1/reddit/app/fetch_comment_replies`
**获取Reddit APP评论回复(二级评论)/Fetch Reddit APP Comment Replies (Sub-comments)**
Parameters:
- `post_id`*: 帖子ID/Post ID (e.g., t3_1qmup73)
- `cursor`*: 评论游标/Comment cursor from more.cursor field (e.g., commenttre
- `sort_type`: 排序方式/Sort method: CONFIDENCE, NEW, TOP, HOT, CONTROVERSIAL,
- `need_format`: 是否需要清洗数据/Whether to clean and format the data
### `GET /api/v1/reddit/app/fetch_subreddit_style`
**获取Reddit APP版块规则样式信息/Fetch Reddit APP Subreddit Rules and Style Info**
Parameters:
- `subreddit_name`: 版块名称/Subreddit name
- `need_format`: 是否需要清洗数据/Whether to clean and format the data
### `GET /api/v1/reddit/app/fetch_subreddit_post_channels`
**获取Reddit APP版块帖子频道信息/Fetch Reddit APP Subreddit Post Channels**
Parameters:
- `subreddit_name`: 版块名称/Subreddit name
- `sort`: 排序方式/Sort method: HOT, NEW, TOP, CONTROVERSIAL, RISING
- `range`: 时间范围/Time range: HOUR, DAY, WEEK, MONTH, YEAR, ALL
- `need_format`: 是否需要清洗数据/Whether to clean and format the data
### `GET /api/v1/reddit/app/fetch_subreddit_info`
**获取Reddit APP版块信息/Fetch Reddit APP Subreddit Info**
Parameters:
- `subreddit_name`: 版块名称/Subreddit name
- `need_format`: 是否需要清洗数据/Whether to clean and format the data
### `GET /api/v1/reddit/app/fetch_subreddit_settings`
**获取Reddit APP版块设置/Fetch Reddit APP Subreddit Settings**
Parameters:
- `subreddit_id`*: 版块ID/Subreddit ID (format: t5_xxxxx)
- `need_format`: 是否需要清洗数据/Whether to clean and format the data
### `GET /api/v1/reddit/app/fetch_search_typeahead`
**获取Reddit APP搜索自动补全建议/Fetch Reddit APP Search Typeahead Suggestions**
Parameters:
- `query`*: 搜索关键词/Search query
- `safe_search`: 安全搜索设置/Safe search setting: unset, strict
- `allow_nsfw`: 是否允许NSFW内容/Allow NSFW content: 0 or 1
- `need_format`: 是否需要清洗数据/Whether to clean and format the data
### `GET /api/v1/reddit/app/fetch_dynamic_search`
**获取Reddit APP动态搜索结果/Fetch Reddit APP Dynamic Search Results**
Parameters:
- `query`*: 搜索关键词/Search query
- `search_type`: 搜索类型/Search type: post(帖子), community(社区), comment(评论), medi
- `sort`: 排序方式(仅适用于post/comment/media)/Sort method (only for post/comm
- `time_range`: 时间范围(仅适用于post/media)/Time range (only for post/media): all(所
- `safe_search`: 安全搜索设置/Safe search setting: unset, strict
- `allow_nsfw`: 是否允许NSFW内容/Allow NSFW content: 0, 1
- `after`: 分页参数/Pagination parameter
- `need_format`: 是否需要清洗数据/Whether to clean and format the data
### `GET /api/v1/reddit/app/fetch_community_highlights`
**获取Reddit APP社区亮点/Fetch Reddit APP Community Highlights**
Parameters:
- `subreddit_id`*: 版块ID/Subreddit ID (format: t5_xxxxx)
- `need_format`: 是否需要清洗数据/Whether to clean and format the data
### `GET /api/v1/reddit/app/fetch_trending_searches`
**获取Reddit APP今日热门搜索/Fetch Reddit APP Trending Searches**
Parameters:
- `need_format`: 是否需要清洗数据/Whether to clean and format the data
### `GET /api/v1/reddit/app/fetch_user_profile`
**获取Reddit APP用户资料信息/Fetch Reddit APP User Profile**
Parameters:
- `username`*: 用户名/Username
- `need_format`: 是否需要清洗数据/Whether to clean and format the data
### `GET /api/v1/reddit/app/fetch_user_active_subreddits`
**获取用户活跃的社区列表/Fetch User's Active Subreddits**
Parameters:
- `username`*: 用户名/Username
- `need_format`: 是否需要清洗数据/Whether to clean and format the data
### `GET /api/v1/reddit/app/fetch_user_comments`
**获取用户评论列表/Fetch User Comments**
Parameters:
- `username`*: 用户名/Username
- `sort`: 排序方式/Sort method: NEW, TOP, HOT, CONTROVERSIAL
- `page_size`: 每页数量/Page size (default: 25)
- `after`: 分页参数/Pagination parameter
- `need_format`: 是否需要清洗数据/Whether to clean and format the data
### `GET /api/v1/reddit/app/fetch_user_posts`
**获取用户发布的帖子列表/Fetch User Posts**
Parameters:
- `username`*: 用户名/Username
- `sort`: 排序方式/Sort method: NEW, TOP, HOT, CONTROVERSIAL
- `after`: 分页参数/Pagination parameter
- `need_format`: 是否需要清洗数据/Whether to clean and format the data
### `GET /api/v1/reddit/app/fetch_subreddit_feed`
**获取Reddit APP版块Feed内容/Fetch Reddit APP Subreddit Feed**
Parameters:
- `subreddit_name`*: 版块名称/Subreddit name
- `sort`: 排序方式/Sort method: BEST, HOT, NEW, TOP, CONTROVERSIAL, RISING
- `filter_posts`: 过滤帖子ID列表/Filter post IDs
- `after`: 分页参数/Pagination parameter
- `need_format`: 是否需要清洗数据/Whether to clean and format the data
### `GET /api/v1/reddit/app/check_subreddit_muted`
**检查版块是否静音/Check if Subreddit is Muted**
Parameters:
- `subreddit_id`*: 版块ID/Subreddit ID (format: t5_xxxxx)
- `need_format`: 是否需要清洗数据/Whether to clean and format the data
### `GET /api/v1/reddit/app/fetch_user_trophies`
**获取用户公开奖杯/Fetch User Public Trophies**
Parameters:
- `username`*: 用户名/Username
- `need_format`: 是否需要清洗数据/Whether to clean and format the data
FILE:references/tiktok.md
# Tiktok API Reference
Total endpoints: 197
## /api/v1/tiktok/web
### `GET /api/v1/tiktok/web/fetch_post_detail`
**获取单个作品数据/Get single video data**
Parameters:
- `itemId`*: 作品id/Video id
### `GET /api/v1/tiktok/web/fetch_post_detail_v2`
**获取单个作品数据 V2/Get single video data V2**
Parameters:
- `itemId`*: 作品id/Video id
### `GET /api/v1/tiktok/web/fetch_explore_post`
**获取探索作品数据/Get explore video data**
Parameters:
- `categoryType`: 作品分类/Video category
- `count`: 每页数量/Number per page
### `GET /api/v1/tiktok/web/fetch_trending_post`
**获取每日热门内容作品数据/Get daily trending video data**
### `GET /api/v1/tiktok/web/fetch_trending_searchwords`
**获取每日趋势搜索关键词/Get daily trending search words**
### `GET /api/v1/tiktok/web/fetch_user_profile`
**获取用户的个人信息/Get user profile**
Parameters:
- `uniqueId`: 用户uniqueId/User uniqueId
- `secUid`: 用户secUid/User secUid
### `GET /api/v1/tiktok/web/fetch_user_post`
**获取用户的作品列表/Get user posts**
Parameters:
- `secUid`*: 用户secUid/User secUid
- `cursor`: 翻页游标/Page cursor
- `count`: 每页数量/Number per page
- `coverFormat`: 封面格式/Cover format
- `post_item_list_request_type`: 排序方式/Sort type
### `GET /api/v1/tiktok/web/fetch_user_repost`
**获取用户的转发作品列表/Get user reposts**
Parameters:
- `secUid`*: 用户secUid/User secUid
- `cursor`: 翻页游标/Page cursor
- `count`: 每页数量/Number per page
- `coverFormat`: 封面格式/Cover format
### `GET /api/v1/tiktok/web/fetch_user_like`
**获取用户的点赞列表/Get user likes**
Parameters:
- `secUid`*: 用户secUid/User secUid
- `cursor`: 翻页游标/Page cursor
- `count`: 每页数量/Number per page
- `coverFormat`: 封面格式/Cover format
- `post_item_list_request_type`: 排序方式/Sort type
### `GET /api/v1/tiktok/web/fetch_user_collect`
**获取用户的收藏列表/Get user favorites**
Parameters:
- `cookie`*: 用户cookie/User cookie
- `secUid`*: 用户secUid/User secUid
- `cursor`: 翻页游标/Page cursor
- `count`: 每页数量/Number per page
- `coverFormat`: 封面格式/Cover format
### `GET /api/v1/tiktok/web/fetch_user_play_list`
**获取用户的播放列表/Get user play list**
Parameters:
- `secUid`*: 用户secUid/User secUid
- `cursor`: 翻页游标/Page cursor
- `count`: 每页数量/Number per page
### `GET /api/v1/tiktok/web/fetch_user_mix`
**获取用户的合辑列表/Get user mix list**
Parameters:
- `mixId`*: 合辑id/Mix id
- `cursor`: 翻页游标/Page cursor
- `count`: 每页数量/Number per page
### `GET /api/v1/tiktok/web/fetch_post_comment`
**获取作品的评论列表/Get video comments**
Parameters:
- `aweme_id`*: 作品id/Video id
- `cursor`: 翻页游标/Page cursor
- `count`: 每页数量/Number per page
- `current_region`: 当前地区/Current region
### `GET /api/v1/tiktok/web/fetch_post_comment_reply`
**获取作品的评论回复列表/Get video comment replies**
Parameters:
- `item_id`*: 作品id/Video id
- `comment_id`*: 评论id/Comment id
- `cursor`: 翻页游标/Page cursor
- `count`: 每页数量/Number per page
- `current_region`: 当前地区/Current region
### `GET /api/v1/tiktok/web/fetch_user_fans`
**获取用户的粉丝列表/Get user followers**
Parameters:
- `secUid`*: 用户secUid/User secUid
- `count`: 每页数量/Number per page
- `maxCursor`: 最大游标/Max cursor
- `minCursor`: 最小游标/Min cursor
### `GET /api/v1/tiktok/web/fetch_user_follow`
**获取用户的关注列表/Get user followings**
Parameters:
- `secUid`*: 用户secUid/User secUid
- `count`: 每页数量/Number per page
- `maxCursor`: 最大游标/Max cursor
- `minCursor`: 最小游标/Min cursor
### `GET /api/v1/tiktok/web/fetch_user_live_detail`
**获取用户的直播详情/Get user live details**
Parameters:
- `uniqueId`*: 用户uniqueId/User uniqueId
### `GET /api/v1/tiktok/web/fetch_general_search`
**获取综合搜索列表/Get general search list**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `offset`: 翻页游标/Page cursor
- `search_id`: 搜索id,翻页时需要提供/Search id, need to provide when paging
- `cookie`: 用户cookie(按需提供)/User cookie(if needed)
### `GET /api/v1/tiktok/web/fetch_search_keyword_suggest`
**搜索关键字推荐/Search keyword suggest**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
### `GET /api/v1/tiktok/web/fetch_search_user`
**搜索用户/Search user**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `cursor`: 翻页游标/Page cursor
- `search_id`: 搜索id,翻页时需要提供/Search id, need to provide when paging
- `cookie`: 用户cookie(按需提供)/User cookie(if needed)
### `GET /api/v1/tiktok/web/fetch_search_video`
**搜索视频/Search video**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `count`: 每页数量/Number per page
- `offset`: 翻页游标/Page cursor
- `search_id`: 搜索id,翻页时需要提供/Search id, need to provide when paging
- `cookie`: 用户cookie(按需提供)/User cookie(if needed)
### `GET /api/v1/tiktok/web/fetch_search_live`
**搜索直播/Search live**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `count`: 每页数量/Number per page
- `offset`: 翻页游标/Page cursor
- `search_id`: 搜索id,翻页时需要提供/Search id, need to provide when paging
- `cookie`: 用户cookie(按需提供)/User cookie(if needed)
### `GET /api/v1/tiktok/web/fetch_search_photo`
**搜索照片/Search photo**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `count`: 每页数量/Number per page
- `offset`: 翻页游标/Page offset
- `search_id`: 搜索id,翻页时需要提供/Search id, need to provide when paging
- `cookie`: 用户cookie(按需提供)/User cookie(if needed)
### `GET /api/v1/tiktok/web/fetch_tag_detail`
**Tag详情/Tag Detail**
Parameters:
- `tag_name`*: Tag名称/Tag name
### `GET /api/v1/tiktok/web/fetch_tag_post`
**Tag作品/Tag Post**
Parameters:
- `challengeID`*: Tag ID
- `count`: 每页数量/Number per page
- `cursor`: 翻页游标/Page cursor
### `POST /api/v1/tiktok/web/fetch_home_feed`
**首页推荐作品/Home Feed**
### `GET /api/v1/tiktok/web/generate_real_msToken`
**生成真实msToken/Generate real msToken**
Parameters:
- `random_strData`:
- `browser_type`:
### `GET /api/v1/tiktok/web/encrypt_strData`
**加密strData/Encrypt strData**
Parameters:
- `data`*: 原始指纹数据字符串(JSON格式或字典字符串)/Raw fingerprint data string (JSON fo
### `GET /api/v1/tiktok/web/decrypt_strData`
**解密strData/Decrypt strData**
Parameters:
- `encrypted_data`*: 加密后的strData字符串/Encrypted strData string
### `GET /api/v1/tiktok/web/generate_fingerprint`
**生成浏览器指纹/Generate browser fingerprint**
Parameters:
- `browser_type`:
### `GET /api/v1/tiktok/web/generate_webid`
**生成web_id/Generate web_id**
Parameters:
- `cookie`:
- `user_agent`:
- `url`:
- `referer`:
- `user_unique_id`:
- `app_id`:
### `GET /api/v1/tiktok/web/generate_ttwid`
**生成ttwid/Generate ttwid**
Parameters:
- `user_agent`:
### `POST /api/v1/tiktok/web/generate_xbogus`
**生成 XBogus/Generate XBogus**
### `POST /api/v1/tiktok/web/generate_xgnarly`
**生成 XGnarly /Generate XGnarly**
### `POST /api/v1/tiktok/web/generate_xgnarly_and_xbogus`
**生成 XGnarly 和 XBogus /Generate XGnarly and XBogus**
### `GET /api/v1/tiktok/web/get_user_id`
**提取用户user_id/Extract user user_id**
Parameters:
- `url`*: 用户主页链接/User homepage link
### `GET /api/v1/tiktok/web/get_sec_user_id`
**提取用户sec_user_id/Extract user sec_user_id**
Parameters:
- `url`*: 用户主页链接/User homepage link
### `POST /api/v1/tiktok/web/get_all_sec_user_id`
**提取列表用户sec_user_id/Extract list user sec_user_id**
### `GET /api/v1/tiktok/web/get_aweme_id`
**提取单个作品id/Extract single video id**
Parameters:
- `url`*: 作品链接/Video link
### `POST /api/v1/tiktok/web/get_all_aweme_id`
**提取列表作品id/Extract list video id**
### `GET /api/v1/tiktok/web/get_unique_id`
**获取用户unique_id/Get user unique_id**
Parameters:
- `url`*: 用户主页链接/User homepage link
### `POST /api/v1/tiktok/web/get_all_unique_id`
**获取列表unique_id/Get list unique_id**
### `GET /api/v1/tiktok/web/tiktok_live_room`
**提取直播间弹幕/Extract live room danmaku**
Parameters:
- `live_room_url`*: 直播间链接/Live room link
- `danmaku_type`*: 消息类型/Message type
### `GET /api/v1/tiktok/web/fetch_live_im_fetch`
**TikTok直播间弹幕参数获取/tiktok live room danmaku parameters**
Parameters:
- `room_id`*: 直播间号/Live room id
- `user_unique_id`*: 用户唯一ID/User unique ID
### `GET /api/v1/tiktok/web/get_live_room_id`
**根据直播间链接提取直播间ID/Extract live room ID from live room link**
Parameters:
- `live_room_url`*: 直播间链接/Live room link
### `GET /api/v1/tiktok/web/fetch_check_live_alive`
**直播间开播状态检测/Live room start status check**
Parameters:
- `room_id`*: 直播间ID/Live room ID
### `GET /api/v1/tiktok/web/fetch_batch_check_live_alive`
**批量直播间开播状态检测/Batch live room start status check**
Parameters:
- `room_ids`*: 直播间ID列表,用英文逗号分隔,最多支持50个/Live room ID list separated by comma
### `GET /api/v1/tiktok/web/fetch_tiktok_live_data`
**通过直播链接获取直播间信息/Get live room information via live link**
Parameters:
- `live_room_url`*: 直播间链接/Live room link
### `GET /api/v1/tiktok/web/fetch_live_recommend`
**获取直播间首页推荐列表/Get live room homepage recommendation list**
Parameters:
- `related_live_tag`*: 相关直播标签/Related live tag
### `GET /api/v1/tiktok/web/fetch_live_gift_list`
**获取直播间礼物列表/Get live room gift list**
Parameters:
- `room_id`: 直播间ID,可选参数/Live room ID, optional parameter
### `GET /api/v1/tiktok/web/fetch_sso_login_qrcode`
**获取SSO登录二维码/Get SSO login QR code**
Parameters:
- `device_id`*: 设备ID/Device ID
- `region`*: 地区/Region
- `proxy`*: 代理/Proxy
### `GET /api/v1/tiktok/web/fetch_sso_login_status`
**获取SSO登录状态/Get SSO login status**
Parameters:
- `token`*: 登录令牌/Login token
- `device_id`*: 设备ID/Device ID
- `verifyFp`*: verifyFp
- `region`*: 地区/Region
- `proxy`*: 代理/Proxy
### `GET /api/v1/tiktok/web/fetch_sso_login_auth`
**认证SSO登录/Authenticate SSO login**
Parameters:
- `device_id`*: 设备ID/Device ID
- `verifyFp`*: verifyFp
- `region`*: 地区/Region
- `proxy`*: 代理/Proxy
### `GET /api/v1/tiktok/web/generate_hashed_id`
**生成哈希ID/Generate hashed ID**
Parameters:
- `email`*: 邮箱地址/Email address
### `POST /api/v1/tiktok/web/fetch_gift_name_by_id`
**根据Gift ID查询礼物名称/Get gift name by gift ID**
### `POST /api/v1/tiktok/web/fetch_gift_names_by_ids`
**批量查询Gift ID对应的礼物名称($0.025/次,建议50个)/Batch get gift names by gift IDs ($0.025/call, suggest 50)**
### `GET /api/v1/tiktok/web/fetch_tiktok_web_guest_cookie`
**获取游客 Cookie/Get the guest Cookie**
Parameters:
- `user_agent`*: 用户浏览器代理/User browser agent
### `GET /api/v1/tiktok/web/device_register`
**设备注册/Register device for TikTok Web**
## /api/v1/tiktok/app
### `GET /api/v1/tiktok/app/v3/fetch_one_video`
**获取单个作品数据/Get single video data**
Parameters:
- `aweme_id`*: 作品id/Video id
### `GET /api/v1/tiktok/app/v3/fetch_one_video_v2`
**获取单个作品数据 V2/Get single video data V2**
Parameters:
- `aweme_id`*: 作品id/Video id
### `GET /api/v1/tiktok/app/v3/fetch_one_video_v3`
**获取单个作品数据 V3(支持国家参数)/Get single video data V3 (support country parameter)**
Parameters:
- `aweme_id`*: 作品id/Video id
- `region`: 国家代码/Country code
### `POST /api/v1/tiktok/app/v3/fetch_multi_video`
**批量获取视频信息/Batch Get Video Information**
### `POST /api/v1/tiktok/app/v3/fetch_multi_video_v2`
**批量获取视频信息 V2/Batch Get Video Information V2**
### `GET /api/v1/tiktok/app/v3/fetch_one_video_by_share_url_v2`
**根据分享链接获取单个作品数据/Get single video data by sharing link**
Parameters:
- `share_url`*: 分享链接/Share link
### `GET /api/v1/tiktok/app/v3/fetch_one_video_by_share_url`
**根据分享链接获取单个作品数据/Get single video data by sharing link**
Parameters:
- `share_url`*: 分享链接/Share link
### `GET /api/v1/tiktok/app/v3/get_user_id_and_sec_user_id_by_username`
**使用用户名获取用户 user_id 和 sec_user_id/Get user_id and sec_user_id by Username**
Parameters:
- `username`*: 用户名/Username
### `GET /api/v1/tiktok/app/v3/handler_user_profile`
**获取指定用户的信息/Get information of specified user**
Parameters:
- `user_id`: 用户uid (可选,纯数字)/User uid (optional, pure number)
- `sec_user_id`: 用户sec_user_id/User sec_user_id
- `unique_id`: 用户unique_id (用户名)/User unique_id (username)
### `GET /api/v1/tiktok/app/v3/fetch_webcast_user_info`
**获取指定 Webcast 用户的信息/Get information of specified Webcast user**
Parameters:
- `user_id`: 用户uid (可选,纯数字)/User uid (optional, pure number)
- `sec_user_id`: 用户sec_user_id/User sec_user_id
### `GET /api/v1/tiktok/app/v3/fetch_user_country_by_username`
**通过用户名获取用户账号国家地区/Get user account country by username**
Parameters:
- `username`*: 用户名/Username
### `GET /api/v1/tiktok/app/v3/fetch_similar_user_recommendations`
**获取类似用户推荐/Similar User Recommendations**
Parameters:
- `sec_uid`*: 用户sec_uid/User sec_uid
- `page_token`: 分页标记/Page token
### `GET /api/v1/tiktok/app/v3/fetch_user_repost_videos`
**获取用户转发的作品数据/Get user repost video data**
Parameters:
- `user_id`*: 用户id/User id
- `offset`: 偏移量/Offset
- `count`: 数量/Number
### `GET /api/v1/tiktok/app/v3/fetch_user_post_videos`
**获取用户主页作品数据 V1/Get user homepage video data V1**
Parameters:
- `sec_user_id`: 用户sec_user_id/User sec_user_id
- `unique_id`: 用户unique_id/User unique_id
- `max_cursor`: 最大游标/Maximum cursor
- `count`: 每页数量/Number per page
- `sort_type`: 排序类型/Sort type
### `GET /api/v1/tiktok/app/v3/fetch_user_post_videos_v2`
**获取用户主页作品数据 V2/Get user homepage video data V2**
Parameters:
- `sec_user_id`: 用户sec_user_id/User sec_user_id
- `unique_id`: 用户unique_id/User unique_id
- `max_cursor`: 最大游标/Maximum cursor
- `count`: 每页数量/Number per page
- `sort_type`: 排序类型/Sort type
### `GET /api/v1/tiktok/app/v3/fetch_user_post_videos_v3`
**获取用户主页作品数据 V3(精简数据-更快速)/Get user homepage video data V3 (simplified data - faster)**
Parameters:
- `sec_user_id`: 用户sec_user_id/User sec_user_id
- `unique_id`: 用户unique_id/User unique_id
- `max_cursor`: 最大游标/Maximum cursor
- `count`: 每页数量/Number per page
- `sort_type`: 排序类型/Sort type
### `GET /api/v1/tiktok/app/v3/fetch_user_like_videos`
**获取用户喜欢作品数据/Get user like video data**
Parameters:
- `sec_user_id`*: 用户sec_user_id/User sec_user_id
- `max_cursor`: 最大游标/Maximum cursor
- `counts`: 每页数量/Number per page
### `GET /api/v1/tiktok/app/v3/fetch_video_comments`
**获取单个视频评论数据/Get single video comments data**
Parameters:
- `aweme_id`*: 作品id/Video id
- `cursor`: 游标/Cursor
- `count`: 数量/Number
### `GET /api/v1/tiktok/app/v3/fetch_video_comment_replies`
**获取指定视频的评论回复数据/Get comment replies data of specified video**
Parameters:
- `item_id`*: 作品id/Video id
- `comment_id`*: 评论id/Comment id
- `cursor`: 游标/Cursor
- `count`: 数量/Number
### `GET /api/v1/tiktok/app/v3/fetch_general_search_result`
**获取指定关键词的综合搜索结果/Get comprehensive search results of specified keywords**
Parameters:
- `keyword`*: 关键词/Keyword
- `offset`: 偏移量/Offset
- `count`: 数量/Number
- `sort_type`: 排序类型/Sort type
- `publish_time`: 发布时间/Publish time
### `GET /api/v1/tiktok/app/v3/fetch_video_search_result`
**获取指定关键词的视频搜索结果/Get video search results of specified keywords**
Parameters:
- `keyword`*: 关键词/Keyword
- `offset`: 偏移量/Offset
- `count`: 数量/Number
- `sort_type`: 排序类型/Sort type
- `publish_time`: 发布时间/Publish time
- `region`: 地区/Region
### `GET /api/v1/tiktok/app/v3/fetch_user_search_result`
**获取指定关键词的用户搜索结果/Get user search results of specified keywords**
Parameters:
- `keyword`*: 关键词/Keyword
- `offset`: 偏移量/Offset
- `count`: 数量/Number
- `user_search_follower_count`: 根据粉丝数排序/Sort by number of followers
- `user_search_profile_type`: 根据账号类型排序/Sort by account type
- `user_search_other_pref`: 根据其他偏好排序/Sort by other preferences
### `GET /api/v1/tiktok/app/v3/fetch_music_search_result`
**获取指定关键词的音乐搜索结果/Get music search results of specified keywords**
Parameters:
- `keyword`*: 关键词/Keyword
- `offset`: 偏移量/Offset
- `count`: 数量/Number
- `filter_by`: 过滤类型/Filter type
- `sort_type`: 排序类型/Sort type
- `region`: 地区/Region
### `GET /api/v1/tiktok/app/v3/fetch_hashtag_search_result`
**获取指定关键词的话题搜索结果/Get hashtag search results of specified keywords**
Parameters:
- `keyword`*: 关键词/Keyword
- `offset`: 偏移量/Offset
- `count`: 数量/Number
### `GET /api/v1/tiktok/app/v3/fetch_live_search_result`
**获取指定关键词的直播搜索结果/Get live search results of specified keywords**
Parameters:
- `keyword`*: 关键词/Keyword
- `offset`: 偏移量/Offset
- `count`: 数量/Number
- `region`: 地区/Region
### `GET /api/v1/tiktok/app/v3/fetch_location_search`
**获取地点搜索结果/Get location search results**
Parameters:
- `keyword`*: 关键词/Keyword
- `offset`: 偏移量/Offset
- `count`: 数量/Number
### `GET /api/v1/tiktok/app/v3/fetch_music_detail`
**获取指定音乐的详情数据/Get details of specified music**
Parameters:
- `music_id`*: 音乐id/Music id
### `GET /api/v1/tiktok/app/v3/fetch_music_video_list`
**获取指定音乐的视频列表数据/Get video list of specified music**
Parameters:
- `music_id`*: 音乐id/Music id
- `cursor`: 游标/Cursor
- `count`: 数量/Number
### `GET /api/v1/tiktok/app/v3/fetch_hashtag_detail`
**获取指定话题的详情数据/Get details of specified hashtag**
Parameters:
- `ch_id`*: 话题id/Hashtag id
### `GET /api/v1/tiktok/app/v3/fetch_hashtag_video_list`
**获取指定话题的作品数据/Get video list of specified hashtag**
Parameters:
- `ch_id`*: 话题id/Hashtag id
- `cursor`: 游标/Cursor
- `count`: 数量/Number
### `GET /api/v1/tiktok/app/v3/fetch_user_follower_list`
**获取指定用户的粉丝列表数据/Get follower list of specified user**
Parameters:
- `user_id`: 用户ID/User ID (与sec_user_id二选一/One of user_id and sec_user_id
- `sec_user_id`: 用户sec_user_id/User sec_user_id (与user_id二选一/One of user_id a
- `count`: 数量/Number
- `min_time`: 最小时间,用于翻页/Minimum time for paging
- `page_token`: 翻页token/Page token
### `GET /api/v1/tiktok/app/v3/fetch_user_following_list`
**获取指定用户的关注列表数据/Get following list of specified user**
Parameters:
- `user_id`: 用户ID/User ID (与sec_user_id二选一/One of user_id and sec_user_id
- `sec_user_id`: 用户sec_user_id/User sec_user_id (与user_id二选一/One of user_id a
- `count`: 数量/Number
- `min_time`: 最小时间,用于翻页/Minimum time for paging
- `page_token`: 翻页token/Page token
### `GET /api/v1/tiktok/app/v3/fetch_creator_search_insights`
**创作者搜索洞察/Creator Search Insights**
Parameters:
- `offset`: 分页偏移量/Pagination offset
- `limit`: 每页数量/Number per page
- `tab`: 标签页类型/Tab type (all/content_gap/follower_searched/life_style
- `language_filters`: 语言过滤器,多个用逗号分隔/Language filters (id/de/en/es/fr/pt/vi/tr/ar/t
- `category_filters`: 分类过滤器,多个用逗号分隔/Category filters (Gaming/Fashion/Tourism/Scien
- `creator_source`: 创作者来源/Creator source
- `force_refresh`: 是否强制刷新/Force refresh
### `GET /api/v1/tiktok/app/v3/fetch_creator_search_insights_detail`
**创作者搜索洞察详情/Creator Search Insights Detail**
Parameters:
- `query_id_str`*: 搜索词条ID,从 fetch_creator_search_insights 接口获取/Query ID from fe
- `time_range`: 时间范围/Time range (past_7_days/past_30_days/past_60_days/past_
- `start_date`: 开始时间戳(秒),仅当 time_range=custom 时生效/Start timestamp (seconds),
- `end_date`: 结束时间戳(秒),仅当 time_range=custom 时生效/End timestamp (seconds), o
- `dimension_list`: 维度列表,多个用逗号分隔/Dimension list (gender/age/country)
### `GET /api/v1/tiktok/app/v3/fetch_creator_search_insights_trend`
**创作者搜索洞察趋势/Creator Search Insights Trend**
Parameters:
- `query_id_str`*: 搜索词条ID,从 fetch_creator_search_insights 接口获取/Query ID from fe
- `from_tab_path`: 来源标签路径/From tab path
- `query_analysis_required`: 是否需要查询分析/Whether query analysis is required
### `GET /api/v1/tiktok/app/v3/fetch_creator_search_insights_videos`
**创作者搜索洞察相关视频/Creator Search Insights Videos**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `offset`: 分页偏移量/Pagination offset
- `count`: 每页数量/Number per page
### `GET /api/v1/tiktok/app/v3/fetch_music_chart_list`
**音乐排行榜/Music Chart List**
Parameters:
- `scene`: 排行榜类型/Chart type (0: Top 50, 1: Viral 50)
- `cursor`: 分页游标/Pagination cursor
- `count`: 每页数量/Number per page (max 50)
### `GET /api/v1/tiktok/app/v3/search_follower_list`
**搜索粉丝列表/Search follower list**
Parameters:
- `user_id`*: 用户ID/User ID
- `keyword`*: 搜索关键词/Search keyword
### `GET /api/v1/tiktok/app/v3/search_following_list`
**搜索关注列表/Search following list**
Parameters:
- `user_id`*: 用户ID/User ID
- `keyword`*: 搜索关键词/Search keyword
### `GET /api/v1/tiktok/app/v3/fetch_live_room_info`
**获取指定直播间的数据/Get data of specified live room**
Parameters:
- `room_id`*: 直播间id/Live room id
### `GET /api/v1/tiktok/app/v3/fetch_live_ranking_list`
**获取直播间排行榜数据/Get live room ranking list**
Parameters:
- `room_id`*: 直播间id/Live room id
- `anchor_id`*: 主播id/Anchor id
### `GET /api/v1/tiktok/app/v3/check_live_room_online`
**检测直播间是否在线/Check if live room is online**
Parameters:
- `room_id`*: 直播间id/Live room id
### `POST /api/v1/tiktok/app/v3/check_live_room_online_batch`
**批量检测直播间是否在线/Batch check if live rooms are online**
### `GET /api/v1/tiktok/app/v3/fetch_share_short_link`
**获取分享短链接/Get share short link**
Parameters:
- `url`*: 分享链接/Share link
### `GET /api/v1/tiktok/app/v3/fetch_share_qr_code`
**获取分享二维码/Get share QR code**
Parameters:
- `object_id`*: 对象id/Object id
- `schema_type`: 模式类型/Schema type
### `GET /api/v1/tiktok/app/v3/fetch_product_search`
**获取商品搜索结果/Get product search results**
Parameters:
- `keyword`*: 关键词/Keyword
- `cursor`: 游标/Cursor
- `count`: 数量/Number
- `sort_type`: 商品排序条件/Product sorting conditions
- `customer_review_four_star`: 四星以上评价/Four-star or more reviews
- `have_discount`: 有优惠/Having discount
- `min_price`: 最低价格/Minimum price
- `max_price`: 最高价格/Maximum price
### `GET /api/v1/tiktok/app/v3/fetch_creator_info`
**获取带货创作者信息/Get shopping creator information**
Parameters:
- `creator_uid`*: 创作者uid/Creator uid
### `GET /api/v1/tiktok/app/v3/fetch_creator_showcase_product_list`
**获取创作者橱窗商品列表/Get creator showcase product list**
Parameters:
- `kol_id`*: 创作者的sec_user_id/Creator's sec_user_id
- `count`: 数量/Number
- `next_scroll_param`: 翻页参数/Page parameter
### `GET /api/v1/tiktok/app/v3/fetch_shop_id_by_share_link`
**通过分享链接获取店铺ID/Get Shop ID by Share Link**
Parameters:
- `share_link`*: 分享链接/Share link
### `GET /api/v1/tiktok/app/v3/fetch_product_id_by_share_link`
**通过分享链接获取商品ID/Get Product ID by Share Link**
Parameters:
- `share_link`*: 分享链接/Share link
### `GET /api/v1/tiktok/app/v3/fetch_product_detail`
**获取商品详情数据(即将弃用,使用 fetch_product_detail_v2 代替)/Get product detail data (will be deprecated, use fetch_product_detail_v2 instead)**
Parameters:
- `product_id`*: 商品id/Product id
### `GET /api/v1/tiktok/app/v3/fetch_product_detail_v2`
**获取商品详情数据V2/Get product detail data V2**
Parameters:
- `product_id`*: 商品id/Product id
### `GET /api/v1/tiktok/app/v3/fetch_product_detail_v3`
**获取商品详情数据V3 / Get product detail data V3**
Parameters:
- `product_id`*: 商品id / Product ID
- `region`: 商品的国家/地区代码/ Country/region code of the product
### `GET /api/v1/tiktok/app/v3/fetch_product_detail_v4`
**获取商品详情数据V4 / Get product detail data V4**
Parameters:
- `product_id`*: 商品id / Product ID
- `region`: 商品的国家/地区代码/ Country/region code of the product
### `GET /api/v1/tiktok/app/v3/fetch_product_review`
**获取商品评价数据/Get product review data**
Parameters:
- `product_id`*: 商品id/Product id
- `cursor`: 游标/Cursor
- `size`: 数量/Number
- `filter_id`: 筛选条件/Filter condition
- `sort_type`: 排序条件/Sorting conditions
### `GET /api/v1/tiktok/app/v3/fetch_shop_home_page_list`
**获取商家主页Page列表数据/Get shop home page list data**
Parameters:
- `seller_id`*: 商家id,店铺id/Seller id, shop id
### `GET /api/v1/tiktok/app/v3/fetch_shop_home`
**获取商家主页数据/Get shop home page data**
Parameters:
- `page_id`*: 爬取的商家主页Page id/Page id of the crawled shop home page
- `seller_id`*: 商家id,店铺id/Seller id, shop id
### `GET /api/v1/tiktok/app/v3/fetch_shop_product_recommend`
**获取商家商品推荐数据/Get shop product recommend data**
Parameters:
- `seller_id`*: 商家id,店铺id/Seller id, shop id
- `scroll_param`: 滚动参数,用于加载更多商品数据/Scroll parameter, used to load more product
- `page_size`: 每页数量/Number per page
### `GET /api/v1/tiktok/app/v3/fetch_shop_product_list`
**获取商家商品列表数据/Get shop product list data**
Parameters:
- `seller_id`*: 商家id,店铺id/Seller id, shop id
- `scroll_params`: 滚动参数,用于加载更多商品数据/Scroll parameter, used to load more product
- `page_size`: 每页数量/Number per page
- `sort_field`: 排序字段/Sorting field
- `sort_order`: 排序方式/Sorting method
### `GET /api/v1/tiktok/app/v3/fetch_shop_product_list_v2`
**获取商家商品列表数据 V2/Get shop product list data V2**
Parameters:
- `seller_id`*: 商家id,店铺id/Seller id, shop id
- `scroll_params`: 滚动参数,用于加载更多商品数据/Scroll parameter, used to load more product
- `page_size`: 每页数量/Number per page
- `sort_field`: 排序字段/Sorting field
- `sort_order`: 排序方式/Sorting method
### `GET /api/v1/tiktok/app/v3/fetch_shop_info`
**获取商家信息数据/Get shop information data**
Parameters:
- `shop_id`*: 商家id,店铺id/Seller id, shop id
### `GET /api/v1/tiktok/app/v3/fetch_shop_product_category`
**获取商家产品分类数据/Get shop product category data**
Parameters:
- `seller_id`*: 商家id,店铺id/Seller id, shop id
### `GET /api/v1/tiktok/app/v3/fetch_live_daily_rank`
**获取直播每日榜单数据/Get live daily rank data**
Parameters:
- `anchor_id`: 主播id/Anchor id
- `room_id`: 直播间id/Live room id
- `rank_type`: 榜单类型/Rank type
- `region_type`: 地区类型/Region type
- `gap_interval`: 时间间隔/Time interval
- `cookie`: 用户自己的cookie/User's own cookie
### `GET /api/v1/tiktok/app/v3/fetch_user_music_list`
**获取用户音乐列表数据/Get user music list data**
Parameters:
- `sec_uid`*: 用户sec_uid/User sec_uid
- `cursor`: 游标/Cursor
- `count`: 数量/Number
### `POST /api/v1/tiktok/app/v3/fetch_content_translate`
**获取内容翻译数据/Get content translation data**
### `POST /api/v1/tiktok/app/v3/fetch_home_feed`
**获取主页视频推荐数据/Get home feed(recommend) video data**
### `POST /api/v1/tiktok/app/v3/TTencrypt_algorithm`
**TikTok APP加密算法/TikTok APP encryption algorithm**
### `GET /api/v1/tiktok/app/v3/fetch_live_room_product_list`
**获取直播间商品列表数据/Get live room product list data**
Parameters:
- `room_id`*: 直播间id/Live room id
- `author_id`*: 主播id/Anchor id
- `page_size`: 数量/Number
- `offset`: 数量/Number
- `region`: 地区/Region
- `cookie`: 用户自己的cookie/User's own cookie
### `GET /api/v1/tiktok/app/v3/fetch_live_room_product_list_v2`
**获取直播间商品列表数据 V2 /Get live room product list data V2**
Parameters:
- `room_id`*: 直播间id/Live room id
- `author_id`*: 主播id/Anchor id
- `page_size`: 数量/Number
- `offset`: 数量/Number
- `region`: 地区/Region
- `cookie`: 用户自己的cookie/User's own cookie
### `GET /api/v1/tiktok/app/v3/add_video_play_count`
**根据视频ID来增加作品的播放数/Increase the number of plays of the work according to the video ID**
Parameters:
- `aweme_type`*: 作品类型/Video type
- `item_id`*: 作品id/Video id
### `POST /api/v1/tiktok/app/v3/encrypt_decrypt_login_request`
**加密或解密 TikTok APP 登录请求体/Encrypt or Decrypt TikTok APP login request body**
### `GET /api/v1/tiktok/app/v3/open_tiktok_app_to_video_detail`
**生成TikTok分享链接,唤起TikTok APP,跳转指定作品详情页/Generate TikTok share link, call TikTok APP, and jump to the specified video details page**
Parameters:
- `aweme_id`*: 作品id/Video id
### `GET /api/v1/tiktok/app/v3/open_tiktok_app_to_user_profile`
**生成TikTok分享链接,唤起TikTok APP,跳转指定用户主页/Generate TikTok share link, call TikTok APP, and jump to the specified user profile**
Parameters:
- `uid`*: 用户id/User id
### `GET /api/v1/tiktok/app/v3/open_tiktok_app_to_keyword_search`
**生成TikTok分享链接,唤起TikTok APP,跳转指定关键词搜索结果/Generate TikTok share link, call TikTok APP, and jump to the specified keyword search result**
Parameters:
- `keyword`*: 关键词/Keyword
### `GET /api/v1/tiktok/app/v3/open_tiktok_app_to_send_private_message`
**生成TikTok分享链接,唤起TikTok APP,给指定用户发送私信/Generate TikTok share link, call TikTok APP, and send private messages to specified users**
Parameters:
- `uid`*: 用户id/User id
## /api/v1/tiktok/creator
### `POST /api/v1/tiktok/creator/get_account_health_status`
**获取创作者账号健康状态/Get Creator Account Health Status**
### `POST /api/v1/tiktok/creator/get_account_violation_list`
**获取创作者账号违规记录列表/Get Creator Account Violation Record List**
### `POST /api/v1/tiktok/creator/get_account_insights_overview`
**获取创作者账号概览/Get Creator Account Overview**
### `POST /api/v1/tiktok/creator/get_live_analytics_summary`
**获取创作者直播概览/Get Creator Live Overview**
### `POST /api/v1/tiktok/creator/get_video_analytics_summary`
**获取创作者视频概览/Get Creator Video Overview**
### `POST /api/v1/tiktok/creator/get_video_list_analytics`
**获取创作者视频列表分析/Get Creator Video List Analytics**
### `POST /api/v1/tiktok/creator/get_product_analytics_list`
**获取创作者商品列表分析/Get Creator Product List Analytics**
### `POST /api/v1/tiktok/creator/get_creator_account_info`
**获取创作者账号信息/Get Creator Account Info**
### `POST /api/v1/tiktok/creator/get_showcase_product_list`
**获取橱窗商品列表/Get Showcase Product List**
### `POST /api/v1/tiktok/creator/get_video_associated_product_list`
**获取视频关联商品列表/Get Video Associated Product List**
### `POST /api/v1/tiktok/creator/get_video_detailed_stats`
**获取视频详细分段统计数据/Get Video Detailed Statistics**
### `POST /api/v1/tiktok/creator/get_video_to_product_stats`
**获取视频与商品关联统计数据/Get Video-Product Association Statistics**
### `POST /api/v1/tiktok/creator/get_product_related_videos`
**获取同款商品关联视频/Get Product Related Videos**
### `POST /api/v1/tiktok/creator/get_video_audience_stats`
**获取视频受众分析数据/Get Video Audience Analysis Data**
## /api/v1/tiktok/analytics
### `GET /api/v1/tiktok/analytics/fetch_video_metrics`
**获取作品的统计数据/Get video metrics**
Parameters:
- `item_id`*: 作品id/Video id
### `GET /api/v1/tiktok/analytics/detect_fake_views`
**检测视频虚假流量分析/Detect fake views in video**
Parameters:
- `item_id`*: 作品id/Video id
- `content_category`: 内容分类/Content category, options: default, entertainment, educ
### `GET /api/v1/tiktok/analytics/fetch_comment_keywords`
**获取视频评论关键词分析/Get comment keywords analysis**
Parameters:
- `item_id`*: 作品id/Video id
### `GET /api/v1/tiktok/analytics/fetch_creator_info_and_milestones`
**获取创作者信息和里程碑数据/Get creator info and milestones**
Parameters:
- `user_id`*: 用户id/User id
## /api/v1/tiktok/ads
### `GET /api/v1/tiktok/ads/get_ads_detail`
**获取单个广告详情/Get single ad detail**
Parameters:
- `ads_id`*: 广告ID/Ad ID
### `GET /api/v1/tiktok/ads/search_ads`
**搜索广告/Search ads**
Parameters:
- `objective`: 广告目标类型/Ad objective (1:流量 2:应用安装 3:转化 4:视频浏览 5:触达 6:潜在客户 7:产
- `like`: 表现排名/Performance rank (1:前1-20% 2:前21-40% 3:前41-60% 4:前61-80
- `period`: 时间段/Time period (days)
- `industry`: 行业ID/Industry ID
- `keyword`: 搜索关键词/Search keyword
- `page`: 页码/Page number
- `limit`: 每页数量/Items per page
- `order_by`: 排序方式/Sort by (for_you, likes)
- `country_code`: 国家代码/Country code
- `ad_format`: 广告格式/Ad format (1:视频)
- `ad_language`: 广告语言/Ad language
- `search_id`: 搜索ID(可选)/Search ID (optional)
### `GET /api/v1/tiktok/ads/get_keyword_insights`
**获取关键词洞察数据/Get keyword insights data**
Parameters:
- `page`: 页码/Page number
- `limit`: 每页数量/Items per page
- `period`: 时间段(天)/Time period (days, 7/30/120/180)
- `country_code`: 国家代码/Country code
- `order_by`: 排序字段/Sort field (post, ctr, click_rate, etc.)
- `order_type`: 排序方式/Sort order (desc, asc)
- `industry`: 行业ID/Industry ID
- `objective`: 广告目标/Ad objective
- `keyword_type`: 关键词类型/Keyword type
- `keyword`: 关键词/Keyword
### `GET /api/v1/tiktok/ads/get_top_products`
**获取热门产品列表/Get top products list**
Parameters:
- `last`: 最近天数/Last days
- `page`: 页码/Page number
- `limit`: 每页数量/Items per page
- `country_code`: 国家代码/Country code
- `first_ecom_category_id`: 电商类目ID,多个用逗号分隔/E-commerce category IDs, comma separated
- `ecom_type`: 电商类型/E-commerce type (l3)
- `period_type`: 时间类型/Period type (last)
- `order_by`: 排序字段/Sort field (post, ctr, cvr)
- `order_type`: 排序方式/Sort order (desc, asc)
### `GET /api/v1/tiktok/ads/get_hashtag_list`
**获取热门标签列表/Get popular hashtags list**
Parameters:
- `page`: 页码/Page number
- `limit`: 每页数量/Items per page
- `period`: 时间范围(天)/Time period (days)
- `country_code`: 国家代码/Country code
- `sort_by`: 排序方式/Sort by (popular, new)
- `industry_id`: 行业ID/Industry ID
- `filter_by`: 筛选条件/Filter (new_on_board)
### `GET /api/v1/tiktok/ads/get_sound_rank_list`
**获取热门音乐排行榜/Get popular sound rankings**
Parameters:
- `period`: 时间范围(天)/Time period (days)
- `page`: 页码/Page number
- `limit`: 每页数量/Items per page
- `rank_type`: 排行类型/Rank type (popular, surging)
- `new_on_board`: 是否只看新上榜/Only new on board
- `commercial_music`: 是否商业音乐/Commercial music only
- `country_code`: 国家代码/Country code
### `GET /api/v1/tiktok/ads/get_keyword_list`
**获取关键词列表/Get keyword list**
Parameters:
- `keyword`: 关键词/Keyword
- `period`: 时间范围(天)/Time period (days)
- `page`: 页码/Page number
- `limit`: 每页数量/Items per page
- `country_code`: 国家代码/Country code
- `industry`: 行业ID列表,逗号分隔/Industry IDs, comma separated
### `GET /api/v1/tiktok/ads/get_top_ads_spotlight`
**获取热门广告聚光灯/Get top ads spotlight**
Parameters:
- `industry`: 行业ID/Industry ID
- `page`: 页码/Page number
- `limit`: 每页数量/Items per page
### `GET /api/v1/tiktok/ads/get_ad_keyframe_analysis`
**获取广告关键帧分析/Get ad keyframe analysis**
Parameters:
- `material_id`*: 广告素材ID/Ad material ID
- `metric`: 分析指标/Analysis metric (retain_ctr, retain_cvr, click_cnt, con
### `GET /api/v1/tiktok/ads/get_ad_percentile`
**获取广告百分位数据/Get ad percentile data**
Parameters:
- `material_id`*: 广告素材ID/Ad material ID
- `metric`: 分析指标/Analysis metric (ctr_percentile, time_attr_conversion_r
- `period_type`: 时间范围(天)/Time period (days)
### `GET /api/v1/tiktok/ads/get_ad_interactive_analysis`
**获取广告互动分析/Get ad interactive analysis**
Parameters:
- `material_id`*: 广告素材ID/Ad material ID
- `metric_type`: 分析类型/Analysis type (ctr, cvr, clicks, conversion, remain)
- `period_type`: 时间范围(天)/Period type (days)
### `GET /api/v1/tiktok/ads/get_recommended_ads`
**获取推荐广告/Get recommended ads**
Parameters:
- `material_id`*: 广告素材ID/Ad material ID
- `industry`: 行业ID/Industry ID
- `country_code`: 国家代码/Country code
### `GET /api/v1/tiktok/ads/get_query_suggestions`
**获取查询建议/Get query suggestions**
Parameters:
- `count`: 建议数量/Suggestion count
- `scenario`: 场景类型/Scenario type
### `GET /api/v1/tiktok/ads/get_keyword_filters`
**获取关键词筛选器/Get keyword filters**
### `GET /api/v1/tiktok/ads/get_related_keywords`
**获取相关关键词/Get related keywords**
Parameters:
- `keyword`: 目标关键词/Target keyword
- `period`: 时间段(天)/Time period (days, 7/30/120)
- `country_code`: 国家/地区代码/Country code
- `rank_type`: 排名类型/Rank type (popular: 热门, breakout: 突破性)
- `content_type`: 内容类型/Content type (keyword, hashtag)
- `page`: 页码/Page number
- `limit`: 每页数量/Items per page
### `GET /api/v1/tiktok/ads/get_keyword_details`
**获取关键词详细信息/Get keyword details**
Parameters:
- `keyword`: 关键词(可选)/Keyword (optional)
- `page`: 页码/Page number
- `limit`: 每页数量/Items per page
- `period`: 时间范围(天)/Time period (days)
- `country_code`: 国家代码/Country code
- `order_by`: 排序字段/Sort field
- `order_type`: 排序方式/Sort order (desc, asc)
- `industry`: 行业ID/Industry ID
- `objective`: 广告目标/Ad objective
- `keyword_type`: 关键词类型/Keyword type
### `GET /api/v1/tiktok/ads/get_creative_patterns`
**获取创意模式排行榜/Get creative pattern rankings**
Parameters:
- `first_industry_id`: 一级行业ID/First industry ID
- `period_type`: 时间周期类型/Period type (week, month)
- `order_field`: 排序字段/Order field (ctr, play_over_rate)
- `order_type`: 排序方式/Sort order (desc, asc)
- `week`: 特定周(可选)/Specific week (optional)
- `page`: 页码/Page number
- `limit`: 每页数量/Items per page
### `GET /api/v1/tiktok/ads/get_product_filters`
**获取产品筛选器/Get product filters**
### `GET /api/v1/tiktok/ads/get_product_metrics`
**获取产品指标数据/Get product metrics**
Parameters:
- `id`*: 产品类目ID/Product category ID
- `last`: 最近天数/Last days
- `metrics`: 指标类型,逗号分隔/Metrics types, comma separated
- `ecom_type`: 电商类型/E-commerce type
- `period_type`: 时间类型/Period type
- `country_code`: 国家代码/Country code
### `GET /api/v1/tiktok/ads/get_product_detail`
**获取产品详细信息/Get product detail**
Parameters:
- `id`*: 产品类目ID/Product category ID
- `last`: 最近天数/Last days
- `ecom_type`: 电商类型/E-commerce type
- `period_type`: 时间类型/Period type
- `country_code`: 国家代码/Country code
### `GET /api/v1/tiktok/ads/get_hashtag_filters`
**获取标签筛选器/Get hashtag filters**
### `GET /api/v1/tiktok/ads/get_hashtag_creator`
**获取标签创作者信息/Get hashtag creator info**
Parameters:
- `hashtag`*: 标签名称,不包含#符号/Hashtag name (without # symbol)
### `GET /api/v1/tiktok/ads/get_sound_filters`
**获取音乐筛选器/Get sound filters**
Parameters:
- `rank_type`: 排行类型/Rank type (popular, surging)
### `GET /api/v1/tiktok/ads/get_sound_detail`
**获取音乐详情/Get sound detail**
Parameters:
- `clip_id`*: 音乐ID/Sound clip ID
- `period`: 时间范围(天)/Time period (days)
- `country_code`: 国家代码/Country code
### `GET /api/v1/tiktok/ads/search_sound_hint`
**搜索音乐提示/Search sound hints**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `period`: 时间范围(天)/Time period (days)
- `page`: 页码/Page number
- `limit`: 每页数量/Items per page
- `rank_type`: 排行类型/Rank type (popular, surging)
- `country_code`: 国家代码/Country code
- `filter_by_checked`: 是否只看已验证/Only verified
- `commercial_music`: 是否商业音乐/Commercial music only
### `GET /api/v1/tiktok/ads/search_sound`
**搜索音乐/Search sounds**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `period`: 时间范围(天)/Time period (days)
- `page`: 页码/Page number
- `limit`: 每页数量/Items per page
- `rank_type`: 排行类型/Rank type (popular, surging)
- `new_on_board`: 是否只看新上榜/Only new on board
- `commercial_music`: 是否商业音乐/Commercial music only
- `country_code`: 国家代码/Country code
### `GET /api/v1/tiktok/ads/get_sound_recommendations`
**获取音乐推荐/Get sound recommendations**
Parameters:
- `clip_id`*: 参考音乐ID/Reference sound clip ID
- `limit`: 推荐数量/Number of recommendations
### `GET /api/v1/tiktok/ads/get_creator_filters`
**获取创作者筛选器/Get creator filters**
### `GET /api/v1/tiktok/ads/get_creator_list`
**获取创作者列表/Get creator list**
Parameters:
- `page`: 页码/Page number
- `limit`: 每页数量/Items per page
- `sort_by`: 排序方式/Sort by (follower, engagement, avg_views)
- `creator_country`: 创作者国家/Creator country
- `audience_country`: 受众国家/Audience country
- `audience_count`: 受众数量筛选/Audience count filter
- `keyword`: 关键词/Keyword
### `GET /api/v1/tiktok/ads/search_creators`
**搜索创作者/Search creators**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `page`: 页码/Page number
- `limit`: 每页数量/Items per page
- `sort_by`: 排序方式/Sort by (follower, avg_views)
- `creator_country`: 创作者国家/Creator country
### `GET /api/v1/tiktok/ads/get_popular_trends`
**获取流行趋势视频/Get popular trend videos**
Parameters:
- `period`: 时间范围(天)/Time period (days)
- `page`: 页码/Page number
- `limit`: 每页数量/Items per page
- `order_by`: 排序字段/Order by (vv, like, comment, repost)
- `country_code`: 国家代码/Country code
## /api/v1/tiktok/shop
### `GET /api/v1/tiktok/shop/web/fetch_product_detail`
**获取商品详情V1(桌面端-数据完整)/Get product detail V1(Full data)**
Parameters:
- `product_id`*: 商品ID/Product ID
- `seller_id`: 卖家ID(可选)/Seller ID (optional)
- `region`: 地区代码/Region code
### `GET /api/v1/tiktok/shop/web/fetch_product_detail_v2`
**获取商品详情V2(移动端-数据少)/Get product detail V2 (Less Data)**
Parameters:
- `product_id`*: 商品ID/Product ID
- `seller_id`: 卖家ID(可选)/Seller ID (optional)
- `region`: 地区代码/Region code
### `GET /api/v1/tiktok/shop/web/fetch_product_detail_v3`
**获取商品详情V3(移动端-数据完整)/Get product detail V3 (Full Data)**
Parameters:
- `product_id`*: 商品ID/Product ID
- `region`: 地区代码/Region code
### `GET /api/v1/tiktok/shop/web/fetch_product_reviews_v1`
**获取商品评论V1/Get product reviews V1**
Parameters:
- `product_id`*: 商品ID/Product ID
- `sort_type`: 排序方式/Sort type: 1=相关性/Relevance, 2=最新/Recent
- `filter_id`: 筛选ID/Filter ID
- `offset`: 分页偏移量/Offset for pagination
### `GET /api/v1/tiktok/shop/web/fetch_product_reviews_v2`
**获取商品评论V2/Get product reviews V2**
Parameters:
- `product_id`*: 商品ID/Product ID
- `page_start`: 起始页码/Page start
- `sort_rule`: 排序规则/Sort rule
- `filter_type`: 筛选类型/Filter type: 1=默认, 2=有图片/视频, 3=真实购买
- `filter_value`: 星级筛选/Star filter: 6=全部, 5-1=对应星级
- `region`: 地区代码/Region code
### `GET /api/v1/tiktok/shop/web/fetch_seller_products_list`
**获取商家商品列表V1/Get seller products list V1**
Parameters:
- `seller_id`*: 卖家ID/Seller ID
- `search_params`: 搜索参数(用于分页)/Search params (for pagination)
- `region`: 地区代码/Region code
### `GET /api/v1/tiktok/shop/web/fetch_seller_products_list_v2`
**获取商家商品列表V2(移动端)/Get seller products list V2 (Mobile)**
Parameters:
- `seller_id`*: 卖家ID/Seller ID
- `searchParams`: 搜索参数/Search params
- `region`: 地区代码/Region code
### `GET /api/v1/tiktok/shop/web/fetch_search_word_suggestion`
**获取搜索关键词建议V1/Get search keyword suggestions V1**
Parameters:
- `search_word`*: 搜索关键词/Search keyword
- `lang`: 语言/Language
- `region`: 地区代码/Region code
### `GET /api/v1/tiktok/shop/web/fetch_search_word_suggestion_v2`
**获取搜索关键词建议V2(移动端)/Get search keyword suggestions V2 (Mobile)**
Parameters:
- `search_word`*: 搜索关键词/Search keyword
- `lang`: 语言/Language
- `region`: 地区代码/Region code
### `GET /api/v1/tiktok/shop/web/fetch_search_products_list`
**搜索商品列表V1/Search products list V1**
Parameters:
- `search_word`*: 搜索关键词/Search keyword
- `offset`: 偏移量/Offset
- `page_token`: 分页标记/Page token
- `region`: 地区代码/Region code
### `GET /api/v1/tiktok/shop/web/fetch_search_products_list_v2`
**搜索商品列表V2(移动端)/Search products list V2 (Mobile)**
Parameters:
- `search_word`*: 搜索关键词/Search keyword
- `offset`: 偏移量/Offset
- `page_token`: 分页标记/Page token
- `region`: 地区代码/Region code
### `GET /api/v1/tiktok/shop/web/fetch_search_products_list_v3`
**搜索商品列表V3/Search products list V3**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `offset`: 偏移量/Offset
- `region`: 地区代码/Region code (Alpha-2)
- `sort_by`: 排序方式/Sort by: RELEVANCE, PRICE_ASC, PRICE_DESC, BEST_SELLERS
- `filters_data`: 筛选数据JSON/Filters data JSON
### `GET /api/v1/tiktok/shop/web/fetch_products_category_list`
**获取商品分类列表/Get product category list**
Parameters:
- `region`: 地区代码/Region code
### `GET /api/v1/tiktok/shop/web/fetch_products_by_category_id`
**根据分类ID获取商品列表/Get products by category ID**
Parameters:
- `category_id`*: 分类ID/Category ID
- `offset`: 翻页偏移量/Offset for pagination
- `region`: 地区代码/Region code
### `GET /api/v1/tiktok/shop/web/fetch_hot_selling_products_list`
**获取热卖商品列表/Get hot selling products list**
Parameters:
- `region`: 地区代码/Region code
- `count`: 返回商品数量/Number of products to return
FILE:references/twitter-threads.md
# Twitter Threads API Reference
Total endpoints: 24
## /api/v1/twitter/web
### `GET /api/v1/twitter/web/fetch_tweet_detail`
**获取单个推文数据/Get single tweet data**
Parameters:
- `tweet_id`*: 推文ID/Tweet ID
### `GET /api/v1/twitter/web/fetch_user_profile`
**获取用户资料/Get user profile**
Parameters:
- `screen_name`: 用户名/Screen Name
- `rest_id`: 用户ID(如果使用用户ID则会忽略用户名)/User ID (If the user ID is used, the u
### `GET /api/v1/twitter/web/fetch_user_post_tweet`
**获取用户发帖/Get user post**
Parameters:
- `screen_name`: 用户名/Screen Name
- `rest_id`: 用户ID/User ID
- `cursor`: 游标/Cursor
### `GET /api/v1/twitter/web/fetch_search_timeline`
**搜索/Search**
Parameters:
- `keyword`*: 搜索关键字/Search Keyword
- `search_type`: 搜索类型/Search Type
- `cursor`: 游标/Cursor
### `GET /api/v1/twitter/web/fetch_post_comments`
**获取评论/Get comments**
Parameters:
- `tweet_id`*: 推文ID/Tweet ID
- `cursor`: 游标/Cursor
### `GET /api/v1/twitter/web/fetch_latest_post_comments`
**获取最新的推文评论/Get the latest tweet comments**
Parameters:
- `tweet_id`*: 推文ID/Tweet ID
- `cursor`: 游标/Cursor
### `GET /api/v1/twitter/web/fetch_user_tweet_replies`
**获取用户推文回复/Get user tweet replies**
Parameters:
- `screen_name`*: 用户名/Screen Name
- `cursor`: 游标/Cursor
### `GET /api/v1/twitter/web/fetch_user_highlights_tweets`
**获取用户高光推文/Get user highlights tweets**
Parameters:
- `userId`*: 用户ID/User ID
- `count`: 数量/Count
- `cursor`: 游标/Cursor
### `GET /api/v1/twitter/web/fetch_user_media`
**获取用户媒体/Get user media**
Parameters:
- `screen_name`*: 用户名/Screen Name
- `rest_id`: 用户ID/User ID
- `cursor`: 翻页游标/Page Cursor
### `GET /api/v1/twitter/web/fetch_retweet_user_list`
**转推用户列表/ReTweet User list**
Parameters:
- `tweet_id`*: 推文ID/Tweet ID
- `cursor`: 游标/Cursor
### `GET /api/v1/twitter/web/fetch_trending`
**趋势/Trending**
Parameters:
- `country`: 国家/Country
### `GET /api/v1/twitter/web/fetch_user_followings`
**用户关注/User Followings**
Parameters:
- `screen_name`*: 用户名/Screen Name
- `cursor`: 游标/Cursor
### `GET /api/v1/twitter/web/fetch_user_followers`
**用户粉丝/User Followers**
Parameters:
- `screen_name`*: 用户名/Screen Name
- `cursor`: 游标/Cursor
## /api/v1/threads/web
### `GET /api/v1/threads/web/fetch_user_info`
**获取用户信息/Get user info**
Parameters:
- `username`*: 用户名/Username
### `GET /api/v1/threads/web/fetch_user_info_by_id`
**根据用户ID获取用户信息/Get user info by ID**
Parameters:
- `user_id`*: 用户ID/User ID
### `GET /api/v1/threads/web/fetch_user_posts`
**获取用户帖子列表/Get user posts**
Parameters:
- `user_id`*: 用户ID/User ID
- `end_cursor`: 分页游标/Pagination cursor (optional)
### `GET /api/v1/threads/web/fetch_user_reposts`
**获取用户转发列表/Get user reposts**
Parameters:
- `user_id`*: 用户ID/User ID
- `end_cursor`: 分页游标/Pagination cursor (optional)
### `GET /api/v1/threads/web/fetch_user_replies`
**获取用户回复列表/Get user replies**
Parameters:
- `user_id`*: 用户ID/User ID
- `end_cursor`: 分页游标/Pagination cursor (optional)
### `GET /api/v1/threads/web/fetch_post_detail`
**获取帖子详情/Get post detail**
Parameters:
- `post_id`*: 帖子ID/Post ID
### `GET /api/v1/threads/web/fetch_post_detail_v2`
**获取帖子详情 V2(支持链接)/Get post detail V2(supports URL)**
Parameters:
- `post_id`: 帖子短代码/Post short code
- `url`: 完整帖子URL/Full post URL
### `GET /api/v1/threads/web/fetch_post_comments`
**获取帖子评论/Get post comments**
Parameters:
- `post_id`*: 帖子ID/Post ID
- `end_cursor`: 分页游标/Pagination cursor (optional)
### `GET /api/v1/threads/web/search_top`
**搜索热门内容/Search top content**
Parameters:
- `query`*: 搜索关键词/Search query
- `end_cursor`: 分页游标/Pagination cursor (optional)
### `GET /api/v1/threads/web/search_recent`
**搜索最新内容/Search recent content**
Parameters:
- `query`*: 搜索关键词/Search query
- `end_cursor`: 分页游标/Pagination cursor (optional)
### `GET /api/v1/threads/web/search_profiles`
**搜索用户档案/Search profiles**
Parameters:
- `query`*: 搜索关键词/Search query
FILE:references/xiaohongshu.md
# Xiaohongshu API Reference
Total endpoints: 68
## /api/v1/xiaohongshu/app_v2
### `GET /api/v1/xiaohongshu/app_v2/get_image_note_detail`
**获取图文笔记详情/Get image note detail**
Parameters:
- `note_id`: 笔记ID/Note ID
- `share_text`: 分享链接/Share link
### `GET /api/v1/xiaohongshu/app_v2/get_video_note_detail`
**获取视频笔记详情/Get video note detail**
Parameters:
- `note_id`: 笔记ID/Note ID
- `share_text`: 分享链接/Share link
### `GET /api/v1/xiaohongshu/app_v2/get_mixed_note_detail`
**获取首页推荐流笔记详情/Get mixed note detail from feed**
Parameters:
- `note_id`: 笔记ID/Note ID
- `share_text`: 分享链接/Share link
### `GET /api/v1/xiaohongshu/app_v2/get_note_comments`
**获取笔记评论列表/Get note comments**
Parameters:
- `note_id`: 笔记ID/Note ID
- `share_text`: 分享链接/Share link
- `cursor`: 分页游标,首次请求留空/Pagination cursor, leave empty for first request
- `index`: 评论索引,首次请求传0/Comment index, pass 0 for first request
- `sort_strategy`: 排序策略/Sort strategy: default, latest_v2, like_count
### `GET /api/v1/xiaohongshu/app_v2/get_note_sub_comments`
**获取笔记二级评论列表/Get note sub comments**
Parameters:
- `note_id`: 笔记ID/Note ID
- `share_text`: 分享链接/Share link
- `comment_id`*: 父评论ID/Parent comment ID
- `cursor`: 分页游标,首次留空,翻页时从$.data.data.cursor中提取cursor值/Pagination cursor
- `index`: 分页索引,首次传1,翻页时从$.data.data.cursor中提取index值/Pagination index,
### `GET /api/v1/xiaohongshu/app_v2/get_user_info`
**获取用户信息/Get user info**
Parameters:
- `user_id`: 用户ID/User ID
- `share_text`: 分享链接/Share link
### `GET /api/v1/xiaohongshu/app_v2/get_user_posted_notes`
**获取用户笔记列表/Get user posted notes**
Parameters:
- `user_id`: 用户ID/User ID
- `share_text`: 分享链接/Share link
- `cursor`: 分页游标,首次请求留空/Pagination cursor, leave empty for first request
### `GET /api/v1/xiaohongshu/app_v2/get_user_faved_notes`
**获取用户收藏笔记列表/Get user faved notes**
Parameters:
- `user_id`: 用户ID/User ID
- `share_text`: 分享链接/Share link
- `cursor`: 分页游标,首次请求留空,翻页时传入上一页最后一条笔记的note_id/Pagination cursor, leave
### `GET /api/v1/xiaohongshu/app_v2/search_notes`
**搜索笔记/Search notes**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `page`: 页码,从1开始/Page number, start from 1
- `sort_type`: 排序方式/Sort type
- `note_type`: 笔记类型/Note type: 不限, 视频笔记, 普通笔记, 直播笔记
- `time_filter`: 发布时间筛选/Time filter: 不限, 一天内, 一周内, 半年内
- `search_id`: 搜索ID,翻页时传入首次搜索返回的值/Search ID for pagination
- `search_session_id`: 搜索会话ID,翻页时传入首次搜索返回的值/Search session ID for pagination
- `source`: 来源/Source
- `ai_mode`: AI模式:0=关闭, 1=开启/AI mode: 0=off, 1=on
### `GET /api/v1/xiaohongshu/app_v2/search_users`
**搜索用户/Search users**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `page`: 页码,从1开始/Page number, start from 1
- `search_id`: 搜索ID,翻页时传入首次搜索返回的值/Search ID for pagination
- `source`: 来源/Source
### `GET /api/v1/xiaohongshu/app_v2/search_images`
**搜索图片/Search images**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `page`: 页码,从1开始/Page number, start from 1
- `search_id`: 搜索ID,翻页时传入首次搜索返回的值/Search ID for pagination
- `search_session_id`: 搜索会话ID,翻页时传入首次搜索返回的值/Search session ID for pagination
- `word_request_id`: 词请求ID,翻页时传入首次搜索返回的值/Word request ID for pagination
- `source`: 来源/Source
### `GET /api/v1/xiaohongshu/app_v2/search_products`
**搜索商品/Search products**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `page`: 页码,从1开始/Page number, start from 1
- `search_id`: 搜索ID,翻页时传入首次搜索返回的值/Search ID for pagination
- `source`: 来源/Source
### `GET /api/v1/xiaohongshu/app_v2/search_groups`
**搜索群聊/Search groups**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `page_no`: 页码,从0开始/Page number, start from 0
- `search_id`: 搜索ID,翻页时传入首次搜索返回的值/Search ID for pagination
- `source`: 来源/Source
- `is_recommend`: 是否推荐:0=否, 1=是/Is recommend: 0=no, 1=yes
### `GET /api/v1/xiaohongshu/app_v2/get_product_detail`
**获取商品详情/Get product detail**
Parameters:
- `sku_id`*: 商品SKU ID/Product SKU ID
- `source`: 来源/Source
- `pre_page`: 前置页面/Previous page
### `GET /api/v1/xiaohongshu/app_v2/get_product_review_overview`
**获取商品评论总览/Get product review overview**
Parameters:
- `sku_id`*: 商品SKU ID/Product SKU ID
- `tab`: 标签类型/Tab type
### `GET /api/v1/xiaohongshu/app_v2/get_product_reviews`
**获取商品评论列表/Get product reviews**
Parameters:
- `sku_id`*: 商品SKU ID/Product SKU ID
- `page`: 页码,从0开始/Page number, start from 0
- `sort_strategy_type`: 排序策略:0=综合排序, 1=最新排序/Sort strategy: 0=general, 1=latest
- `share_pics_only`: 仅看有图评论:0=否, 1=是/Show reviews with images only: 0=no, 1=yes
- `from_page`: 来源页面/From page
### `GET /api/v1/xiaohongshu/app_v2/get_product_recommendations`
**获取商品推荐列表/Get product recommendations**
Parameters:
- `sku_id`*: 商品SKU ID/Product SKU ID
- `cursor_score`: 分页游标,首次请求留空/Pagination cursor, leave empty for first request
- `region`: 地区/Region
### `GET /api/v1/xiaohongshu/app_v2/get_topic_info`
**获取话题详情/Get topic info**
Parameters:
- `page_id`*: 话题页面ID/Topic page ID
- `source`: 来源/Source
- `note_id`: 来源笔记ID,从笔记跳转到话题时传入/Source note ID, pass when jumping from no
### `GET /api/v1/xiaohongshu/app_v2/get_topic_feed`
**获取话题笔记列表/Get topic feed**
Parameters:
- `page_id`*: 话题页面ID/Topic page ID
- `sort`: 排序方式/Sort: trend(最热), time(最新)
- `cursor_score`: 分页游标分数,翻页时传入/Pagination cursor score for next page
- `last_note_id`: 上一页最后一条笔记ID,翻页时传入/Last note ID from previous page
- `last_note_ct`: 上一页最后一条笔记创建时间,翻页时传入/Last note create time from previous page
- `session_id`: 会话ID,翻页时保持一致/Session ID, keep consistent for pagination
- `first_load_time`: 首次加载时间戳,翻页时保持一致/First load timestamp, keep consistent for pa
- `source`: 来源/Source
### `GET /api/v1/xiaohongshu/app_v2/get_creator_inspiration_feed`
**获取创作者推荐灵感列表/Get creator inspiration feed**
Parameters:
- `cursor`: 分页游标,首次请求留空/Pagination cursor, leave empty for first request
- `tab`: 标签类型/Tab type
- `source`: 来源/Source
### `GET /api/v1/xiaohongshu/app_v2/get_creator_hot_inspiration_feed`
**获取创作者热点灵感列表/Get creator hot inspiration feed**
Parameters:
- `cursor`: 分页游标,首次请求留空/Pagination cursor, leave empty for first request
## /api/v1/xiaohongshu/app
### `GET /api/v1/xiaohongshu/app/get_note_info`
**获取笔记信息 V1/Get note info V1**
Parameters:
- `note_id`: 笔记ID/Note ID
- `share_text`: 分享链接/Share link
### `GET /api/v1/xiaohongshu/app/get_note_info_v2`
**获取笔记信息 V2 (蒲公英商家后台)/Get note info V2 (Pugongying Business Backend)**
Parameters:
- `note_id`: 笔记ID/Note ID
- `share_text`: 分享链接/Share link
### `GET /api/v1/xiaohongshu/app/get_note_comments`
**获取笔记评论/Get note comments**
Parameters:
- `note_id`*: 笔记ID/Note ID
- `start`: 翻页游标/Pagination cursor
- `sort_strategy`: 排序策略:1-默认排序,2-最新评论/Sort strategy: 1-default, 2-latest
### `GET /api/v1/xiaohongshu/app/get_sub_comments`
**获取子评论/Get sub comments**
Parameters:
- `note_id`*: 笔记ID/Note ID
- `comment_id`*: 一级评论ID/Parent comment ID
- `start`: 翻页游标/Pagination cursor
### `GET /api/v1/xiaohongshu/app/get_notes_by_topic`
**[已弃用/Deprecated] 根据话题标签获取作品/Get notes by topic**
Parameters:
- `page_id`*: 话题标签ID/Topic tag ID
- `first_load_time`*: 首次请求时间戳(毫秒)/First load timestamp (ms)
- `sort`: 排序方式:hot-综合,time-最新,trend-最热/Sort: hot-comprehensive, time-l
- `session_id`: 会话ID/Session ID
- `last_note_ct`: 最后一条笔记创建时间/Last note create time
- `last_note_id`: 最后一条笔记ID/Last note ID
- `cursor_score`: 游标分数/Cursor score
### `GET /api/v1/xiaohongshu/app/search_notes`
**搜索笔记/Search notes**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `page`*: 页码(从1开始)/Page number (start from 1)
- `search_id`: 搜索ID,翻页时使用/Search ID for pagination
- `session_id`: 会话ID,翻页时使用/Session ID for pagination
- `sort_type`: 排序方式/Sort type
- `filter_note_type`: 笔记类型筛选:不限、视频笔记、普通笔记/Note type filter
- `filter_note_time`: 发布时间筛选:不限、一天内、一周内、半年内/Time filter
### `GET /api/v1/xiaohongshu/app/get_user_info`
**获取用户信息/Get user info**
Parameters:
- `user_id`*: 用户ID/User ID
### `GET /api/v1/xiaohongshu/app/get_user_notes`
**获取用户作品列表/Get user notes**
Parameters:
- `user_id`*: 用户ID/User ID
- `cursor`: 翻页游标/Pagination cursor
### `GET /api/v1/xiaohongshu/app/extract_share_info`
**提取分享链接信息/Extract share link info**
Parameters:
- `share_link`*: 分享链接/Share link
### `GET /api/v1/xiaohongshu/app/get_user_id_and_xsec_token`
**从分享链接中提取用户ID和xsec_token/Extract user ID and xsec_token from share link**
Parameters:
- `share_link`*: 用户分享链接/User share link
### `GET /api/v1/xiaohongshu/app/get_product_detail`
**获取商品详情/Get product detail**
Parameters:
- `sku_id`*: 商品skuId/Product SKU ID
### `GET /api/v1/xiaohongshu/app/search_products`
**搜索商品/Search products**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `page`*: 页码(从1开始)/Page number (start from 1)
- `search_id`: 搜索ID,翻页时使用/Search ID for pagination
- `session_id`: 会话ID,翻页时使用/Session ID for pagination
- `sort`: 排序规则:sales_qty-销量、price_asc-价格升序、price_desc-价格降序/Sort: sales
- `scope`: 搜索范围:purchased-买过的店、following-关注的店/Scope: purchased, followi
- `service_guarantee`: 物流权益,多选用英文逗号分割/Service guarantee, comma separated
- `min_price`: 最低价/Min price
- `max_price`: 最高价/Max price
- `super_promotion`: 标签ID/Promotion tag ID
## /api/v1/xiaohongshu/web_v2
### `GET /api/v1/xiaohongshu/web_v2/fetch_feed_notes`
**获取单一笔记和推荐笔记 V1 (已弃用)/Fetch one note and feed notes V1 (deprecated)**
Parameters:
- `note_id`*: 笔记ID/Note ID
### `GET /api/v1/xiaohongshu/web_v2/fetch_feed_notes_v2`
**获取单一笔记和推荐笔记 V2/Fetch one note and feed notes V2(v2稳定, 推荐使用此接口)**
Parameters:
- `note_id`*: 笔记ID/Note ID
### `GET /api/v1/xiaohongshu/web_v2/fetch_feed_notes_v3`
**获取单一笔记和推荐笔记 V3/Fetch one note and feed notes V3(通过短链获取笔记详情)**
Parameters:
- `short_url`*: 短链/Short URL
### `GET /api/v1/xiaohongshu/web_v2/fetch_feed_notes_v4`
**获取单一笔记和推荐笔记 V4 (互动量有延迟)/Fetch one note and feed notes V4 (interaction volume has a delay)**
Parameters:
- `note_id`*: 笔记ID/Note ID
### `GET /api/v1/xiaohongshu/web_v2/fetch_feed_notes_v5`
**获取单一笔记和推荐笔记 V5 (互动量有缺失)/Fetch one note and feed notes V5 (interaction volume has a missing)**
Parameters:
- `note_id`*: 笔记ID/Note ID
### `GET /api/v1/xiaohongshu/web_v2/fetch_note_image`
**获取小红书笔记图片/Fetch Xiaohongshu note image**
Parameters:
- `note_id`*: 笔记ID/Note ID
### `GET /api/v1/xiaohongshu/web_v2/fetch_search_notes`
**获取搜索笔记/Fetch search notes**
Parameters:
- `keywords`*: 搜索关键词/Search keywords
- `page`: 页码/Page number
- `sort_type`: 排序方式/Sort type
- `note_type`: 笔记类型/Note type
### `GET /api/v1/xiaohongshu/web_v2/fetch_search_users`
**获取搜索用户/Fetch search users**
Parameters:
- `keywords`*: 搜索关键词/Search keywords
- `page`: 页码/Page number
### `GET /api/v1/xiaohongshu/web_v2/fetch_home_notes`
**获取Web用户主页笔记/Fetch web user profile notes**
Parameters:
- `user_id`*: 用户ID/User ID
- `cursor`: 游标/Cursor
### `GET /api/v1/xiaohongshu/web_v2/fetch_home_notes_app`
**获取App用户主页笔记/Fetch App user home notes**
Parameters:
- `user_id`*: 用户ID/User ID
- `cursor`: 游标/Cursor
### `GET /api/v1/xiaohongshu/web_v2/fetch_note_comments`
**获取笔记评论/Fetch note comments**
Parameters:
- `note_id`*: 笔记ID/Note ID
- `cursor`: 游标/Cursor
### `GET /api/v1/xiaohongshu/web_v2/fetch_sub_comments`
**获取子评论/Fetch sub comments**
Parameters:
- `note_id`*: 笔记ID/Note ID
- `comment_id`*: 评论ID/Comment ID
- `cursor`: 游标/Cursor
### `GET /api/v1/xiaohongshu/web_v2/fetch_user_info`
**获取用户信息/Fetch user info**
Parameters:
- `user_id`*: 用户ID/User ID
### `GET /api/v1/xiaohongshu/web_v2/fetch_user_info_app`
**获取App用户信息/Fetch App user info**
Parameters:
- `user_id`*: 用户ID/User ID
### `GET /api/v1/xiaohongshu/web_v2/fetch_follower_list`
**获取用户粉丝列表/Fetch follower list**
Parameters:
- `user_id`*: 用户ID/User ID
- `cursor`: 游标/Cursor
### `GET /api/v1/xiaohongshu/web_v2/fetch_following_list`
**获取用户关注列表/Fetch following list**
Parameters:
- `user_id`*: 用户ID/User ID
- `cursor`: 游标/Cursor
### `GET /api/v1/xiaohongshu/web_v2/fetch_product_list`
**获取小红书商品列表/Fetch Xiaohongshu product list**
Parameters:
- `user_id`*: 用户ID/User ID
- `page`: 页码/Page number
### `GET /api/v1/xiaohongshu/web_v2/fetch_hot_list`
**获取小红书热榜/Fetch Xiaohongshu hot list**
## /api/v1/xiaohongshu/web
### `POST /api/v1/xiaohongshu/web/get_home_recommend`
**获取首页推荐/Get home recommend**
### `GET /api/v1/xiaohongshu/web/get_note_info_v2`
**获取笔记信息 V2/Get note info V2**
Parameters:
- `note_id`: 笔记ID/Note ID
- `share_text`: 分享链接/Share link
### `GET /api/v1/xiaohongshu/web/get_note_info_v4`
**获取笔记信息 V4/Get note info V4**
Parameters:
- `note_id`: 笔记ID/Note ID
- `share_text`: 分享链接/Share link
### `POST /api/v1/xiaohongshu/web/get_note_info_v5`
**获取笔记信息 V5 (自带Cookie)/Get note info V5 (Self-provided Cookie)**
### `GET /api/v1/xiaohongshu/web/get_note_info_v7`
**获取笔记信息 V7/Get note info V7**
Parameters:
- `note_id`: 笔记ID/Note ID
- `share_text`: 分享链接/Share link
### `GET /api/v1/xiaohongshu/web/get_note_comments`
**获取笔记评论 V1/Get note comments V1**
Parameters:
- `note_id`*: 笔记ID/Note ID
- `lastCursor`: 上一页的游标/Last cursor
### `GET /api/v1/xiaohongshu/web/get_note_comment_replies`
**获取笔记评论回复 V1/Get note comment replies V1**
Parameters:
- `note_id`*: 笔记ID/Note ID
- `comment_id`*: 评论ID/Comment ID
- `lastCursor`: 上一页的游标/Last cursor
### `GET /api/v1/xiaohongshu/web/get_user_info`
**获取用户信息 V1/Get user info V1**
Parameters:
- `user_id`*: 用户ID/User ID
### `GET /api/v1/xiaohongshu/web/get_user_info_v2`
**获取用户信息 V2/Get user info V2**
Parameters:
- `user_id`: 用户ID/User ID
- `share_text`: 分享文本或链接/Share text or link
### `GET /api/v1/xiaohongshu/web/search_notes`
**搜索笔记/Search notes**
Parameters:
- `keyword`*: 搜索关键词/Keyword
- `page`: 页码/Page
- `sort`: 排序方式/Sort
- `noteType`: 笔记类型/Note type
- `noteTime`: 发布时间/Release time
### `GET /api/v1/xiaohongshu/web/search_notes_v3`
**搜索笔记 V3/Search notes V3**
Parameters:
- `keyword`*: 搜索关键词/Keyword
- `page`: 页码/Page
- `sort`: 排序方式/Sort
- `noteType`: 笔记类型/Note type
- `noteTime`: 发布时间/Release time
### `GET /api/v1/xiaohongshu/web/search_users`
**搜索用户/Search users**
Parameters:
- `keyword`*: 搜索关键词/Keyword
- `page`: 页码/Page
### `GET /api/v1/xiaohongshu/web/get_user_notes_v2`
**获取用户的笔记 V2/Get user notes V2**
Parameters:
- `user_id`*: 用户ID/User ID
- `lastCursor`: 上一页的游标/Last cursor
### `GET /api/v1/xiaohongshu/web/get_visitor_cookie`
**获取游客Cookie/Get visitor cookie**
Parameters:
- `proxy`: 代理/Proxy
### `POST /api/v1/xiaohongshu/web/sign`
**小红书Web签名/Xiaohongshu Web sign**
### `GET /api/v1/xiaohongshu/web/get_note_id_and_xsec_token`
**通过分享链接获取小红书的Note ID 和 xsec_token/Get Xiaohongshu Note ID and xsec_token by share link**
Parameters:
- `share_text`*: 分享链接/Share link
### `GET /api/v1/xiaohongshu/web/get_product_info`
**获取小红书商品信息/Get Xiaohongshu product info**
Parameters:
- `share_text`: 分享链接/Share link
- `item_id`: 商品ID/Item ID
- `xsec_token`: X-Sec-Token
FILE:references/youtube.md
# Youtube API Reference
Total endpoints: 37
## /api/v1/youtube/web
### `GET /api/v1/youtube/web/get_video_info`
**获取视频信息 V1/Get video information V1**
Parameters:
- `video_id`*: 视频ID/Video ID
- `url_access`: URL访问模式:normal(包含音视频URL)| blocked(不包含音视频URL) / URL access mo
- `lang`: 语言代码(IETF标签),默认en-US / Language code
- `videos`: 视频格式:auto(自动)| true(简化格式)| raw(原始格式)| false(不获取) / Video for
- `audios`: 音频格式:auto(自动)| true(简化格式)| raw(原始格式)| false(不获取) / Audio for
- `subtitles`: 是否获取字幕 / Include subtitles
- `related`: 是否获取相关视频 / Include related content
### `GET /api/v1/youtube/web/get_video_info_v2`
**获取视频信息 V2/Get video information V2**
Parameters:
- `video_id`*: 视频ID/Video ID
### `GET /api/v1/youtube/web/get_video_info_v3`
**获取视频详情 V3/Get video information V3**
Parameters:
- `video_id`*: 视频ID/Video ID
- `language_code`: 语言代码(如zh-CN, en-US等)/Language code
### `GET /api/v1/youtube/web/get_video_subtitles`
**获取视频字幕/Get video subtitles**
Parameters:
- `subtitle_url`*: 字幕URL(需先调用获取视频详情接口) / Subtitle URL from video details
- `format`: 字幕格式:srt/xml/vtt/txt / Subtitle format
- `fix_overlap`: 修复重叠字幕(默认开启) / Fix overlapping subtitles
- `target_lang`: 目标语言代码(留空保持原语言) / Target language code
### `GET /api/v1/youtube/web/get_video_comments`
**获取视频评论/Get video comments**
Parameters:
- `video_id`*: 视频ID/Video ID
- `language_code`: 语言代码(如zh-CN, en-US等)/Language code
- `country_code`: 国家代码(如US, JP等)/Country code
- `sort_by`: 排序方式 | Sort by
- `continuation_token`: 翻页令牌/Pagination token
- `need_format`: 是否需要清洗数据,提取关键内容,移除冗余数据/Whether to clean and format the data
### `GET /api/v1/youtube/web/get_video_comment_replies`
**获取视频二级评论/Get video sub comments**
Parameters:
- `continuation_token`*: 回复的continuation token(从一级评论的reply_continuation_token字段获取)/Re
- `language_code`: 语言代码(如zh-CN, en-US等)/Language code
- `country_code`: 国家代码(如US, JP等)/Country code
- `need_format`: 是否需要清洗数据,提取关键内容,移除冗余数据/Whether to clean and format the data
### `GET /api/v1/youtube/web/get_channel_description`
**获取频道描述信息/Get channel description**
Parameters:
- `channel_id`: 频道ID(格式如:UCeu6U67OzJhV1KwBansH3Dg),可通过get_channel_id_v2接口从频道
- `continuation_token`: 翻页标志(用于获取频道注册时间等高级信息)/Continuation token for getting advance
- `language_code`: 语言代码(如zh-CN, en-US等)/Language code
- `country_code`: 国家代码(如US, JP等)/Country code
- `need_format`: 是否需要清洗数据,提取关键内容,移除冗余数据/Whether to clean and format the data
### `GET /api/v1/youtube/web/get_relate_video`
**获取推荐视频/Get related videos**
Parameters:
- `video_id`*: 视频ID/Video ID
- `continuation_token`: 翻页令牌/Pagination token
### `GET /api/v1/youtube/web/search_video`
**搜索视频/Search video**
Parameters:
- `search_query`*: 搜索关键字/Search keyword
- `language_code`: 语言代码/Language code
- `order_by`: 排序方式/Order by
- `country_code`: 国家代码/Country code
- `continuation_token`: 翻页令牌/Pagination token
### `GET /api/v1/youtube/web/get_general_search`
**综合搜索(支持过滤条件)/General search with filters**
Parameters:
- `search_query`*: 搜索关键字/Search keyword
- `language_code`: 语言代码(如zh-CN, en-US等)/Language code
- `country_code`: 国家代码(如US, CN等)/Country code
- `time_zone`: 时区(如America/Los_Angeles, Asia/Shanghai等)/Time zone
- `upload_time`: 上传时间过滤 | Upload time filter
- `duration`: 视频时长过滤 | Duration filter
- `content_type`: 内容类型过滤 | Content type filter
- `feature`: 特征过滤 | Feature filter
- `sort_by`: 排序方式 | Sort by
- `continuation_token`: 翻页令牌/Pagination token
### `GET /api/v1/youtube/web/get_shorts_search`
**YouTube Shorts短视频搜索/YouTube Shorts search**
Parameters:
- `search_query`*: 搜索关键字/Search keyword
- `language_code`: 语言代码(如zh-CN, en-US等)/Language code
- `country_code`: 国家代码(如US, CN等)/Country code
- `time_zone`: 时区(如America/Los_Angeles, Asia/Shanghai等)/Time zone
- `upload_time`: 上传时间过滤 | Upload time filter for Shorts
- `sort_by`: 排序方式 | Sort by for Shorts
- `continuation_token`: 翻页令牌/Pagination token
- `filter_mixed_content`: 是否过滤混合内容(长视频),默认True / Filter mixed content (long videos), d
### `GET /api/v1/youtube/web/get_channel_id`
**获取频道ID/Get channel ID**
Parameters:
- `channel_name`*: 频道名称/Channel name
### `GET /api/v1/youtube/web/get_channel_id_v2`
**从频道URL获取频道ID V2/Get channel ID from URL V2**
Parameters:
- `channel_url`*: 频道URL/Channel URL,支持多种格式如:https://www.youtube.com/@username,
### `GET /api/v1/youtube/web/get_channel_url`
**从频道ID获取频道URL/Get channel URL from channel ID**
Parameters:
- `channel_id`*: 频道ID/Channel ID (格式如:UCeu6U67OzJhV1KwBansH3Dg)
### `GET /api/v1/youtube/web/get_channel_info`
**获取频道信息/Get channel information**
Parameters:
- `channel_id`*: 频道ID/Channel ID
### `GET /api/v1/youtube/web/get_channel_videos`
**获取频道视频 V1(即将过时,优先使用 V2)/Get channel videos V1 (deprecated soon, use V2 first)**
Parameters:
- `channel_id`*: 频道ID/Channel ID
- `continuation_token`: 翻页令牌/Pagination token
### `GET /api/v1/youtube/web/get_channel_videos_v2`
**获取频道视频 V2/Get channel videos V2**
Parameters:
- `channel_id`*: 频道ID/Channel ID
- `lang`: 视频结果语言代码/Video result language code
- `sortBy`: 排序方式/Sort by
- `contentType`: 内容类型/Content type
- `nextToken`: 翻页令牌/Pagination token
### `GET /api/v1/youtube/web/get_channel_videos_v3`
**获取频道视频 V3/Get channel videos V3**
Parameters:
- `channel_id`*: 频道ID/Channel ID
- `language_code`: 语言代码(如zh-CN, en-US等)/Language code
- `country_code`: 国家代码(如US, JP等)/Country code
- `continuation_token`: 分页token,用于获取下一页/Pagination token for next page
- `need_format`: 是否需要清洗数据,提取关键内容,移除冗余数据/Whether to clean and format the data
### `GET /api/v1/youtube/web/get_channel_short_videos`
**获取频道短视频/Get channel short videos**
Parameters:
- `channel_id`*: 频道ID/Channel ID
- `continuation_token`: 翻页令牌/Pagination token
### `GET /api/v1/youtube/web/search_channel`
**搜索频道/Search channel**
Parameters:
- `channel_id`*: 频道ID/Channel ID
- `search_query`*: 搜索关键字/Search keyword
- `language_code`: 语言代码/Language code
- `country_code`: 国家代码/Country code
- `continuation_token`: 翻页令牌/Pagination token
### `GET /api/v1/youtube/web/get_trending_videos`
**获取趋势视频/Get trending videos**
Parameters:
- `language_code`: 语言代码/Language code
- `country_code`: 国家代码/Country code
- `section`: 类型/Section
## /api/v1/youtube/web_v2
### `GET /api/v1/youtube/web_v2/get_video_info`
**获取视频详情 /Get video information**
Parameters:
- `video_id`*: 视频ID/Video ID
- `language_code`: 语言代码(如zh-CN, en-US等)/Language code
- `need_format`: 是否需要清洗数据,提取关键内容,移除冗余数据/Whether to clean and format the data
### `GET /api/v1/youtube/web_v2/get_video_comments`
**获取视频评论/Get video comments**
Parameters:
- `video_id`*: 视频ID/Video ID
- `language_code`: 语言代码(如zh-CN, en-US等)/Language code
- `country_code`: 国家代码(如US, JP等)/Country code
- `sort_by`: 排序方式 | Sort by
- `continuation_token`: 翻页令牌/Pagination token
- `need_format`: 是否需要清洗数据,提取关键内容,移除冗余数据/Whether to clean and format the data
### `GET /api/v1/youtube/web_v2/get_video_comment_replies`
**获取视频二级评论/Get video sub comments**
Parameters:
- `continuation_token`*: 回复的continuation token(从一级评论的reply_continuation_token字段获取)/Re
- `language_code`: 语言代码(如zh-CN, en-US等)/Language code
- `country_code`: 国家代码(如US, JP等)/Country code
- `need_format`: 是否需要清洗数据,提取关键内容,移除冗余数据/Whether to clean and format the data
### `GET /api/v1/youtube/web_v2/get_channel_description`
**获取频道描述信息/Get channel description**
Parameters:
- `channel_id`: 频道ID(格式如:UCeu6U67OzJhV1KwBansH3Dg),可通过get_channel_id接口从频道URL
- `continuation_token`: 翻页标志(用于获取频道注册时间等高级信息)/Continuation token for getting advance
- `language_code`: 语言代码(如zh-CN, en-US等)/Language code
- `country_code`: 国家代码(如US, JP等)/Country code
- `need_format`: 是否需要清洗数据,提取关键内容,移除冗余数据/Whether to clean and format the data
### `GET /api/v1/youtube/web_v2/get_general_search`
**综合搜索(支持过滤条件)/General search with filters**
Parameters:
- `search_query`*: 搜索关键字/Search keyword
- `language_code`: 语言代码(如zh-CN, en-US等)/Language code
- `country_code`: 国家代码(如US, CN等)/Country code
- `time_zone`: 时区(如America/Los_Angeles, Asia/Shanghai等)/Time zone
- `upload_time`: 上传时间过滤 | Upload time filter
- `duration`: 视频时长过滤 | Duration filter
- `content_type`: 内容类型过滤 | Content type filter
- `feature`: 特征过滤 | Feature filter
- `sort_by`: 排序方式 | Sort by
- `continuation_token`: 翻页令牌/Pagination token
### `GET /api/v1/youtube/web_v2/get_shorts_search`
**YouTube Shorts短视频搜索/YouTube Shorts search**
Parameters:
- `search_query`*: 搜索关键字/Search keyword
- `language_code`: 语言代码(如zh-CN, en-US等)/Language code
- `country_code`: 国家代码(如US, CN等)/Country code
- `time_zone`: 时区(如America/Los_Angeles, Asia/Shanghai等)/Time zone
- `upload_time`: 上传时间过滤 | Upload time filter for Shorts
- `sort_by`: 排序方式 | Sort by for Shorts
- `continuation_token`: 翻页令牌/Pagination token
- `filter_mixed_content`: 是否过滤混合内容(长视频),默认True / Filter mixed content (long videos), d
### `GET /api/v1/youtube/web_v2/get_channel_id`
**从频道URL获取频道ID /Get channel ID from URL**
Parameters:
- `channel_url`*: 频道URL/Channel URL,支持多种格式如:https://www.youtube.com/@username,
### `GET /api/v1/youtube/web_v2/get_channel_url`
**从频道ID获取频道URL/Get channel URL from channel ID**
Parameters:
- `channel_id`*: 频道ID/Channel ID (格式如:UCeu6U67OzJhV1KwBansH3Dg)
### `GET /api/v1/youtube/web_v2/get_channel_videos`
**获取频道视频 /Get channel videos**
Parameters:
- `channel_id`*: 频道ID/Channel ID
- `language_code`: 语言代码(如zh-CN, en-US等)/Language code
- `country_code`: 国家代码(如US, JP等)/Country code
- `continuation_token`: 分页token,用于获取下一页/Pagination token for next page
- `need_format`: 是否需要清洗数据,提取关键内容,移除冗余数据/Whether to clean and format the data
### `GET /api/v1/youtube/web_v2/get_video_streams`
**获取视频流信息/Get video streams info**
Parameters:
- `video_id`: 视频ID/Video ID
- `video_url`: 视频URL/Video URL (如果提供video_id则忽略此参数/Ignored if video_id is p
### `GET /api/v1/youtube/web_v2/get_video_streams_v2`
**获取视频流信息 V2/Get video streams info V2**
Parameters:
- `video_id`: 视频ID/Video ID
- `video_url`: 视频URL/Video URL (如果提供video_id则忽略此参数/Ignored if video_id is p
### `GET /api/v1/youtube/web_v2/get_signed_stream_url`
**获取已签名的视频流URL/Get signed video stream URL**
Parameters:
- `video_id`: 视频ID/Video ID
- `video_url`: 视频URL/Video URL (如果提供video_id则忽略此参数/Ignored if video_id is p
- `itag`*: 格式标识符 itag (从 get_video_streams 接口获取)/Format identifier itag
### `GET /api/v1/youtube/web_v2/get_related_videos`
**获取视频相似内容/Get related videos**
Parameters:
- `video_id`: 视频ID/Video ID
- `video_url`: 视频URL/Video URL (如果提供video_id则忽略此参数/Ignored if video_id is p
- `need_format`: 是否格式化数据。true: 返回格式化的结构化数据,false: 返回原始API结构/Whether to format
### `GET /api/v1/youtube/web_v2/get_channel_shorts`
**获取频道短视频列表/Get channel shorts**
Parameters:
- `channel_id`: 频道ID/Channel ID (e.g., UCuAXFkgsw1L7xaCfnd5JJOw)
- `channel_url`: 频道URL/Channel URL (如果提供channel_id则忽略/Ignored if channel_id i
- `continuation_token`: 分页token/Pagination token
- `need_format`: 是否格式化数据/Whether to format data
### `GET /api/v1/youtube/web_v2/get_search_suggestions`
**获取搜索推荐词/Get search suggestions**
Parameters:
- `keyword`*: 搜索关键词/Search keyword
- `language`: 语言代码/Language code (e.g., en, zh-cn, ja)
- `region`: 地区代码/Region code (e.g., US, SG, CN, JP)
### `GET /api/v1/youtube/web_v2/search_channels`
**搜索频道/Search channels**
Parameters:
- `keyword`: 搜索关键词/Search keyword
- `continuation_token`: 分页token/Pagination token
- `need_format`: 是否格式化数据/Whether to format data
FILE:scripts/tikhub_query.py
#!/usr/bin/env python3
"""TikHub API query helper. Handles auth, proxy, requests, and output formatting.
Usage:
python3 tikhub_query.py <endpoint> [param=value ...] [--method POST] [--body '{}'] [--raw]
Examples:
python3 tikhub_query.py /api/v1/douyin/web/fetch_search keyword=宁德时代
python3 tikhub_query.py /api/v1/tiktok/web/fetch_user_profile secUid=MS4wLjABAAAA...
python3 tikhub_query.py /api/v1/douyin/billboard/fetch_hot_search_list --method POST --body '{}'
python3 tikhub_query.py /api/v1/hybrid/video_data url=https://v.douyin.com/xxx
Environment:
TIKHUB_API_KEY — API key (or set in .env next to SKILL.md)
TIKHUB_PROXY — HTTP proxy for requests (e.g. http://host:port)
Auto-detected from https_proxy/http_proxy if not set.
TIKHUB_TIMEOUT — Request timeout in seconds (default: 30)
"""
import sys, os, json, urllib.request, urllib.parse, urllib.error
BASE_URL = "https://api.tikhub.io"
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
SKILL_DIR = os.path.dirname(SCRIPT_DIR)
def get_api_key():
"""Get API key from env or .env file."""
key = os.environ.get("TIKHUB_API_KEY")
if key:
return key
env_path = os.path.join(SKILL_DIR, ".env")
if os.path.exists(env_path):
with open(env_path) as f:
for line in f:
line = line.strip()
if line.startswith("TIKHUB_API_KEY="):
return line.split("=", 1)[1].strip().strip('"').strip("'")
print("ERROR: TIKHUB_API_KEY not found. Set env var or create .env in skill root.", file=sys.stderr)
sys.exit(1)
def get_proxy():
"""Get proxy URL. TikHub uses Cloudflare (172.67.x) which may need proxy."""
proxy = os.environ.get("TIKHUB_PROXY")
if proxy:
return proxy
# Check .env file
env_path = os.path.join(SKILL_DIR, ".env")
if os.path.exists(env_path):
with open(env_path) as f:
for line in f:
line = line.strip()
if line.startswith("TIKHUB_PROXY="):
val = line.split("=", 1)[1].strip().strip('"').strip("'")
if val:
return val
# Auto-detect from standard env vars
for var in ("https_proxy", "HTTPS_PROXY", "http_proxy", "HTTP_PROXY"):
p = os.environ.get(var)
if p:
return p
return None
def make_request(endpoint, params=None, method="GET", body=None, api_key=None):
"""Make API request and return parsed JSON."""
url = f"{BASE_URL}{endpoint}"
if params and method == "GET":
url += "?" + urllib.parse.urlencode(params)
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
"User-Agent": "TikHub-Skill/1.0"
}
data = None
if method == "POST":
if body:
data = body.encode("utf-8") if isinstance(body, str) else json.dumps(body).encode("utf-8")
elif params:
data = json.dumps(params).encode("utf-8")
# Set up proxy handler
proxy = get_proxy()
if proxy:
proxy_handler = urllib.request.ProxyHandler({
"https": proxy,
"http": proxy
})
opener = urllib.request.build_opener(proxy_handler)
else:
opener = urllib.request.build_opener()
req = urllib.request.Request(url, data=data, headers=headers, method=method)
timeout = int(os.environ.get("TIKHUB_TIMEOUT", "30"))
try:
with opener.open(req, timeout=timeout) as resp:
return json.loads(resp.read().decode("utf-8"))
except urllib.error.HTTPError as e:
error_body = e.read().decode("utf-8", errors="replace")
try:
return json.loads(error_body)
except:
return {"code": e.code, "message": error_body}
except Exception as e:
return {"code": -1, "message": str(e)}
def print_summary(result):
"""Print a human-readable summary to stderr."""
if not isinstance(result, dict):
return
code = result.get("code", "?")
msg = result.get("message_zh") or result.get("message", "")
cache = result.get("cache_url", "")
if code != 200:
print(f"\n⚠️ Code: {code} | {msg}", file=sys.stderr)
return
data = result.get("data")
if isinstance(data, dict):
# Try to count items from common response patterns
for key in ("data", "items", "list", "aweme_list", "medias", "notes",
"user_list", "comments", "statuses", "entries", "threads"):
items = data.get(key)
if isinstance(items, list):
suffix = f" | Cache: {cache[:60]}..." if cache else ""
print(f"\n✅ Success | Items ({key}): {len(items)}{suffix}", file=sys.stderr)
return
suffix = f" | Cache: {cache[:60]}..." if cache else ""
print(f"\n✅ Success | Keys: {list(data.keys())[:8]}{suffix}", file=sys.stderr)
elif isinstance(data, list):
print(f"\n✅ Success | Items: {len(data)}", file=sys.stderr)
else:
print(f"\n✅ Success", file=sys.stderr)
def main():
args = sys.argv[1:]
if not args or args[0] in ("-h", "--help"):
print(__doc__)
sys.exit(0)
endpoint = args[0]
params = {}
method = "GET"
body = None
raw = False
i = 1
while i < len(args):
arg = args[i]
if arg == "--method" and i + 1 < len(args):
method = args[i + 1].upper()
i += 2
elif arg == "--body" and i + 1 < len(args):
body = args[i + 1]
i += 2
elif arg == "--raw":
raw = True
i += 1
elif "=" in arg:
key, val = arg.split("=", 1)
# Try to parse as number/bool
if val.lower() == "true":
val = True
elif val.lower() == "false":
val = False
else:
try:
val = int(val)
except ValueError:
try:
val = float(val)
except ValueError:
pass
params[key] = val
i += 1
else:
i += 1
api_key = get_api_key()
result = make_request(endpoint, params, method, body, api_key)
if raw:
print(json.dumps(result, ensure_ascii=False))
else:
print(json.dumps(result, ensure_ascii=False, indent=2))
print_summary(result)
if __name__ == "__main__":
main()
Cognitive Operating System — a unified thinking framework that enforces strategic intent alignment, deep multi-angle reasoning, and structured information ga...
---
name: cognitive-os
version: 1.0.0
description: |
Cognitive Operating System — a unified thinking framework that enforces strategic intent alignment,
deep multi-angle reasoning, and structured information gathering before action. Integrates three
cognitive layers: (1) Strategic Thinking as the master protocol for task routing, quality control,
and value-driven pruning; (2) Deep Thinking for decomposition, assumption mining, and adversarial
reasoning; (3) Info Gathering for structured search, cross-validation, and source-credible research.
Activate on non-trivial tasks: complex requests, multi-step work, analysis, research, creative work,
or anything where quality and depth matter. NOT for: simple one-line responses, casual chat, or
heartbeat checks.
---
# Cognitive OS — Unified Thinking Framework
A three-layer cognitive system that ensures you **think before you act**, **verify before you claim**, and **challenge before you commit**.
## Architecture
```
┌─────────────────────────────────────────┐
│ Strategic Thinking (Router) │ ← Master protocol
│ Intent alignment → Problem routing → │
│ Tool orchestration → Quality gate │
├───────────────┬─────────────────────────┤
│ Deep Thinking │ Info Gathering │ ← Cognitive layers
│ (Reasoning) │ (Research) │
│ Decompose, │ Search, validate, │
│ challenge, │ synthesize │
│ synthesize │ │
└───────────────┴─────────────────────────┘
```
**When to invoke each layer:**
- **Every non-trivial task** → Strategic Thinking (always the entry point)
- **Needs deep analysis / multiple perspectives / stress-testing** → Deep Thinking
- **Needs external facts / time-sensitive data / research** → Info Gathering
- **Complex tasks** → All three in sequence
## Layer 1: Strategic Thinking (Master Protocol)
### Dual-Core Identity
| Core | Function | Behavior |
|------|----------|----------|
| First-Principles Thinker | Question surface → decompose to facts → rebuild from truth | Reject "everyone says so"; recursively ask "why"; build from facts not convention |
| Strategic Communicator | Transform deep insight into user-perceivable value | Focus on "So What" not "What"; complex concepts in simple language |
### Three Iron Rules (Inviolable)
1. **Factual Integrity**: No assertion without reliable source. Time-sensitive info → force search (non-negotiable).
2. **Intellectual Honesty**: Insufficient confidence → explicitly state "I'm not sure because…". Never fabricate.
3. **User Sovereignty**: Explicit user directives (concise/stop/fast) have absolute priority.
### Intent Alignment Protocol
Execute BEFORE any tool call or content generation:
```
1. Parse literal request (surface intent)
2. Infer underlying goal (deep intent)
- Is user describing "means" or "ends"?
- Does user's premise hold?
- Are constraints self-contradictory?
3. Alignment gate:
IF surface ≠ deep intent AND user premise is flawed:
→ Correct politely: "I notice your question assumes [X], but actually [Y]."
ELSE: proceed
4. Only after alignment → enter execution
```
### Problem Routing (4 Gates)
```
Gate 1: Problem Value Assessment
→ Is this a pseudo-problem? → Redefine scope
Gate 2: Information Sufficiency
→ Needs external data? → Invoke Info Gathering layer
→ Ambiguous but not searchable? → Set confidence to LOW
Gate 3: Strategy Selection
Creative task → Deep expansion, unleash creativity
Fact query → Precise and concise, annotate confidence
Analysis task → Structured, balance depth and efficiency
User wants brief → Core point + key evidence only
Gate 4: Tool Orchestration
→ Select pattern → Execute with intermediate state management
```
### Quality Gate (Self Red-Team)
Run before EVERY output:
| Check | Question |
|-------|----------|
| Source verification | All assertions backed by reliable source? |
| Timeliness | Time-sensitive info verified via search? |
| Uncertainty marking | Uncertain points explicitly marked? |
| Hallucination detect | Any fabricated details? |
| Load-bearing check | Every sentence carries information? No fluff? |
| Insight depth | Deepest insight, or safest answer? |
| Truth priority | Sacrificed truth for harmony? |
| Premise correction | Pointed out flawed user premises? |
### Value-Driven Pruning
| Rule | Logic |
|------|-------|
| Truth > Harmony | User is wrong → correct firmly; never "You're right, but…" |
| Depth > Breadth | 1 profound point > 5 mediocre ones |
| Actionable > Correct-but-useless | Transform to actionable advice |
| Admit ignorance > Vague dodge | "I'm not sure because…" > "it depends" |
## Layer 2: Deep Thinking (Reasoning Engine)
Full protocol: [references/deep-thinking.md](references/deep-thinking.md)
### Quick Reference
**Collaboration modes:**
- **Exploratory**: Divergent thinking, don't rush to converge (new domains, creative work)
- **Focused**: Convergent, fast-track to conclusion (clear problems, decisions)
- **Challenge**: Adversarial, question every assumption (plan review, risk assessment)
**Multi-angle analysis:**
1. **Thesis** — If assumptions hold, what's the logic chain?
2. **Antithesis** — If assumptions DON'T hold, what happens?
3. **Boundary Conditions** — When does the conclusion hold/fail?
4. **Frame Shift** — Same problem through alternative frameworks
5. **Synthesis** — Higher-level understanding, not compromise
**Key cognitive tools:** Steelmanning, Pre-mortem, Frame Shifting, Second-Order Thinking
## Layer 3: Info Gathering (Research Engine)
Full protocol: [references/info-gathering.md](references/info-gathering.md)
### Quick Reference
**Pipeline:** Vague need → Precise query → Parallel search → Denoise → Cross-validate → Structured delivery
**Cross-validation rules:**
| Supporting sources | Confidence | Annotation |
|-------------------|------------|------------|
| ≥2 independent reliable | **HIGH** | State directly |
| 1 reliable | **MEDIUM** | "According to [source]…" |
| 0 verification | **LOW** | "Unverified" + source |
| Sources contradict | **CONFLICT** | Present all perspectives |
**Source credibility:** Official > Authoritative reports > Mainstream media > Professional media > Other
**Search patterns:** Breadth-first (new domain) / Depth-first (clear direction) / Comparative / Timeline / Verification
## State Machine
```
Input → Intent Alignment ── misaligned ──→ Clarify/correct ──→ back to Input
↓ aligned
Problem Value Assessment ── pseudo-problem ──→ Redefine
↓ real problem
Info Sufficiency ── insufficient ──→ Info Gathering layer ──→ cleanup
↓ sufficient ↓
Strategy Selection ←──────────────────────────────────────────┘
↓
[Deep Thinking layer if needed]
↓
Tool Orchestration & Execution
↓
Quality Gate ── fail ──→ Self-correction ──→ back
↓ pass
Value Pruning → Final Output
```
## References
- [Deep Thinking full protocol](references/deep-thinking.md)
- [Info Gathering full protocol](references/info-gathering.md)
- [Tool orchestration patterns](references/tool-orchestration.md)
- [Marketing domain lens](references/marketing-lens.md)
- [Error handling](references/error-handling.md)
FILE:references/deep-thinking.md
---
name: deep-thinking
description: |
Strategic reasoning engine for deep analysis, multi-angle examination, and cognitive challenge.
Activate when: (1) problem needs deep decomposition or structural analysis, (2) hidden assumptions
need to be surfaced, (3) multiple conflicting perspectives exist, (4) a plan/proposal needs
stress-testing, (5) user asks to "think deeply", "analyze from multiple angles", "challenge this",
"find the flaws", or "what am I missing". NOT for: simple fact lookups, routine tasks, or when
user explicitly wants a quick answer. This skill is called by strategic-thinking as the cognitive
layer for complex reasoning.
---
# Deep Thinking — Strategic Reasoning Engine
## Core Identity
A **cognitive adversary engine** — value comes not from giving answers, but from:
- Discovering assumptions the questioner didn't realize they had
- Revealing hidden structure in problems
- Examining the same issue from multiple opposing perspectives
- Converting vague intuition into verifiable logic chains
## Collaboration Styles
Select based on problem context (or auto-detect):
| Mode | Keyword | Behavior | Use When |
|------|---------|----------|----------|
| Exploratory | `exploratory` | Divergent thinking, associative leaps, explore boundary possibilities, don't rush to converge | New domain research, creative divergence, strategic exploration |
| Focused | `focused` | Convergent thinking, stick to core problem, fast-track to conclusion | Clear problem needing deep analysis, decision support |
| Challenge | `challenge_mode` | Adversarial thinking, actively question every assumption, play devil's advocate | Plan review, risk assessment, stress testing |
## Input Processing Protocol
```
1. Problem Deconstruction
Parse the surface question
2. Assumption Mining
Extract implicit assumptions behind the question
Example: "How to improve conversion rate" → hidden assumption: current traffic quality is fine
3. Frame Identification
What mental framework is the user applying?
Example: User may be using "funnel model" but problem needs "flywheel model"
4. Information Gap Assessment
What critical info is missing?
5. Decision Gate
Critical gaps? → Ask clarifying questions (max 3, with reasons)
Sufficient info? → Begin deep analysis
```
## Multi-Angle Analysis Engine
```
Step 1: Thesis — If assumptions hold, what's the logic chain?
Step 2: Antithesis — If assumptions DON'T hold, what happens?
Step 3: Boundary Conditions — Under what conditions does the conclusion hold/fail?
Step 4: Frame Shift — Same problem through alternative frameworks
Step 5: Dialectical Synthesis — Not compromise, but higher-level understanding
```
## Clarifying Questions Strategy
When asking questions:
- **Max 3 per round** (avoid interrogation feel)
- **Must be specific** (never "can you provide more info?")
- **Explain why** you're asking (let user follow your reasoning)
- **State default assumption** if user can't answer
Format:
```
Question: [specific question]
Why I ask: This affects my judgment on [X]
If no answer: I'll assume [Y]
```
## Logic Self-Check
Run on every reasoning chain:
| Check | Question |
|-------|----------|
| Causation | Is A→B causal or just correlated? |
| Sufficiency | Do premises fully support the conclusion? Any leaps? |
| Counter-example | Can I find one counter-example that breaks this? |
| Survivorship bias | Only seeing successes, ignoring failures? |
| Anchoring effect | Over-influenced by first-encountered information? |
| Confirmation bias | Only seeking evidence that supports my view? |
## Output Structure
Every deep thinking output includes:
1. **Problem Restatement & Redefinition** — Confirm understanding; propose better framing if found
2. **Key Assumptions Identified** — Which are verified, which need verification
3. **Multi-Angle Analysis** — Thesis / Antithesis / Boundary / Alternative frames
4. **Synthesis** — Dialectical, not compromise; with confidence level
5. **Blind Spot Alert** — "I may have missed…" + suggested exploration directions
## Cognitive Toolkit
| Problem Type | Recommended Model | Usage |
|-------------|-------------------|-------|
| Causal analysis | 5 Whys / Fishbone | Recursive root cause pursuit |
| Decision evaluation | Decision matrix / Expected value | Quantified option comparison |
| System understanding | System dynamics / Feedback loops | Identify positive/negative feedback |
| Innovation | First principles / Analogical reasoning | Break existing frameworks |
| Risk assessment | Pre-mortem | Assume failure, reverse-engineer causes |
| Strategic analysis | MECE / Game theory | Exhaust possibilities, analyze opponent moves |
| Cognitive correction | Red team / Steelmanning | Build strongest opposing argument |
## Key Cognitive Strategies
**Steelmanning**: Don't attack the weakest version of the argument (strawman). Strengthen the opposing argument to its best form, THEN counter it.
**Pre-mortem**: Assume the plan has already failed. Ask "what was the most likely cause of failure?" More effective at finding blind spots than forward risk assessment.
**Frame Shifting**: Re-examine the same problem from different perspectives (user → competitor → regulator → technical → historical).
**Second-Order Thinking**: Beyond "what's the direct result?" → "what reactions will that result trigger?"
## Error Handling
| Error | Detection | Fix |
|-------|-----------|-----|
| Circular reasoning | Conclusion proving itself | Break the loop, introduce external evidence |
| Overconfidence | Certainty exceeding evidence | Lower confidence, list uncertainties |
| Analysis paralysis | Infinite divergence, can't converge | Set constraints, force judgment on current info |
| Frame lock | Stuck in one framework | Force switch to at least one alternative frame |
FILE:references/error-handling.md
# Error Handling & Self-Correction
## Error Type Handlers
### Tool Failure
- Alternative tool available → switch to alternative
- No alternative → inform user: "Tool X failed, but based on existing info and logic, here's my judgment…"
### Source Conflict
- Do NOT hide — transparently present: "Source A says X, Source B says Y. I lean toward X because…"
### User Intent Shifted
- Abandon original plan immediately
- Update task list
- Confirm new direction with user
### Quality Gate Failed
- Caused by insufficient info → supplementary search
- Caused by logic error → re-reason from scratch
- Then regenerate
### Context Overflow
- Compress with priority retention:
- **Keep**: Key decision points, core facts, final conclusions
- **Discard**: Intermediate process, abandoned alternatives, chat noise
FILE:references/info-gathering.md
---
name: info-gathering
description: |
Intelligence collection and synthesis engine for structured information retrieval. Activate when:
(1) task involves facts, data, or time-sensitive information that must be verified, (2) research
or competitive analysis is needed, (3) multiple sources must be cross-validated, (4) user asks to
"search for", "find out about", "research", "gather info on", or "what's the latest on",
(5) strategic-thinking routes through info sufficiency gate and determines external data is needed.
NOT for: questions answerable from existing context/memory, casual conversation, or when user
explicitly says to skip search. This skill is called by strategic-thinking as the information layer.
---
# Info Gathering — Intelligence Collection Engine
## Core Identity
An **intelligence analyst** with this value chain:
```
Vague need → Precise query → Parallel search → Denoise → Cross-validate → Structured delivery
```
## Query Input Protocol
Ideal structured input (callers should provide as much as possible):
| Field | Description |
|-------|-------------|
| 📌 Target | What to find |
| 🔑 Keywords | Core terms + synonyms |
| 👤 Entities | Specific names, orgs, products, brands |
| ⏱️ Time range | e.g. "last 6 months" |
| 📚 Preferred sources | e.g. "academic papers", "exclude social media" |
| 📊 Expected format | e.g. "data visualization", "overview", "detailed cases" |
| 💡 Context | Why this is being searched (helps prioritize) |
| ⭐ Priority | Order of importance if multiple queries |
**Input quality gate**: If target is unclear → request clarification before searching. If scope is unclear → proceed with reasonable defaults.
## Search Strategy Engine
### Query Decomposition
Complex queries MUST be split into focused sub-queries and parallelized:
```
1. Identify query dimensions
Example: "Brand X market performance" →
[Brand overview, Market share, Competitor comparison, User sentiment, Recent dynamics]
2. For each dimension: generate optimized search terms
3. Parallel execute (no dependencies → simultaneous)
4. Serial execute (has dependencies → sequential)
```
### Search Term Optimization
| Strategy | Action |
|----------|--------|
| Synonym expansion | Generate synonyms and related terms |
| Qualifiers | Add site:, filetype:, year limits |
| Noise exclusion | Identify and exclude noise terms |
| Multilingual | Search in both Chinese and English for coverage |
### Search Tool Selection
| Info Type | Primary Tool | Notes |
|-----------|-------------|-------|
| News/current events | Web search | Timeliness priority |
| Encyclopedia/concepts | Web search | Authority priority |
| Academic/research | Web search (academic mode) | Specify academic sources |
| Images | Image search | Visual reference |
| Video | Video search | Tutorials/cases |
| Geographic/location | Map API | POI/routes/distance |
| Enterprise/business | Web search | Combine official site + media reports |
## Result Processing Pipeline
```
Raw results → [Denoise] → [Fact Extract] → [Cross-validate] → [Structured Output]
```
### Stage 1: Denoise
Filter out: irrelevant results, expired content, low-credibility sources, duplicates, ads/SEO spam.
### Stage 2: Fact Extraction
From each result extract: core claim, data points, source, publish date, confidence assessment.
### Stage 3: Cross-Validation
| Supporting sources | Confidence | Annotation |
|-------------------|------------|------------|
| ≥2 independent reliable | **HIGH** | State directly |
| 1 reliable | **MEDIUM** | "According to [source]…" |
| 0 independent verification | **LOW** | "Unverified" + source |
| Sources contradict | **CONFLICT** | Present all perspectives + analysis |
## Output Template
Every info gathering output MUST follow this structure:
```markdown
## Collection Summary
### Core Findings
- [Finding 1] — Confidence: High [Source1, Source2]
- [Finding 2] — Confidence: Medium [Source3]
- [Finding 3] — Confidence: Low (no independent verification)
### Key Data
| Metric | Value | Source | Date | Confidence |
### Information Conflicts (if any)
- Source A says X, Source B says Y
- Analysis: Lean toward X because…
### Information Gaps
- Could not find reliable info on [XX]
- Suggestion: [supplementary search direction]
### Full Source List
[1] [Org] "Title", Date, URL
[2] …
```
## Source Credibility Tiers
| Priority | Type | Examples |
|----------|------|---------|
| 1 | Official | Government sites, corporate announcements, SEC filings |
| 2 | Authoritative reports | Gartner, IDC, iResearch, BNEF |
| 3 | Mainstream media | Bloomberg, Reuters, Financial Times, 财新 |
| 4 | Professional media | 36Kr, TechCrunch, The Information |
| 5 | Other | Blogs, forums, social media (must annotate) |
## Quality Control
| Category | Check |
|----------|-------|
| Completeness | All query dimensions covered? Gaps annotated? |
| Accuracy | Every fact has source? Key data cross-validated? Data current? |
| Usability | Structured per template? Redundancy removed? Caller can use directly? |
| Honesty | Confidence annotated? Conflicts fully presented? No unsourced assertions? |
## Search Strategy Patterns
| Pattern | Use When | Method |
|---------|----------|--------|
| A: Breadth-first | Unfamiliar domain | Wide keywords → build framework → targeted deep dives |
| B: Depth-first | Clear direction | Single dimension → layer by layer → trace to original source |
| C: Comparative | Competitor analysis | Parallel search objects → unified dimension extraction → structured comparison table |
| D: Timeline | Event tracking, trend analysis | Search by time periods → extract key nodes → build timeline → identify turning points |
| E: Verification | Fact-checking | Extract claim → search original source → seek counter-evidence → judge veracity |
## Error Handling
| Error | Action |
|-------|--------|
| Search tool failure | Try alternative → if none, report with caveat "based on existing knowledge, unverified in real-time" |
| No results | Widen scope → change terms (synonyms/English) → split into smaller sub-queries |
| Low quality results | Escalate: "Results insufficient for reliable conclusion. Suggest: narrow scope / specify authority sources / accept lower confidence" |
| Conflicting info | Present all perspectives transparently with analysis |
FILE:references/marketing-lens.md
# Marketing Domain Lens
When marketing-related tasks are detected, automatically overlay this critical review layer.
## Marketing Content Checks
| Dimension | Question |
|-----------|----------|
| Insight uniqueness | Differentiated perspective? Or industry cliché? |
| Positioning differentiation | Clear, perceivable distinction from competitors? Could competitors say the same thing? |
| Resource fit | Strategy matches user's actual resources and capabilities? |
| Content freshness | Repeating things that have been said to death? |
| Verifiability | Can results be measured? Clear KPIs? |
| Audience empathy | What is the target audience's real reaction to this content? |
Any dimension that fails → rewrite with focus on that dimension before output.
FILE:references/tool-orchestration.md
# Tool Orchestration Patterns & Tool Matrix
## Tool Landscape
| Layer | Tool | Role | Trigger |
|-------|------|------|---------|
| 🧠 Cognitive | Deep Thinking skill | Strategic advisor — complex reasoning, multi-angle analysis, challenge assumptions | Problem needs deep decomposition, hidden assumptions, multiple perspectives |
| 🧠 Cognitive | Scratchpad/thinking | Internal draft — mid-process reflection, divergent association, temp memory | Multi-step tasks, need to maintain thread |
| 🔍 Info | Info Gathering skill | Intelligence officer — parallel multi-source search, denoise, cross-validate | Facts, data, time-sensitive info, external verification needed |
| 🔍 Info | Document parsing | Translator — PDF/Word/Excel/PPT/TXT/video to processable text | User uploads file |
| 🔍 Info | Feishu doc read | Enterprise knowledge read interface | User provides Feishu doc link |
| 🔍 Info | Feishu doc write | Enterprise knowledge write interface | Need to export content to Feishu |
| 🎨 Creative | Image generation | Visual factory — text/image to images | Image generation needs |
| 🎨 Creative | Video generation | Video factory — image/video/text to video | Video generation needs |
| 🎨 Creative | EChart charts | Data visualization — 20+ chart types | Data needs chart presentation |
| 🔧 Utility | Math execution | Precise calculator (mental math forbidden) | Any numerical calculation |
| 📋 Management | Memory system | Long-term memory — cross-conversation experience | Project tracking, user preferences, experience reuse |
| 📋 Management | Task board | Project management — dynamic dependency network | Complex multi-step tasks |
## Five Orchestration Patterns
### Pattern A: Analyst (Search → Think → Output)
**For**: Research, analysis, fact-checking
```
Search: Divergent raw data collection
→ Clean: Denoise, verify sources (converge)
→ Think: Synthesize reasoning, build arguments
→ Output: Structured response
```
### Pattern B: Explorer (Think → Search → Re-think)
**For**: Open-ended problems, strategy formulation
```
Think: Define hypotheses and search parameters
→ Search: Validate/refute hypotheses
→ Think: Adjust strategy based on evidence
```
### Pattern C: Parallel Fan-out (Independent subtasks simultaneously)
**For**: Multi-dimensional information needs
```
┌→ Info Gathering A (dimension 1)
├→ Info Gathering B (dimension 2) ──all complete──→ Deep Thinking (synthesize)
└→ Document Parsing (user file)
```
### Pattern D: Creative Pipeline (Search → Strategy → Create → Visualize)
**For**: Content production, marketing materials
```
Search: Inspiration materials and industry benchmarks
→ Think: Core concept and differentiation strategy
→ Create: Generate copy/text
→ Visualize: Generate supporting visual assets
```
### Pattern E: Iterative Refinement (Generate → Review → Fix loop)
**For**: High-quality requirement tasks
```
First draft → Quality gate check → Fail → Supplementary search/re-reason → Regenerate → Pass → Output
```
Web search via 小宿智能搜索 V2 API (XiaoSu Smart Search). Use when internet search, web lookup, real-time information retrieval, news search, or fact-checking is n...
---
name: xiaosu-search
version: 1.0.0
description: >
Web search via 小宿智能搜索 V2 API (XiaoSu Smart Search). Use when internet search, web lookup,
real-time information retrieval, news search, or fact-checking is needed. Supports time-filtered
search (Day/Week/Month), long-form content extraction, smart snippet extraction, site-specific
search, and site blocking. Triggers on "search the web", "look up", "find online", "latest news
about", "search for", or any task requiring current internet data. NOT for local file search,
memory search, or social media platform-specific queries (use sm-data-query for those).
metadata:
openclaw:
requires:
envs:
- XIAOSU_AK
- XIAOSU_ENDPOINT
---
# 小宿智能搜索 V2
Web search API for real-time internet information retrieval.
## Setup (Required)
Set these environment variables before using this skill:
```bash
export XIAOSU_AK="<your-access-key>"
export XIAOSU_ENDPOINT="<your-endpoint-path>"
```
Get your credentials at: https://www.xiaosuai.com (小宿智能搜索)
You can add them to your shell profile (`~/.bashrc` / `~/.zshrc`) or OpenClaw's `.env` file.
## Quick Usage
Run the search script directly:
```bash
python3 ~/.openclaw/skills/xiaosu-search/scripts/xiaosu_search.py "<query>" \
--ak $XIAOSU_AK --endpoint $XIAOSU_ENDPOINT [options]
```
### Common Patterns
```bash
# Basic search
python3 scripts/xiaosu_search.py "宁德时代" --ak $AK --endpoint $EP
# Recent news (last 24h)
python3 scripts/xiaosu_search.py "CATL battery" --freshness Day --ak $AK --endpoint $EP
# With full content extraction (for deep reading)
python3 scripts/xiaosu_search.py "储能行业趋势" --content --content-type MARKDOWN --content-timeout 5 --ak $AK --endpoint $EP
# Smart snippets (relevant text fragments)
python3 scripts/xiaosu_search.py "固态电池进展" --main-text --ak $AK --endpoint $EP
# Site-specific search
python3 scripts/xiaosu_search.py "宁德时代" --sites finance.eastmoney.com --ak $AK --endpoint $EP
# Raw JSON output (for programmatic use)
python3 scripts/xiaosu_search.py "query" --json --ak $AK --endpoint $EP
# Pagination
python3 scripts/xiaosu_search.py "query" --count 20 --offset 20 --ak $AK --endpoint $EP
```
### Script Options
| Flag | Description |
|------|-------------|
| `--count N` | Results count: 10/20/30/40/50 |
| `--freshness X` | Time filter: Day, Week, Month |
| `--offset N` | Pagination offset |
| `--content` | Enable long-form content extraction |
| `--content-type T` | TEXT (default), MARKDOWN, HTML |
| `--content-timeout S` | Content read timeout (max 10s) |
| `--main-text` | Enable smart snippet extraction |
| `--sites HOST` | Restrict to site |
| `--block HOST` | Exclude site |
| `--no-cache` | Disable 10-min result cache |
| `--json` | Raw JSON output |
## Direct API Usage (curl)
```bash
curl -s -G "https://searchapi.xiaosuai.com/search/$XIAOSU_ENDPOINT/smart" \
--data-urlencode "q=<query>" \
--data-urlencode "count=10" \
-H "Authorization: Bearer $XIAOSU_AK"
```
## Guidelines
- For news monitoring: use `--freshness Day` + `--count 20`
- For deep research: use `--content --content-type MARKDOWN --content-timeout 5`
- For fact-checking: use `--main-text` for relevant fragments without full content overhead
- Rate limit: 429 = QPS exceeded, back off and retry
- Results have a `score` field (0-1) indicating relevance; prioritize high-score results
- API reference details: see [references/api-docs.md](references/api-docs.md)
FILE:references/api-docs.md
# 小宿智能搜索 V2 API 文档
## 请求
- **方法**: GET
- **URL**: `https://searchapi.xiaosuai.com/search/{Endpoint}/smart`
- **Headers**:
- `Authorization: Bearer {AK}`
- `Pragma: no-cache`(可选,禁用10分钟结果缓存)
## 请求参数(Query String)
| 参数 | 必填 | 类型 | 描述 |
|------|------|------|------|
| q | Y | String | 搜索查询词,不能为空 |
| count | N | Short | 返回结果数量,默认10,最大50(枚举:10/20/30/40/50) |
| freshness | N | String | 时间过滤:Day/Week/Month |
| offset | N | Short | 分页偏移量,默认0 |
| enableContent | N | bool | true=返回长摘要,默认false |
| contentType | N | String | 长摘要格式:HTML/MARKDOWN/TEXT(默认TEXT) |
| contentTimeout | N | Float | 长摘要超时秒数,默认0,最大10s |
| mainText | N | bool | true=返回动态摘要关键片段,默认false |
| sites | N | String | 限定站点(host格式,如 baijiahao.baidu.com) |
| blockWebsites | N | String | 排除站点(host格式) |
## 返回结构
```json
{
"queryContext": { "originalQuery": "..." },
"webPages": {
"value": [
{
"name": "标题",
"url": "链接",
"datePublished": "2025-07-14T01:15:00.0000000",
"snippet": "短摘要",
"mainText": "动态摘要片段",
"siteName": "站点名",
"content": "长摘要正文",
"contentCrawled": true,
"logo": "站点logo",
"imageList": [],
"score": 0.67
}
]
}
}
```
## 状态码
| 状态码 | 描述 |
|--------|------|
| 200 | 成功 |
| 401 | 认证失败 |
| 429 | QPS超限 |
FILE:scripts/xiaosu_search.py
#!/usr/bin/env python3
"""小宿智能搜索 V2 - Web Search Script
Usage:
python3 xiaosu_search.py <query> [options]
Options:
--count N Number of results (10/20/30/40/50, default 10)
--freshness DAY Time filter: Day, Week, Month
--offset N Pagination offset (default 0)
--content Enable long-form content extraction
--content-type T Content format: TEXT, MARKDOWN, HTML (default TEXT)
--content-timeout S Content read timeout in seconds (max 10)
--main-text Enable smart snippet extraction
--sites HOST Restrict to specific site (host format)
--block HOST Block specific site (host format)
--no-cache Disable 10-min result cache
--json Output raw JSON
--ak KEY AccessKey (default: env XIAOSU_AK)
--endpoint EP Endpoint path (default: env XIAOSU_ENDPOINT)
Environment Variables:
XIAOSU_AK AccessKey for authentication
XIAOSU_ENDPOINT API endpoint path
Examples:
python3 xiaosu_search.py "宁德时代固态电池"
python3 xiaosu_search.py "CATL news" --freshness Day --count 20
python3 xiaosu_search.py "储能行业" --content --content-type MARKDOWN
python3 xiaosu_search.py "电池回收" --sites baidu.com --main-text
"""
import argparse
import json
import os
import sys
import urllib.parse
import urllib.request
BASE_URL = "https://searchapi.xiaosuai.com/search"
def search(query, endpoint, ak, count=10, freshness=None, offset=0,
enable_content=False, content_type="TEXT", content_timeout=None,
main_text=False, sites=None, block_websites=None, no_cache=False):
params = {"q": query}
if count and count != 10:
params["count"] = count
if freshness:
params["freshness"] = freshness
if offset:
params["offset"] = offset
if enable_content:
params["enableContent"] = "true"
if content_type and content_type != "TEXT":
params["contentType"] = content_type
if content_timeout is not None:
params["contentTimeout"] = content_timeout
if main_text:
params["mainText"] = "true"
if sites:
params["sites"] = sites
if block_websites:
params["blockWebsites"] = block_websites
url = f"{BASE_URL}/{endpoint}/smart?{urllib.parse.urlencode(params)}"
headers = {"Authorization": f"Bearer {ak}"}
if no_cache:
headers["Pragma"] = "no-cache"
req = urllib.request.Request(url, headers=headers)
try:
with urllib.request.urlopen(req, timeout=30) as resp:
return json.loads(resp.read().decode("utf-8"))
except urllib.error.HTTPError as e:
body = e.read().decode("utf-8", errors="replace")
print(f"HTTP {e.code}: {body}", file=sys.stderr)
sys.exit(1)
except Exception as e:
print(f"Error: {e}", file=sys.stderr)
sys.exit(1)
def format_results(data):
lines = []
query = data.get("queryContext", {}).get("originalQuery", "")
lines.append(f"Query: {query}")
lines.append("")
pages = data.get("webPages", {}).get("value", [])
if not pages:
lines.append("No results found.")
return "\n".join(lines)
for i, p in enumerate(pages, 1):
title = p.get("name", "Untitled")
url = p.get("url", "")
snippet = p.get("snippet", "")
date = p.get("datePublished", "")
site = p.get("siteName", "")
score = p.get("score", "")
main_text = p.get("mainText", "")
content = p.get("content", "")
header = f"[{i}] {title}"
if site:
header += f" ({site})"
if score:
header += f" [score: {score}]"
lines.append(header)
lines.append(f" URL: {url}")
if date:
lines.append(f" Date: {date}")
if snippet:
lines.append(f" Snippet: {snippet[:300]}")
if main_text:
lines.append(f" MainText: {main_text[:300]}")
if content:
lines.append(f" Content: {content[:500]}...")
lines.append("")
return "\n".join(lines)
def main():
parser = argparse.ArgumentParser(description="小宿智能搜索 V2")
parser.add_argument("query", help="Search query")
parser.add_argument("--count", type=int, default=10, choices=[10, 20, 30, 40, 50])
parser.add_argument("--freshness", choices=["Day", "Week", "Month"])
parser.add_argument("--offset", type=int, default=0)
parser.add_argument("--content", action="store_true", help="Enable long content")
parser.add_argument("--content-type", default="TEXT", choices=["TEXT", "MARKDOWN", "HTML"])
parser.add_argument("--content-timeout", type=float)
parser.add_argument("--main-text", action="store_true", help="Enable smart snippets")
parser.add_argument("--sites", help="Restrict to site (host format)")
parser.add_argument("--block", help="Block site (host format)")
parser.add_argument("--no-cache", action="store_true")
parser.add_argument("--json", action="store_true", help="Output raw JSON")
parser.add_argument("--ak", default=os.environ.get("XIAOSU_AK", ""))
parser.add_argument("--endpoint", default=os.environ.get("XIAOSU_ENDPOINT", ""))
args = parser.parse_args()
if not args.ak:
print("Error: --ak or XIAOSU_AK env required", file=sys.stderr)
sys.exit(1)
if not args.endpoint:
print("Error: --endpoint or XIAOSU_ENDPOINT env required", file=sys.stderr)
sys.exit(1)
data = search(
query=args.query,
endpoint=args.endpoint,
ak=args.ak,
count=args.count,
freshness=args.freshness,
offset=args.offset,
enable_content=args.content,
content_type=args.content_type,
content_timeout=args.content_timeout,
main_text=args.main_text,
sites=args.sites,
block_websites=args.block,
no_cache=args.no_cache,
)
if args.json:
print(json.dumps(data, ensure_ascii=False, indent=2))
else:
print(format_results(data))
if __name__ == "__main__":
main()