Google Maps scraper API 与 MCP

Google Maps scraper API 让您的应用或智能体运行一次有上限的商家搜索。每次重试都由同一把限定范围的工作区密钥、明确的任务预算和稳定的幂等键覆盖。结果为 JSON,缺失的字段保持为空。

运行之前 · 实时调研需要配置数据源。示例数据均有标注。付费套餐尚未开放。

创建有界作业

用限定权限的工作区密钥,通过 REST 或 HTTP MCP 客户端调用 Google Maps scraper API:估算任务、设定明确预算并读取结构化结果。

curl -X POST https://mapsscraper.dev/api/v1/jobs \
  -H "Authorization: Bearer $MAPSSCRAPER_API_KEY" \
  -H "Idempotency-Key: dentists-austin-tx-001" \
  -H "X-Max-Units: 1" \
  -H "Content-Type: application/json" \
  -d '{"kind":"search","query":"Dentists in Austin, TX","limit":20,"region":"us"}'

HTTP/1.1 202 Accepted
{"id":"6f1c2b3a-0000-4000-8000-000000000000","status":"queued","reserved":1}

使用相同的幂等键重试同一业务操作。用该键发送已更改的请求会返回 409。任务会经历排队中、运行中、已完成、部分完成、失败、已取消或不确定等状态。数据源请求结果不确定时需要对账,而不是自动付费重放。

什么是 Google Maps scraper API?

Google Maps scraper API 接受一个类别和一个区域,以 JSON 返回公开商家信息,并在请求运行前显示任务的最高预算。每个任务使用一把限定范围的密钥和一个幂等键。评论需单独请求。

读取结果

已完成和部分完成的作业会在工作区保留期内保存结果。使用 offset 和 limit 分页读取;读取已存储的结果绝不会发起新的调研。

示例响应(已缩略)。数值仅作示意,并非真实商家数据。

{
  "items": [
    {
      "business_id": "sample-business-id",
      "name": "Sample Dental Studio",
      "full_address": "100 Example Ave, Austin, TX 78701",
      "phone_number": "+1 512-555-0100",
      "website": "https://dental.example",
      "type": "Dentist",
      "rating": 4.8,
      "review_count": 214,
      "latitude": 30.2672,
      "longitude": -97.7431,
      "_source": {
        "provider": "live_maps",
        "fetched_at": "2026-11-01T12:00:00Z",
        "website_status": "provided_unverified"
      }
    }
  ],
  "count": 1,
  "offset": 0,
  "next_offset": null,
  "provider": "live_maps",
  "coverage": "bounded_sample",
  "fetched_at": "2026-11-01T12:00:00Z"
}

Google Maps 评论 API

每个任务请求一个商家 ID 的评论,每页最多 100 条,可按相关性、最新、评分最高或最低排序。每条评论包含正文、评分、日期、作者以及商家回复(如有)。下一页需要单独的任务和预算。

评价抓取
POST /api/v1/jobs
Idempotency-Key: reviews-sample-business-001
X-Max-Units: 1

{"kind":"reviews","business_id":"sample-business-id","limit":50,"review_options":{"sort_by":"newest"}}

Python 示例

用 requests 库调用 Google Maps scraper API:预估搜索、创建作业、等待最终状态并读取结果。

import os
import time
import uuid

import requests

API = "https://mapsscraper.dev/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['MAPSSCRAPER_API_KEY']}"}
task = {"kind": "search", "query": "Dentists in Austin, TX", "limit": 20, "region": "us"}

# An estimate reserves nothing.
units = requests.post(f"{API}/estimate", json=task, headers=HEADERS, timeout=30).json()["units"]

# Keep the key: a retry of the same task must send it again.
key = str(uuid.uuid4())
job = requests.post(
    f"{API}/jobs",
    json=task,
    headers={**HEADERS, "Idempotency-Key": key, "X-Max-Units": str(units)},
    timeout=30,
)
job.raise_for_status()
job_id = job.json()["id"]

while True:
    status = requests.get(f"{API}/jobs/{job_id}", headers=HEADERS, timeout=30).json()["status"]
    if status not in ("queued", "running"):
        break
    time.sleep(5)

if status in ("completed", "partial"):
    page = requests.get(
        f"{API}/jobs/{job_id}/results",
        params={"offset": 0, "limit": 100},
        headers=HEADERS,
        timeout=30,
    ).json()
    for business in page["items"]:  # follow page["next_offset"] for more
        print(business.get("name"), business.get("phone_number"), business.get("website"))

Google Maps scraper API 常见问题

文档
这是 Google Places API 吗?

不是。MapsScraper.dev 是一项独立服务,与 Google 没有关联。结果来自第三方商家数据源,并采用我们自己的 JSON 格式。

Google Maps scraper API 请求如何计费?

大多数任务使用 1 个单位。在搜索或排名快照中补充联系人信息时,每条请求记录会额外预留 1 个单位,且只按实际交付的记录计费。商家详情使用 1 个单位,含联系人时为 2 个;信息补充使用 2 个。请将 X-Max-Units 设为不低于预估值。

保证能获得邮箱和电话吗?

不保证。覆盖情况取决于来源和商家。可选补充功能可能返回公开联系人信息,使用前请核对缺失或过时的数据。

资源

下一份名单,从一个地点开始。

先用明确标注的示例记录体验流程,再连接工作区进行实时调研。

查看示例