# 配置

了解如何使用 Thordata 的 SERP API 获取您的第一段爬取代码。

导航至“[**配置**](https://dashboard.thordata.com/zh/serp-api/configuration)”

<div align="left"><figure><img src="/files/i06GO9TQElbGNgTweNRc" alt="" width="563"><figcaption></figcaption></figure></div>

**1、Thordata 提供两种方式来使用 SERP API ：**

* 直接 API 访问
* 基于本机的代理访问

<div align="left"><figure><img src="/files/tWlHGOEbo1B67nqHGDPo" alt="" width="563"><figcaption></figcaption></figure></div>

在“直接 API 访问”时，您需要 API 凭证。\
在“基于本机的代理访问”时，您需要用户名、密码。\
该信息您可以在配置页面的详细信息中找到，想要修改用户信息，您可以通过“账户”进行操作。

**2、SSL 证书：**\
为确保 SERP API 请求的安全性，请使用我们的 SSL 证书或者忽略 SSL 错误。

{% hint style="info" %}
[**点击此处**](https://doc.thordata.com/doc/zh/pa-qu/serp-api/ssl-zheng-shu)了解更多关于SERP API SSL 证书的教程
{% endhint %}

<div align="left"><figure><img src="/files/s10dLe9sOqGAvwxV8rVc" alt="" width="563"><figcaption></figcaption></figure></div>

**3、代码示例：**\
获得API凭证或者用户名、密码后，请使用以下代码发送您的请求：

```sh
curl https://scraperapi.thordata.com/request -H "Content-Type: application/json" -H "Authorization: Bearer APIKEY" -d "{\"url\": \"https://www.google.com/search?q=pizza\"}"
```

```sh
curl -k "https://www.bing.com/search?q=pizza&json=1" --proxy scraping.thordata.com:30001 --proxy-user td-customer-serp_USERNAME:PASSWORD
```

如果您需要更多帮助，请通过邮箱<support@thordata.com>联系我们。


---

# Agent Instructions: 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://doc.thordata.com/doc/zh/pa-qu/serp-api/pei-zhi.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.
