Google Events API
从 Google Events 检索结构化事件数据。设置 engine=google_events 并传入类似 “Events in Paris” 的搜索短语,即可获取指定地区即将举行的活动的精选列表。
Endpoint
Section titled “Endpoint” GET https://serp.shifter.io/v1?engine=google_events&api_key=YOUR_API_KEY
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | string | yes | 您的 SERP API 密钥 |
engine | string | yes | 必须为 google_events |
q | string | yes | 事件搜索查询 |
device | string | no | desktop、mobile 或 tablet |
google_domain | string | no | 要使用的 Google 域名 |
location | string | no | 地理定位位置名称 |
uule | string | no | Google 编码的位置字符串 |
hl | string | no | 界面语言代码 |
gl | string | no | 国家/地区代码 |
Example request
Section titled “Example request”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();Example response
Section titled “Example response”{ "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://..." } ]}