> For the complete documentation index, see [llms.txt](https://iptuns.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://iptuns.gitbook.io/docs/dai-li-chan-pin/dong-tai-zhu-zhai-dai-li/curl-qing-qiu.md).

# CURL请求

{% hint style="warning" %}
平台的所有代理产品均需要在海外网络环境下使用，海外网络环境需要客户自行配置。
{% endhint %}

本文展示如何使用 `curl` 通过Iptuns动态住宅代理IP发起请求，适用于终端或脚本中直接调用代理连接。

### 动态代理参数说明 <a href="#v2-ban-ben-dong-tai-dai-li-can-shu-shuo-ming" id="v2-ban-ben-dong-tai-dai-li-can-shu-shuo-ming"></a>

**参数格式**

```shellscript
<账户名>-<代理类型>-<定位信息>[-sid-<会话ID>]
```

**参数说明**

| 参数           | 说明       | 必填  | 备注                              |
| ------------ | -------- | --- | ------------------------------- |
| 账户名          | 分配的账号    | ✅ 是 | —                               |
| 代理类型         | IP 类型    | ✅ 是 | 固定值：`res`                       |
| 定位信息         | 地理位置     | ✅ 是 | 详见下方“定位格式”                      |
| `sid-<会话ID>` | 固定 IP 会话 | ❌ 否 | 会话 ID 最多支持 9 位数字，若期间节点下线，系统自动补充 |

**定位格式**

<table><thead><tr><th width="143.79998779296875">级别</th><th width="237.79998779296875">格式</th><th width="136.60009765625">代理类型写法</th><th>示例</th></tr></thead><tbody><tr><td>无定位</td><td><code>any</code></td><td><code>res</code></td><td><code>account-res-any</code></td></tr><tr><td>国家</td><td><code>&#x3C;country></code></td><td><code>res</code></td><td><code>account-res-us</code></td></tr><tr><td>国家+州</td><td><code>&#x3C;country>_&#x3C;state></code></td><td><code>res_sc</code></td><td><code>account-res_sc-us_california</code></td></tr><tr><td>国家+州+城市</td><td><code>&#x3C;country>_&#x3C;state>_&#x3C;city></code></td><td><code>res_sc</code></td><td><code>account-res_sc-us_california_losangeles</code></td></tr></tbody></table>

> **说明：**
>
> * 当定位信息包含州或城市时，代理类型必须添加 `sc` 后缀（如 `res_sc`）
> * 所有地区名称需使用小写字母，且不含空格，例如：`us`、`california`、`losangeles`、`newsouthwales`

**案例示范**

```shellscript
# 随机 不固定节点
curl -x http://account-res-any:password@[ip]:[port] http://httpbin.org/ip

# 随机 固定节点
curl -x http://account-res-any-sid-295592634:password@[ip]:[port] http://httpbin.org/ip

# 指定国家 不固定节点
curl -x http://account-res-us:password@[ip]:[port] http://httpbin.org/ip

# 指定国家 固定节点
curl -x http://account-res-us-sid-295592634:password@[ip]:[port] http://httpbin.org/ip

# 指定到国家-地区 不固定节点
curl -x socks5://account-res_sc-us_california:password@[ip]:[port] http://httpbin.org/ip

# 指定到国家-地区 固定节点
curl -x socks5://account-res_sc-us_california-sid-295592634:password@[ip]:[port] http://httpbin.org/ip

# 指定到国家-地区-城市 不固定节点
curl -x http://account-res_sc-us_california_losangeles:password@[ip]:[port] http://httpbin.org/ip

# 指定到国家-地区-城市 固定节点
curl -x http://account-res_sc-us_california_losangeles-sid-295592634:password@[ip]:[port] http://httpbin.org/ip
```
