登录

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' -G
from 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
string
显示的商品名称。
offers
array
商家报价。
offers[].seller
string
商家名称。
offers[].price
string
标示价格。
offers[].shipping
string | null
运费或运送说明。
offers[].condition
string
全新 / 二手 / 翻新。
offers[].seller_rating
number | null
卖家综合评分。
offers[].url
string
跳转到商家的链接。

响应示例

{
  "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/..."
    }
  ]
}