# Google Maps

**SERP API Google Maps 查询参数配置**

使用 **Thordata 的 SERP API** 可自定义 Google Maps 搜索查询，支持本地化参数、地理定位、搜索类型及高级分页设置。

<details>

<summary><strong><code>q</code> ，搜索查询(必填)</strong></summary>

**参数说明：**\
此参数用于定义数据抓取的搜索关键词（默认值：`q=pizza`）。支持使用任意语言的搜索关键词。

**示例请求：**\
使用参数 `q=pizza` 的搜索结果

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google_maps" \
 -d "q=pizza" \
 -d "json=1"
```

</details>

## 本土化

<details>

<summary><strong><code>google_domain</code>， 域名（非必填）</strong></summary>

**参数说明：**\
此参数用于指定数据抓取的搜索引擎域名（默认值：`google.com`）。您可以直接修改此参数，或参考 [Google 域名列表](https://www.google.com/supported_domains) 获取完整支持的域名列表。

**示例请求：**

使用参数 `q=pizza` 和 `url=google.co.ao` 的搜索结果

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google_maps" \
 -d "q=pizza" \
 -d "google_domain=google.co.ao" \
 -d "json=1"
```

</details>

<details>

<summary><strong><code>gl</code> ，国家（非必填）</strong></summary>

**参数说明：**\
此参数用于指定搜索结果的定位国家/地区（默认值：`gl=us`）。采用 [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) 两位字母国家代码（例如：`us`-美国，`ru`-俄罗斯，`uk`-英国）。

**完整国家代码支持列表：**\
请参阅 [Google官方国家代码表](https://developers.google.com/custom-search/docs/xml_results_appendices#countryCodes)

**示例请求：**

使用参数 `q=pizza` 和 `gl=ru` 的搜索结果

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google_maps" \
 -d "q=pizza" \
 -d "gl=ru" \
 -d "json=1"
```

</details>

<details>

<summary><strong><code>hl</code> ，语言（非必填）</strong></summary>

**参数说明**\
此参数用于设定搜索结果的界面语言（默认值：`hl=en`）。需采用标准语言代码格式（例如：`en`-英文、`es`-西班牙文、`zh-CN`-简体中文）。

**完整语言代码支持列表**\
请参阅 [Google官方语言代码表](https://developers.google.com/custom-search/docs/xml_results_appendices#interfaceLanguages)

**示例请求**

查询`q` ：<mark style="color:blue;">pizza</mark>,`hl`： <mark style="color:blue;">es</mark>的示例结果

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google_maps" \
 -d "q=pizza" \
 -d "json=1" \
 -d "hl=es"
```

</details>

## 分页

<details>

<summary><strong><code>start</code> ，结果偏移量（非必填）</strong></summary>

此参数用于控制搜索结果的分页起始位置（默认从第1条开始）。数值表示跳过的结果数量，例如：

* `start=0`：从第1条结果开始（默认值）
* `start=30`：跳过前30条，从第31条开始显示

**示例请求：**

查询 `q` : <mark style="color:blue;">pizza</mark>,`start`:<mark style="color:blue;">30</mark>的示例

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google_maps" \
 -d "q=pizza" \
 -d "json=1" \
 -d "start=30"
```

</details>

## 地理位置

<details>

<summary><code>ll</code> <strong>,</strong>GPS 坐标<strong>（非必填）</strong></summary>

**GPS 参数**用于定义搜索来源位置的坐标，其值必须符合以下格式：\
`@纬度,经度,缩放级别`

例如：\
`@40.7455096,-74.0083012,14z`

**请求示例**：

查询参数 `q`（关键词）：`pizza`，并搭配 `ll`（定位参数）：\
`@40.7455096,-74.0083012,14z`

```
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google_maps" \
 -d "q=pizza" \
 -d "json=1" \
 -d "ll=@40.7455096,-74.0083012,14z"
```

</details>

## 搜索类型

<details>

<summary><code>type</code> <strong>,</strong>搜索类型<strong>（非必填）</strong></summary>

搜索参数定义了要执行的搜索类型，它可以设置为： `search` - 当 `q` 参数设置时，返回结果列表， `place` - 当 `data` 参数设置时，返回特定地点的结果 使用 `place_id` 或 `data_cid` 时不需要参数。&#x20;

示例请求：&#x20;

`q`: pizza,`type`:search 的示例结果

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google_maps" \
 -d "q=pizza" \
 -d "json=1" \
 -d "type=search"
```

</details>

## 高级参数

<details>

<summary><code>data</code> <strong>,</strong>数据<strong>（非必填）</strong></summary>

**参数**可用于筛选搜索结果。您可以访问 Google 地图网站，设置所需的筛选条件，然后直接从其 URL 中复制数据值到 SerpApi 的 URL。

**示例请求**：

`q : pizza,data:20250815` 的示例结果

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google_maps" \
 -d "q=pizza" \
 -d "json=1" \
 -d "data=20250815"
```

</details>

<details>

<summary><code>place_id</code> <strong>,</strong>地点 ID<strong>（非必填）</strong></summary>

**参数**定义了 Google 地图中地点的唯一标识。Place ID 适用于大多数地点，包括商家、地标、公园和交叉路口。您可以使用我们的 Google Maps API 来查询 `place_id`。

**示例请求**：

`q : pizza,place_id:541541233999` 的示例结果

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google_maps" \
 -d "q=pizza" \
 -d "json=1" \
 -d "data=20250815" \
 -d "place_id=541541233999"
```

</details>

<details>

<summary><code>data_cid</code> <strong>,</strong>Google CID<strong>（非必填）</strong></summary>

参数定义了 Google 地图中地点的 CID（客户识别码）。该参数可在 Google Maps API 本地结果、Google Search API 和 Google Local API 本地结果中找到，名称为 `place_id`。您也可以使用 Google 的 CID 转换工具来获取该值。

**示例请求：**

`q` : pizza,`data_cid`:001 的示例结果

```sh
curl -X POST https://scraperapi.thordata.com/request \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -H "Authorization: Bearer token" \
 -d "engine=google_maps" \
 -d "q=pizza" \
 -d "json=1" \
 -d "data_cid=001"
```

</details>

如果您需要更多帮助，请通过邮&#x7BB1;**<support@thordata.com>**&#x8054;系我们。
