> ## 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 爬虫快速开始

> 在 5 分钟内设置 Bright Data Google 爬虫 API 并收集你的第一个 Google 地图地点。

本教程向你展示如何使用 Bright Data Google 爬虫 API 抓取 Google 地图地点并获得结构化 JSON 数据。

## 先决条件

* [Bright Data 账户](https://www.bright.cn/cp/start)（每月含 5,000 个免费积分）
* 已安装 cURL、Python 3 或 Node.js 18+

<Steps>
  <Step title="获取 API 密钥">
    前往 Bright Data 账户中的[用户设置页面](https://www.bright.cn/cp/setting/users)并复制你的 API 密钥。

    如果你还没有账户，[在 brightdata.com 注册](https://www.bright.cn/cp/start)。新账户每月可获得 5,000 个免费积分，无需信用卡。请参阅[免费套餐](/cn/general/account/billing-and-pricing/free-tier)。

    <Warning>
      API 密钥仅在创建时显示一次。请复制并安全存储。
    </Warning>
  </Step>

  <Step title="发送请求">
    我们将使用 **Google 地图 - 按 URL 收集**端点的同步请求。将 `YOUR_API_KEY` 替换为你的实际密钥：

    <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>

    你应该会看到 `200` 状态码。这需要 10 到 30 秒。
  </Step>

  <Step title="查看响应">
    Bright Data Google 爬虫 API 返回一个包含结构化地点数据的 JSON 数组：

    ```json theme={null}
    [
      {
        "place_id": "ChIJaXQRs6lZwokRY6EFpJnhNNE",
        "name": "Empire State Building",
        "address": "20 W 34th St., New York, NY 10001",
        "category": "Observation deck",
        "rating": 4.7,
        "reviews_count": 98500,
        "phone": "+1 212-736-3100",
        "website": "https://www.esbnyc.com/",
        "latitude": 40.7484405,
        "longitude": -73.9856644,
        "open_hours": {},
        "photos": [],
        "url": "https://www.google.com/maps/place/Empire+State+Building"
      }
    ]
    ```

    每个地点对象包括位置详情、评分、营业时间、照片和联系信息。
  </Step>
</Steps>

你已成功使用 Bright Data Google 爬虫 API 抓取了你的第一个 Google 地图地点。

## 下一步

<CardGroup cols={3}>
  <Card title="发送第一个请求" icon="bolt" href="/cn/products/scrapers/google/send-first-request">
    使用 cURL、Python 和 Node.js 探索每个端点的完整示例。
  </Card>

  <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>
