Google Events API
从 Google Events 检索结构化事件数据。设置 engine=google_events 并传入类似 “Events in Paris” 的搜索短语,即可获取指定地区即将举行的活动的精选列表。
端点
章节标题“端点” GET https://serp.shifter.io/v1?engine=google_events&api_key=YOUR_API_KEY
参数
章节标题“参数”| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
api_key | string | 是 | 您的 SERP API 密钥 |
engine | string | 是 | 必须为 google_events |
q | string | 是 | 事件搜索查询 |
device | string | 否 | desktop、mobile 或 tablet |
google_domain | string | 否 | 要使用的 Google 域名 |
location | string | 否 | 地理定位位置名称 |
uule | string | 否 | Google 编码的位置字符串 |
hl | string | 否 | 界面语言代码 |
gl | string | 否 | 国家/地区代码 |
请求示例
章节标题“请求示例”curl "https://serp.shifter.io/v1?engine=google_events&api_key=YOUR_API_KEY&q=Events%20in%20Paris%2C%20France"import requests
params = { "engine": "google_events", "api_key": "YOUR_API_KEY", "q": "Events in Paris, France",}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_events', api_key: 'YOUR_API_KEY', q: 'Events in Paris, France',});const data = await (await fetch(url)).json();响应示例
章节标题“响应示例”{ "search_metadata": { "status": "Success" }, "search_parameters": { "engine": "google_events", "q": "Events in Paris, France", "google_domain": "google.com" }, "events_results": [ { "title": "Paris Fashion Week", "date": { "start_date": "Feb 27", "when": "Tue, Feb 27, 10:00 AM - Tue, Mar 5, 6:00 PM" }, "address": ["Paris, France"], "link": "https://www.example.com/event/...", "venue": { "name": "Le Grand Palais", "rating": 4.6 }, "thumbnail": "https://..." } ]}