# API 示例概述

按场景组织的真实世界代码示例的精选集合。每个部分都包含可工作的 `curl`、Python 和 Node.js 片段，您可以复制并立即运行。

## 按场景

### 🌐 浏览器自动化

管理浏览器并通过 CDP（Chrome 开发工具协议）进行连接，以实现无头或有头自动化。

| 你想做什么 | 示例 |
|  --- | --- |
| 创建→开始→自动化→关闭浏览器 | [浏览器示例](/zh/api-reference/examples/browser-examples#full-workflow-create--start--automate--stop) |
| 跨配置文件批量更新代理 | [浏览器示例](/zh/api-reference/examples/browser-examples#batch-operations) |
| 完整的 Selenium 脚本 (Python) | [Selenium 指南](/zh/api-reference/examples/selenium) |
| 完整 Playwright 脚本 (Python) | [Playwright 指南](/zh/api-reference/examples/playwright) |
| 完整的 Puppeteer 脚本 (Node.js) | [Puppeteer 指南](/zh/api-reference/examples/puppeteer) |


### 📱 云手机生命周期

创建云手机实例、安装应用程序、管理文件并通过 ADB 连接 - 全部通过开放 API。

| 你想做什么 | 示例 |
|  --- | --- |
| 验证→创建→安装应用程序→ADB | [云手机示例](/zh/api-reference/examples/cloudphone-examples#full-workflow-auth--create--install-app--adb) |
| 上传文件至云手机 | [云手机示例](/zh/api-reference/examples/cloudphone-examples#file-upload-example-python) |


### 🤖 RPA 日程自动化

使用市场或个人模板以编程方式创建和管理 RPA 计划任务。

| 你想做什么 | API参考 |
|  --- | --- |
| 列出市场模板 | `POST /api/cloudphone/rpa/template/market/page` — [本地 API](/zh/api-reference/cloud-phone/local-api) |
| 列出个人模板 | `POST /api/cloudphone/rpa/template/personal/page` — [本地 API](/zh/api-reference/cloud-phone/local-api) |
| 创建一次性时间表 | `POST /api/cloudphone/rpa/onceTask/save` — [本地 API](/zh/api-reference/cloud-phone/local-api) |
| 列出/取消时间表 | `POST /api/cloudphone/rpa/task/page` — [本地 API](/zh/api-reference/cloud-phone/local-api) |
| 查询执行记录 | `POST /api/cloudphone/rpa/subTask/page` — [本地 API](/zh/api-reference/cloud-phone/local-api) |


> **提示**：有关构建模板参数的分步指南，请参阅[创建一次性计划](/zh/api-reference/cloud-phone/local-api)端点中的 `templateParameter` 参考。


### 🔗 公共API

代理、组和标签在浏览器和云手机之间共享。从一个地方管理它们。

| 你想做什么 | 示例 |
|  --- | --- |
| 添加/列出/删除代理 | [公共API示例](/zh/api-reference/examples/shared-examples#proxy-management) |
| 创建和管理组 | [公共API示例](/zh/api-reference/examples/shared-examples#group-management) |
| 创建和管理标签 | [公共API示例](/zh/api-reference/examples/shared-examples#tag-management) |
| 完整工作流程：创建资源 → 分配给配置文件 | [公共API示例](/zh/api-reference/examples/shared-examples#complete-workflow-create-resources--assign-to-profile) |


## 按语言

| 语言 | 示例 |
|  --- | --- |
| **curl** | [浏览器](/zh/api-reference/examples/browser-examples)、[云手机](/zh/api-reference/examples/cloudphone-examples)、[公共API](/zh/api-reference/examples/shared-examples) |
| **Python** | [浏览器](/zh/api-reference/examples/browser-examples)、[Selenium](/zh/api-reference/examples/selenium)、[Playwright](/zh/api-reference/examples/playwright)、[云手机](/zh/api-reference/examples/cloudphone-examples)、[公共API](/zh/api-reference/examples/shared-examples) |
| **Node.js** | [浏览器](/zh/api-reference/examples/browser-examples)、[Puppeteer](/zh/api-reference/examples/puppeteer)、[云手机](/zh/api-reference/examples/cloudphone-examples)、[公共API](/zh/api-reference/examples/shared-examples) |


## 快速链接

- [身份验证和令牌设置](/zh/api-reference/getting-started/authentication)
- [常见响应格式](/zh/api-reference/getting-started/response-format)
- [错误代码参考](/zh/api-reference/getting-started/error-codes)
- [本地 API 与开放 API](/zh/api-reference/getting-started/local-vs-open-api)