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

产品

通过产品 ID 和门店规格抓取 Kroger 产品页数据,包括价格、库存和履约选项。

kroger_product 数据源旨在检索 Kroger 商品页面。

请求示例

在下面的示例中,我们发起请求以检索商品 ID 为 0021006550000的商品页面,并使用 ZIP 代码 65401指定配送地点,设置履约类型为 delivery,并将商店 ID 设为 1100002.

curl 'https://realtime.oxylabs.io/v1/queries' \\
--user 'USERNAME:PASSWORD' \\
-H 'Content-Type: application/json' \\
-d '{
        "source": "kroger_product",
        "product_id": "0021006550000",
        "delivery_zip": "65401",
        "fulfillment_type": "pickup",
        "store_id": "01100002"
    }'
import requests
from pprint import pprint

# 结构化载荷。
payload = {
    "source": "kroger_product",
    "product_id": "0021006550000",
    "delivery_zip": "65401",
    "fulfillment_type": "pickup",
    "store_id": "01100002",
}

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

# Print prettified response to stdout.
pprint(response.json())

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

请求参数值

通用

抓取 Kroger 商品页面的基础设置和自定义选项。

参数
描述
默认值

source

设置抓取器。

kroger_product

product_id

13 位字符的商品 ID。

-

render

设置为时启用 JavaScript 渲染 html. 更多信息.

-

callback_url

回调端点的 URL。 更多信息

-

user_agent_type

设备类型和浏览器。完整列表可在 此处.

desktop

- 必填参数

本地化

可根据门店位置、配送区域和首选履约方式自定义结果。

参数
描述
默认值
依赖项

store_id

指定门店。查看可用值 此处。ID 必须以 '0' 开头。

-

在以下情况下需要 fulfillment_type 设置为 pickupin_store.

delivery_zip

指定配送地点的 ZIP 代码。

-

在以下情况下需要 fulfillment_type 设置为 delivery.

fulfillment_type

指定订单履约方式。可用值: pickup, delivery, in_store.

in_store (如果仅 store_id 提供)

需要 store_idpickupin_store,或 delivery_zipdelivery.

依赖项说明:

  • pickupin_store 值使用 store_id 参数来确定正确的门店。

  • delivery 使用 delivery_zip 参数来指定送货地点。

  • 如果仅 store_id 提供了,并且 fulfillment_type 未指定,则默认类型为 in_store.

最后更新于

这有帮助吗?