Google Maps scraper API 與 MCP

Google Maps scraper API 讓您的應用程式或 AI 代理執行一次有上限的商家搜尋。每次重試都由同一把限定範圍的工作區金鑰、明確的任務預算和穩定的冪等鍵涵蓋。結果為 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 設為不低於預估值。

保證能取得電子郵件和電話嗎?

不保證。涵蓋情況取決於來源及商家。選用補充功能可能回傳公開聯絡資訊,使用前請核對缺少或過時的資料。

資源

下一份名單,從一個地點開始。

先用明確標註的範例紀錄體驗流程,再連接工作區進行即時研究。

查看範例