Google Product Offers
从 Google Shopping 商品页面获取所有商家报价,包含价格、评分和卖家信息。
API 用法
在 Crawling API 请求中添加 &scraper=google-product-offers。在 url 参数中传入经过 URL 编码的目标 URL。
curl 'https://api.crawlbase.com/?token=YOUR_TOKEN' \
--data-urlencode 'url=https://www.google.com/shopping/product/7015446445080090940/offers' \
--data-urlencode 'scraper=google-product-offers' -Gfrom crawlbase import CrawlingAPI
api = CrawlingAPI({'token': 'YOUR_TOKEN'})
res = api.get(
'https://www.google.com/shopping/product/7015446445080090940/offers',
{'scraper': 'google-product-offers'}
)
import json
data = json.loads(res['body'])const { CrawlingAPI } = require('crawlbase');
const api = new CrawlingAPI({ token: 'YOUR_TOKEN' });
const res = await api.get(
'https://www.google.com/shopping/product/7015446445080090940/offers',
{ scraper: 'google-product-offers' }
);
const data = JSON.parse(res.body);require 'crawlbase'
api = Crawlbase::API.new(token: 'YOUR_TOKEN')
res = api.get('https://www.google.com/shopping/product/7015446445080090940/offers', scraper: 'google-product-offers')
data = JSON.parse(res.body)示例输入 URL
传入 url 参数的 URL(为方便阅读已 URL 解码):
https://www.google.com/shopping/product/7015446445080090940/offers响应结构
JSON 响应体。当源页面缺少对应值时,字段类型可能为 null。
显示的商品名称。
商家报价。
商家名称。
标示价格。
运费或运送说明。
全新 / 二手 / 翻新。
卖家综合评分。
跳转到商家的链接。
响应示例
{
"product_title": "Sony WH-1000XM5 Wireless Headphones",
"offers": [
{
"seller": "Best Buy",
"price": "$348.00",
"shipping": "Free shipping",
"condition": "New",
"seller_rating": 4.8,
"url": "https://www.bestbuy.com/site/..."
}
]
}