> For the complete documentation index, see [llms.txt](https://docs.ipdunar.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ipdunar.com/zh/kuai-su-ru-men/quick-start.md).

# 快速开始

5 分钟发出你的第一个代理请求。

## 1. 获取凭证

1. 登录 [控制台](https://dashboard.ipdunar.com)。
2. 进入 **住宅 → 子账号**，点击 **创建子账号**。
3. 复制子账号名（例如 `s1a2b3c4d5e`）和密码。

请求中实际使用的代理用户名遵循 [ipdunar 用户名语法](https://docs.ipdunar.com/zh/kuai-su-ru-men/username-format.md)。本指南示例使用的用户名为：

```
ipdunar_s1a2b3c4d5e-type-res-region-us
```

请把示例中的 `s1a2b3c4d5e` 换成你自己的子账号名，把 `PASSWORD` 换成密码。

## 2. 发送请求

### curl

```bash
curl -x http://ipdunar_s1a2b3c4d5e-type-res-region-us:PASSWORD@gate.ipdunar.com:7777 \
     https://ipv4.icanhazip.com
```

返回的 IP 应当**不是**你本机的 IP——它是一个美国住宅出口节点。

### Python (requests)

```python
import requests

USER = "ipdunar_s1a2b3c4d5e-type-res-region-us"
PASS = "PASSWORD"
proxy = f"http://{USER}:{PASS}@gate.ipdunar.com:7777"

r = requests.get(
    "https://ipv4.icanhazip.com",
    proxies={"http": proxy, "https": proxy},
    timeout=30,
)
print(r.text.strip())
```

### Node.js (fetch + undici)

```js
import { fetch, ProxyAgent } from "undici";

const user = "ipdunar_s1a2b3c4d5e-type-res-region-us";
const pass = "PASSWORD";
const agent = new ProxyAgent(`http://${user}:${pass}@gate.ipdunar.com:7777`);

const res = await fetch("https://ipv4.icanhazip.com", { dispatcher: agent });
console.log((await res.text()).trim());
```

### Go (net/http)

```go
package main

import (
    "fmt"
    "io"
    "net/http"
    "net/url"
    "time"
)

func main() {
    proxyURL, _ := url.Parse("http://ipdunar_s1a2b3c4d5e-type-res-region-us:PASSWORD@gate.ipdunar.com:7777")
    client := &http.Client{
        Transport: &http.Transport{Proxy: http.ProxyURL(proxyURL)},
        Timeout:   30 * time.Second,
    }
    resp, err := client.Get("https://ipv4.icanhazip.com")
    if err != nil { panic(err) }
    defer resp.Body.Close()
    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}
```

### PHP (cURL)

```php
<?php
$ch = curl_init('https://ipv4.icanhazip.com');
curl_setopt_array($ch, [
    CURLOPT_PROXY          => 'http://gate.ipdunar.com:7777',
    CURLOPT_PROXYUSERPWD   => 'ipdunar_s1a2b3c4d5e-type-res-region-us:PASSWORD',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 30,
]);
echo trim(curl_exec($ch));
curl_close($ch);
```

## 3. 切换国家

修改用户名中的 `region` 段为 ISO-3166 国家代码：

```bash
curl -x http://ipdunar_s1a2b3c4d5e-type-res-region-de:PASSWORD@gate.ipdunar.com:7777 \
     https://ipv4.icanhazip.com
```

返回的 IP 现在会落在德国。完整地理参数列表见[国家与城市](https://docs.ipdunar.com/zh/chan-pin/overview/locations.md)。

## 4. 复用同一个 IP

追加 `-session-XXX-sesstime-N`，在 N 分钟内保持同一出口 IP：

```bash
curl -x http://ipdunar_s1a2b3c4d5e-type-res-region-de-session-abc123-sesstime-30:PASSWORD@gate.ipdunar.com:7777 \
     https://ipv4.icanhazip.com
```

连续运行两次——两次返回的 IP 应当相同。

## 5. 切换产品

**移动代理**只需把 `type` 段换成 `mob`：

```bash
curl -x http://ipdunar_s1a2b3c4d5e-type-mob-region-jp-asn-2516:PASSWORD@gate.ipdunar.com:7777 \
     https://ipv4.icanhazip.com
```

（上例通过 ASN 2516 绑定日本 KDDI。）

**ISP 代理**不使用网关、也不套用户名语法。下单后控制台会给你一份 `ip:port:user:pass` 形式的静态 IP 清单，每一行都是一个独立代理：

```bash
curl -x http://ipdunar_s1a2b3c4d5e:PASSWORD@198.51.100.42:8000 \
     https://ipv4.icanhazip.com
```

完整流程见 [ISP 快速开始](https://docs.ipdunar.com/zh/chan-pin/overview-2/quick-start.md)。

## 下一步

* [用户名格式](https://docs.ipdunar.com/zh/kuai-su-ru-men/username-format.md) — 所有字段、所有可选项
* [身份认证](https://docs.ipdunar.com/zh/chan-pin/overview/authentication.md) — 从凭证切换为 IP 白名单
* [会话与轮换](https://docs.ipdunar.com/zh/chan-pin/overview/sessions-and-rotation.md) — 粘性与轮换策略
* [集成指南](https://docs.ipdunar.com/zh/ji-cheng-zhi-nan/integrations.md) — Selenium、Puppeteer、Scrapy 等
* [故障排查](https://docs.ipdunar.com/zh/gu-zhang-pai-cha/troubleshooting.md) — 首个请求未成功时查这里


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ipdunar.com/zh/kuai-su-ru-men/quick-start.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
