登录
推荐使用 JS token

部分 eBay 页面通过 JavaScript 或 iframe 加载内容。如需完整提取数据,请使用您的 JavaScript token

API 用法

Crawling API 请求中添加 &scraper=ebay-serp。在 url 参数中对目标 URL 进行 URL 编码。

curl 'https://api.crawlbase.com/?token=YOUR_TOKEN' \
  --data-urlencode 'url=https://www.ebay.com/sch/i.html?_nkw=iphone+x' \
  --data-urlencode 'scraper=ebay-serp' -G
from crawlbase import CrawlingAPI

api = CrawlingAPI({'token': 'YOUR_TOKEN'})
res = api.get(
    'https://www.ebay.com/sch/i.html?_nkw=iphone+x',
    {'scraper': 'ebay-serp'}
)

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.ebay.com/sch/i.html?_nkw=iphone+x',
  { scraper: 'ebay-serp' }
);
const data = JSON.parse(res.body);
require 'crawlbase'
api = Crawlbase::API.new(token: 'YOUR_TOKEN')

res = api.get('https://www.ebay.com/sch/i.html?_nkw=iphone+x', scraper: 'ebay-serp')
data = JSON.parse(res.body)

示例输入 URL

传入 url 参数的 URL(已 URL 解码以便阅读):

https://www.ebay.com/sch/i.html?_nkw=iphone+x

响应结构

JSON 响应体。当源页面未提供该值时,字段类型可能为 null

query
string
搜索查询词。
total_results
integer | null
结果总数。
products
array
产品摘要。
products[].item_id
string
eBay 商品 ID。
products[].title
string
商品标题。
products[].url
string
商品 URL。
products[].price
string
价格。
products[].shipping
string
运费。
products[].condition
string
全新 / 二手 / 翻新。
products[].seller
string
卖家用户名。
products[].image_url
string
缩略图。

响应示例

{
  "query": "iphone x",
  "products": [
    {
      "item_id": "156078647276",
      "title": "Apple iPhone X 64GB Unlocked",
      "price": "$129.99",
      "shipping": "Free shipping",
      "condition": "Used",
      "seller": "phonecollector_us"
    }
  ]
}