Google 产品 API
使用已知的产品 ID 从 Google Shopping 产品页面检索产品详情。设置 engine=google_product 并传入 product_id,然后可选择启用 offers、specs 或 reviews 标志以扩展响应内容。
Endpoint
Section titled “Endpoint” GET https://serp.shifter.io/v1?engine=google_product&api_key=YOUR_API_KEY
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | string | yes | 您的 SERP API 密钥 |
engine | string | yes | 必须为 google_product |
product_id | string | yes | Google 产品 ID |
device | string | no | desktop、mobile 或 tablet |
google_domain | string | no | 要使用的 Google 域名 |
location | string | no | 地理定位位置名称 |
uule | string | no | Google 编码的位置字符串 |
hl | string | no | 界面语言代码 |
gl | string | no | 国家代码 |
start | int | no | 用于分页的结果偏移量 |
offers | int | no | 设置为 1 或 true 以获取报价 |
specs | int | no | 设置为 1 或 true 以获取产品规格 |
reviews | int | no | 设置为 1 或 true 以获取产品评论 |
filter | string | no | 筛选报价。取值:freeship:1、ucond:1、scoring:p、scoring:tp、scoring:cpd、scoring:mrd |
Example request
Section titled “Example request”curl "https://serp.shifter.io/v1?engine=google_product&api_key=YOUR_API_KEY&product_id=11607214845071611155"import requests
params = { "engine": "google_product", "api_key": "YOUR_API_KEY", "product_id": "11607214845071611155",}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_product', api_key: 'YOUR_API_KEY', product_id: '11607214845071611155',});const data = await (await fetch(url)).json();Example response
Section titled “Example response”{ "search_parameters": { "engine": "google_product", "product_id": "11607214845071611155" }, "product_results": { "title": "Sony WH-1000XM5 Wireless Noise Cancelling Headphones", "prices": ["$349.00 - $399.99"], "rating": 4.7, "reviews": 2341, "extensions": ["Wireless", "Noise Cancelling"], "description": "Industry leading noise cancellation...", "media": [ { "type": "image", "link": "https://..." } ] }, "sellers_results": { "online_sellers": [ { "name": "Best Buy", "total_price": "$349.00" } ] }}