> ## Documentation Index
> Fetch the complete documentation index at: https://brightdata-ipv6-release.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# API vs 本地访问

> 哪种方式更适合我？

Bright Data 的代理和解锁平台（Web Unlocker、SERP 和代理产品）可通过两种方式访问：

1. **API 访问** - 通过标准化的 HTTP 方法（如 GET、POST、REST API 调用）和端点与 Bright Data 平台交互，以发送请求并检索结构化数据（JSON 或 HTML）。

   适用于：与内部脚本或第三方应用程序的无缝、可扩展集成。

2. **本地访问** - 通过为每个产品定制的代理协议直接与 Bright Data 平台交互。

   适用于：需要直接代理连接（IP:端口）的网页浏览器和[第三方工具](https://docs.brightdata.com/integrations)集成。

## **请求示例**

### **API 访问**

```sh theme={null}
curl https://api.brightdata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer <API_TOKEN>" -d "{"zone": "zone_name","url": "https://www.example.com", "format": "raw"}"
```

### **本地访问**

```sh theme={null}
curl -i --proxy brd.superproxy.io:33335 --proxy-user <USERNAME>:<PASSWORD> "https://www.example.com"
```

## **API vs 本地访问对比**

| 参数         | API 访问                         | 本地访问                |
| ---------- | ------------------------------ | ------------------- |
| **推荐产品**   | Web Unlocker API, SERP API, 代理 | 代理 - 适用于需要直接代理连接的情况 |
| **SSL 证书** | 不需要                            | 需要（数据中心和 ISP 代理除外）  |
| **账户验证**   | 通常不需要                          | 某些特定域名需要            |
| **连接方式**   | API 端点                         | 代理端点                |
| **身份验证**   | API 令牌                         | 用户名:密码              |
| **输出格式**   | HTML 或 JSON                    | HTML                |

## **计费**

本地访问和 API 访问的计费 **相同**，费用基于您的 Bright Data 产品的常规定价。
