> For the complete documentation index, see [llms.txt](https://docs.talordata.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.talordata.com/cn-tw/proxy/integrations-guide/webscraping-ai-talordata-integration-guide.md).

# WebScraping.AI & Talordata 設置指南

WebScraping.ai 提供網頁抓取 API 服務，您可以透過添加代理參數，讓抓取請求經過您的代理 IP 發出。請按照以下步驟完成代理設定

{% hint style="success" icon="lightbulb-exclamation-on" %}
在配置代理之前，您需要取得代理憑證。[點擊此處](/cn-tw/proxy/rotating-residential-proxies/quick-start.md)了解如何取得代理憑證
{% endhint %}

***

{% stepper %}
{% step %}

#### **獲取 WebScraping.ai API 金鑰**

1. 前往 [WebScraping.ai](https://webscraping.ai/) 官網註冊或登入帳戶。
2. 在控制面板中找到您的 API 金鑰。
   {% endstep %}

{% step %}

#### **建構**包含**代理的 API 請求**

WebScraping.ai 的 API 支援透過 `custom_proxy` 參數指定代理。請求格式如下:

```http
curl "https://api.webscraping.ai/html?url=https://target-website.com&api_key=YOUR_API_KEY&custom_proxy=protocol://username:password@host:port"
```

<details>

<summary><strong>參數說明</strong></summary>

* <mark style="color:blue;">`url`</mark>: 要抓取的目標網站地址。
* <mark style="color:blue;">`api_key`</mark>: 您在步驟 1 取得的 API 金鑰。
* <mark style="color:blue;">`custom_proxy`</mark>: 您的代理資訊，格式為<mark style="color:blue;">`protocol://username:password@host:port`</mark>

</details>
{% endstep %}

{% step %}

#### **驗證代理**

將你的真實憑證填入步驟 2 建構的命令中，執行命令後，[WebScraping.ai](https://webscraping.ai/) 會回傳抓取到的頁面內容。由於目標 URL 是 ipinfo.io/json，返回的 JSON 資料中應包含 IP 訊息

<figure><img src="/files/LRkKGFyANTz3Fg0yQf0R" alt="" width="563"><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

***
