Google 本地服务 API
抓取 Google 本地服务广告,适用于特定区域的商家,例如电工、水管工或锁匠。设置 engine=google_local_services,在 q 中传入服务查询,并在 place 中指定区域。
Endpoint
Section titled “Endpoint” GET https://serp.shifter.io/v1?engine=google_local_services&api_key=YOUR_API_KEY
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | string | yes | 您的 SERP API 密钥 |
engine | string | yes | 必须为 google_local_services |
q | string | yes | 您要查找的服务 |
place | string | yes | 要在其中搜索的城市或区域 |
Example request
Section titled “Example request”curl "https://serp.shifter.io/v1?engine=google_local_services&api_key=YOUR_API_KEY&q=electrician&place=orlando"import requests
params = { "engine": "google_local_services", "api_key": "YOUR_API_KEY", "q": "electrician", "place": "orlando",}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_local_services', api_key: 'YOUR_API_KEY', q: 'electrician', place: 'orlando',});const data = await (await fetch(url)).json();Example response
Section titled “Example response”{ "search_parameters": { "engine": "google_local_services", "q": "electrician", "place": "orlando" }, "local_ads": [ { "title": "Super Fast Electric", "link": "https://google.com/localservices/profile?q=electrician+near+orlando&...", "rating": 5, "reviews": 7, "phone": "+14074996813", "bagde": "GOOGLE GUARANTEED", "service_area": "Serves Orlando", "experience": "6+ years in business", "open_hours": "Open, Closes 4:30PM" }, { "title": "A-Lumination Electric", "rating": 4.3, "reviews": 95, "phone": "+14076334044", "bagde": "GOOGLE GUARANTEED", "service_area": "Serves Orlando", "experience": "33+ years in business" } ]}