> For the complete documentation index, see [llms.txt](https://docs.ipwo.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ipwo.net/kai-fa-zhe-wen-dang/kuai-su-kai-shi/huo-qu-dai-li-xin-xi/api-dong-tai-huo-qu-jin-dong-tai-dai-li.md).

# API 动态获取（仅动态代理）

API 提取用于动态获取代理 IP 列表，适用于自动化程序和批量任务。

***

### 🚀 核心说明（重要）

* API 访问通过 [**IP 白名单**](/huo-qu-yu-pei-zhi-dai-li/ip-bai-ming-dan.md)**进行认证**
* 返回结果为可用的代理 IP（IP + 端口）

***

### ⚡ 使用流程

```
1. 配置 IP 白名单
2. 调用 API 获取 IP
3. 获取代理列表
```

***

### 🔐 第一步：[配置 IP 白名单](https://docs.ipwo.net/)

在调用 API 前，请先在后台添加你的服务器 IP 到白名单。

👉 未添加白名单将无法访问 API

***

### 🌐 第二步：获取代理 IP

```bash
curl "YOUR_API_LINK"
```

***

#### 示例返回

```json
{
    "code": 0,
    "success": true,
    "msg": "操作成功",
    "request_ip": "127.0.0.1",
    "data": [
        {"ip" :"1.1.2.2","port" :14566},
        {"ip" :"1.1.2.2","port" :14577},
    ]
}
```

***

### ⚙️ 常用 API 参数

在生成 API 链接时，你可以设置：

<table><thead><tr><th width="114">参数</th><th width="426">描述</th><th>描述</th><th>必选</th></tr></thead><tbody><tr><td>num</td><td>IP提取数量</td><td>int</td><td>是</td></tr><tr><td>regions</td><td>国家</td><td>string</td><td>否</td></tr><tr><td>protocol</td><td>协议（http:HTTP/HTTPS socks5:SOCKS5）</td><td>string</td><td>否</td></tr><tr><td>return_type</td><td>数据格式：txt json</td><td>string</td><td>否</td></tr><tr><td>lb</td><td>分隔符(1:\r\n 2:/br 3:\r 4:\n 5:\t 6 :自定义)</td><td>string</td><td>否</td></tr><tr><td>sb</td><td>自定义分隔符</td><td>string</td><td>否</td></tr></tbody></table>

👉 参数会影响返回 IP 的类型与分布

***

### 💡 使用建议

* 适用于爬虫 / 自动化 / 批量任务
* 建议结合程序实现 IP 池管理
* 按需获取 IP，避免资源浪费
* 合理控制请求频率

***

### ❗ 常见问题

#### API 无法访问？

* 检查是否已配置 IP 白名单
* 确认服务器 IP 是否正确

***

#### 返回为空？

* 检查参数设置
* 确认账户有可用资源

***

#### API 是否需要账号密码？

❌ 不需要\
👉 仅依赖 IP 白名单认证

***

### 👉 下一步

* 查看「[IP 白名单](/huo-qu-yu-pei-zhi-dai-li/ip-bai-ming-dan.md)」→ 配置访问权限
* 查看「[快速验证](/kai-fa-zhe-wen-dang/kuai-su-kai-shi/kuai-su-yan-zheng.md)」→ 测试代理是否可用
* 查看「[接入方式](broken://pages/FytZ1eL5v0h0ZG7guXuy)」→ 使用代理

***

### 总结

API 提取的核心是：

* 通过白名单获取代理 IP
* 返回 IP 列表供程序使用
* 适用于自动化和高并发场景

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ipwo.net/kai-fa-zhe-wen-dang/kuai-su-kai-shi/huo-qu-dai-li-xin-xi/api-dong-tai-huo-qu-jin-dong-tai-dai-li.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
