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

# 发送你的第一个 Google API 请求

> 使用可复制粘贴的代码示例向每个 Bright Data Google 爬虫 API 端点发送同步请求。

本指南介绍如何向每个 Bright Data Google 爬虫 API 端点发送同步请求。最终，你将获得适用于地图、评论、购物、SERP、AI Mode、航班和酒店的可工作示例。

## 先决条件

* 具有活动 API 密钥的 [Bright Data 账户](https://www.bright.cn/cp/start)
* 已完成[快速开始](/cn/products/scrapers/google/quickstart)

## 请求结构

每个同步请求都遵循相同的模式：

```
POST https://api.brightdata.com/datasets/v3/scrape?dataset_id={DATASET_ID}&format=json
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

[{"url": "https://www.google.com/..."}]
```

端点之间唯一变化的是 `dataset_id`、可选的发现查询参数以及输入结构。

<Note>
  同步请求最多支持 20 个输入，超时时间为 1 分钟。如果请求耗时更长，API 会自动返回 `snapshot_id`。请参阅[异步请求](/cn/products/scrapers/scrapers-library/async-requests)。
</Note>

## Google 地图 - 按 URL 收集

按 URL 抓取特定的 Google 地图地点。

**数据集 ID：** `gd_m8ebnr0q2qlklc02fz`

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST \
    "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_m8ebnr0q2qlklc02fz&format=json" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '[{"url": "https://www.google.com/maps/place/Empire+State+Building"}]'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.brightdata.com/datasets/v3/scrape",
      params={"dataset_id": "gd_m8ebnr0q2qlklc02fz", "format": "json"},
      headers={
          "Authorization": "Bearer YOUR_API_KEY",
          "Content-Type": "application/json",
      },
      json=[{"url": "https://www.google.com/maps/place/Empire+State+Building"}],
  )

  print(response.json())
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_m8ebnr0q2qlklc02fz&format=json",
    {
      method: "POST",
      headers: {
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
      },
      body: JSON.stringify([
        { url: "https://www.google.com/maps/place/Empire+State+Building" }
      ]),
    }
  );

  const data = await response.json();
  console.log(data);
  ```
</CodeGroup>

[完整架构](/cn/api-reference/scrapers/search-engines-apis/google-maps-collect-by-url)

## Google 地图 - 按 CID 发现

使用 Customer ID (CID) 值查找 Google 地图地点。

**数据集 ID：** `gd_m8ebnr0q2qlklc02fz`

```bash cURL theme={null}
curl -X POST \
  "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_m8ebnr0q2qlklc02fz&format=json&type=discover_new&discover_by=cid" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{"CID": "14408248692727049506"}]'
```

[完整架构](/cn/api-reference/scrapers/search-engines-apis/google-maps-discover-by-cid)

## Google 地图 - 按 place\_id 发现

使用 Google 地图 place ID 查找地点。

**数据集 ID：** `gd_m8ebnr0q2qlklc02fz`

```bash cURL theme={null}
curl -X POST \
  "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_m8ebnr0q2qlklc02fz&format=json&type=discover_new&discover_by=place_id" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{"place_id": "ChIJS5WVcqWh9YgRHU08rJqLNsQ"}]'
```

[完整架构](/cn/api-reference/scrapers/search-engines-apis/google-maps-discover-by-place-id)

## Google 地图 - 按位置发现

使用纬度、经度、缩放级别和搜索关键词查找地理点附近的地点。

**数据集 ID：** `gd_m8ebnr0q2qlklc02fz`

```bash cURL theme={null}
curl -X POST \
  "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_m8ebnr0q2qlklc02fz&format=json&type=discover_new&discover_by=location" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{"country": "US", "lat": 40.7484, "long": -73.9857, "zoom_level": 14, "keyword": "coffee shop"}]'
```

[完整架构](/cn/api-reference/scrapers/search-engines-apis/google-maps-discover-by-location)

## Google 地图评论 - 按 URL 收集

抓取 Google 地图地点的评论，可选择限制为最近 N 天内发布的评论。

**数据集 ID：** `gd_luzfs1dn2oa0teb81`

```bash cURL theme={null}
curl -X POST \
  "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_luzfs1dn2oa0teb81&format=json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{"url": "https://www.google.com/maps/place/Empire+State+Building", "days_limit": 30}]'
```

[完整架构](/cn/api-reference/scrapers/search-engines-apis/google-maps-reviews-collect-by-url)

## Google 购物 - 按 URL 收集

按 URL 抓取 Google 购物产品页面，可选择国家/地区定位。

**数据集 ID：** `gd_ltppk50q18kdw67omz`

```bash cURL theme={null}
curl -X POST \
  "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_ltppk50q18kdw67omz&format=json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{"url": "https://www.google.com/shopping/product/12345", "country": "US"}]'
```

[完整架构](/cn/api-reference/scrapers/search-engines-apis/google-shopping-collect-by-url)

## Google 购物 - 按关键词发现

查找与搜索词匹配的 Google 购物产品，可选择国家/地区定位。

**数据集 ID：** `gd_ltppk50q18kdw67omz`

```bash cURL theme={null}
curl -X POST \
  "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_ltppk50q18kdw67omz&format=json&type=discover_new&discover_by=keyword" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{"keyword": "wireless headphones", "country": "US"}]'
```

[完整架构](/cn/api-reference/scrapers/search-engines-apis/google-shopping-discover-by-keyword)

## Google 购物产品搜索 US - 按 URL 收集

以美国为重点的 Google 购物搜索结果爬虫。

**数据集 ID：** `gd_m31f2k0d2m1bah4f3b`

```bash cURL theme={null}
curl -X POST \
  "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_m31f2k0d2m1bah4f3b&format=json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{"url": "https://www.google.com/search?tbm=shop&q=wireless+headphones"}]'
```

[完整架构](/cn/api-reference/scrapers/search-engines-apis/google-shopping-products-search-us-collect-by-url)

## Google SERP 100 结果 - 按 URL 收集

从 Google 搜索 URL 抓取最多 100 个自然结果，支持细粒度定位。

**数据集 ID：** `gd_mfz5x93lmsjjjylob`

```bash cURL theme={null}
curl -X POST \
  "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_mfz5x93lmsjjjylob&format=json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{
    "url": "https://www.google.com/search?q=best+coffee+nyc",
    "keyword": "best coffee nyc",
    "tbm": "",
    "language": "en",
    "uule": "",
    "brd_mobile": "",
    "tbs": "",
    "nfpr": "",
    "index": ""
  }]'
```

[完整架构](/cn/api-reference/scrapers/search-engines-apis/google-serp-100-collect-by-url)

## Google AI Mode 搜索 - 按 URL 收集

抓取 Google AI Mode 搜索的答案和引用。

**数据集 ID：** `gd_mcswdt6z2elth3zqr2`

```bash cURL theme={null}
curl -X POST \
  "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_mcswdt6z2elth3zqr2&format=json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{
    "url": "https://www.google.com/search?udm=50&q=how+to+train+for+a+marathon",
    "prompt": "how to train for a marathon",
    "country": "US"
  }]'
```

[完整架构](/cn/api-reference/scrapers/search-engines-apis/google-ai-mode-search-collect-by-url)

## Google 航班 - 按 URL 收集

从 Google 航班 URL 抓取航班选项、定价和行程。

**数据集 ID：** `gd_mhng7wen1rw0a3gvpf`

```bash cURL theme={null}
curl -X POST \
  "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_mhng7wen1rw0a3gvpf&format=json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{"url": "https://www.google.com/travel/flights?tfs=..."}]'
```

[完整架构](/cn/api-reference/scrapers/search-engines-apis/google-flights-collect-by-url)

## Google 航班 - 按输入过滤器发现

按出发地、目的地、日期和乘客数量查找航班。

**数据集 ID：** `gd_mhng7wen1rw0a3gvpf`

```bash cURL theme={null}
curl -X POST \
  "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_mhng7wen1rw0a3gvpf&format=json&type=discover_new&discover_by=input_filters" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{
    "origin": "JFK",
    "destination": "LAX",
    "departure": "2026-06-15",
    "return": "2026-06-22",
    "trip_type": "round_trip",
    "adults": 1,
    "children": 0,
    "infants_in_seat": 0,
    "infants_on_lap": 0,
    "cabin": "economy"
  }]'
```

[完整架构](/cn/api-reference/scrapers/search-engines-apis/google-flights-discover-by-input-filters)

## Google 酒店 - 按 URL 收集

按 URL 抓取 Google 酒店列表，可选择国家/地区定位。

**数据集 ID：** `gd_mg3gjfmg12tc2n5d4d`

```bash cURL theme={null}
curl -X POST \
  "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_mg3gjfmg12tc2n5d4d&format=json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{"url": "https://www.google.com/travel/hotels/entity/...", "country": "US"}]'
```

[完整架构](/cn/api-reference/scrapers/search-engines-apis/google-hotel-collect-by-url)

## Google 酒店 - 按过滤器 URL 发现

从过滤后的 Google 酒店 URL 发现酒店。

**数据集 ID：** `gd_mg3gjfmg12tc2n5d4d`

```bash cURL theme={null}
curl -X POST \
  "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_mg3gjfmg12tc2n5d4d&format=json&type=discover_new&discover_by=filter_url" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{
    "url": "https://www.google.com/travel/hotels/New+York?...",
    "country": "US",
    "currency": "USD"
  }]'
```

[完整架构](/cn/api-reference/scrapers/search-engines-apis/google-hotel-discover-by-filter-url)

## Google 酒店 - 按搜索发现

按目的地、日期和客人数量发现酒店。

**数据集 ID：** `gd_mg3gjfmg12tc2n5d4d`

```bash cURL theme={null}
curl -X POST \
  "https://api.brightdata.com/datasets/v3/scrape?dataset_id=gd_mg3gjfmg12tc2n5d4d&format=json&type=discover_new&discover_by=search" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '[{
    "search_term": "New York",
    "check_in_date": "2026-06-15",
    "check_out_date": "2026-06-18",
    "guest_number": 2,
    "country": "US",
    "currency": "USD"
  }]'
```

[完整架构](/cn/api-reference/scrapers/search-engines-apis/google-hotel-discover-by-search)

## 相关内容

<CardGroup cols={2}>
  <Card title="异步批量请求" icon="layer-group" href="/cn/products/scrapers/scrapers-library/async-requests">
    在单个异步请求中抓取数千条记录或运行发现任务。
  </Card>

  <Card title="API 参考" icon="code" href="/cn/api-reference/scrapers/search-engines-apis/google-maps-collect-by-url">
    完整的端点规范、参数和响应架构。
  </Card>
</CardGroup>
