Google Maps API
从 Google Maps 中提取商家和位置数据。设置 engine=google_maps,并使用 type=search 获取关键词列表,或使用 type=place 获取单个地点的完整信息。
Endpoint
Section titled “Endpoint” GET https://serp.shifter.io/v1?engine=google_maps&api_key=YOUR_API_KEY
| 参数 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
api_key | string | 是 | 您的 SERP API 密钥 |
engine | string | 是 | 必须为 google_maps |
q | string | 是 | 要搜索的关键词 |
type | string | 是 | search 或 place |
data | string | 否 | 当 type=place 时必填。格式为 !4m5!3m4!1s + data_id + !8m2!3d + latitude + !4d + longitude |
device | string | 否 | desktop、mobile 或 tablet |
google_domain | string | 否 | 要使用的 Google 域名 |
hl | string | 否 | 界面语言代码 |
ll | string | 否 | GPS 坐标,格式为 @latitude,longitude,zoom |
curl "https://serp.shifter.io/v1?engine=google_maps&api_key=YOUR_API_KEY&q=pizza&type=search"import requests
params = { "engine": "google_maps", "api_key": "YOUR_API_KEY", "q": "pizza", "type": "search",}r = requests.get("https://serp.shifter.io/v1", params=params)data = r.json()import fetch from 'node-fetch';
const url = 'https://serp.shifter.io/v1?' + new URLSearchParams({ engine: 'google_maps', api_key: 'YOUR_API_KEY', q: 'pizza', type: 'search',});const data = await (await fetch(url)).json();{ "search_parameters": { "engine": "google_maps", "q": "pizza", "type": "search", "google_domain": "google.com" }, "places_results": [ { "position": 1, "title": "Joe's Pizza", "place_id": "ChIJ...", "data_id": "0x89c25994a1b6e4a3:0x...", "gps_coordinates": { "latitude": 40.730, "longitude": -73.998 }, "rating": 4.5, "reviews": 2431, "type": "Pizza restaurant", "address": "7 Carmine St, New York, NY 10014", "phone": "(212) 366-1182", "website": "https://www.joespizzanyc.com/" } ]}