For the complete documentation index, see llms.txt. This page is also available as Markdown.

Best Buy

面向搜索和产品源的 Best Buy 抓取 API。包含解析数据支持和完整的集成示例。

使用网页爬虫API,您可以抓取并解析各种类型的 Best Buy 页面;以下是所有受支持的采集器及其对应值的概览。 source 值。

来源
描述
专用解析器

bestbuy_search

搜索页面 适用于您选择的搜索词。

否。

bestbuy_product

商品页面 适用于您选择的商品ID。

是。

入门

创建您的 API 用户凭据:注册免费试用,或在 Oxylabs 仪表板 创建您的 API 用户凭据(USERNAMEPASSWORD).

请求示例

curl 'https://realtime.oxylabs.io/v1/queries' \\
--user "USERNAME:PASSWORD" \
-H "Content-Type: application/json" \
-d '{
        "source": "bestbuy_product",
        "product_id": "6525410",
        "parse": true
    }'
import requests
from pprint import pprint

# 结构化载荷。
payload = {
    'source': 'bestbuy_product',
    'product_id': '6525410',
    'parse': True
}

# 获取响应。
response = requests.request(
    'POST',
    'https://realtime.oxylabs.io/v1/queries',
    auth=('USERNAME', 'PASSWORD'),
    json=payload,
)

# Print prettified response to stdout.
pprint(response.json())
输出示例
{
    "results": [
        {
            "content": {
                "url": "https://www.bestbuy.com/site/apple-iphone-15-plus-128gb-black-verizon/6525454.p?skuId=6525454&intl=nosplash",
                "price": {
                    "price": 25.83,
                    "currency": "USD"
                },
                "title": "Apple - iPhone 15 Plus 128GB - 黑色(Verizon)",
                "rating": {
                    "count": 55,
                    "score": 4.3
                },
                "_errors": [
                    "'NoneType' 对象没有属性 'xpath'"
                ],
                "product_id": "6525410",
                "is_sold_out": false,
                "parse_status_code": 12004,
            },
            "created_at": "2024-06-13 11:44:20",
            "updated_at": "2024-06-13 11:44:48",
            "page": 1,
            "url": "https://www.bestbuy.com/site/apple-iphone-15-plus-128gb-black-verizon/6525454.p?skuId=6525454&intl=nosplash",
            "job_id": "7206984735770310657",
            "status_code": 200,
            "parser_type": "bestbuy_product"
        }
    ]
}

我们在示例中使用同步 Realtime 集成方法。如果您想使用 Proxy Endpoint 或异步 Push-Pull 集成,请参阅 集成方法 部分。

您还可以选择包含其他参数,例如 user_agent_type, 解析, render 等,以自定义您的抓取请求。了解更多:

功能

最后更新于

这有帮助吗?