商品
使用 Oxylabs 网页爬虫 API 轻松提取 Amazon 商品数据。使用自定义参数和示例获取标题、价格、评论和详情。
该 amazon_product 数据源旨在检索 Amazon 产品页面。
请求示例
在下面的示例中,我们发出请求以检索 ASIN 的产品页面 B08Y72CH1F 在 amazon.nl 市场。如果提供的 ASIN 是父 ASIN,我们会要求 Amazon 返回自动选择的变体的产品页面。API 将返回解析后的结果。
curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
"source": "amazon_product",
"domain": "nl",
"query": "B08Y72CH1F",
"parse": true,
"context": [
{
"key": "autoselect_variant",
"value": true
}
]
}'import requests
from pprint import pprint
# 构建负载(payload)。
payload = {
'source': 'amazon_product',
'domain': 'nl',
'query': 'B08Y72CH1F',
'parse': True,
'context': [
{'key': 'autoselect_variant', 'value': True}
],
}
# 获取响应。
response = requests.request(
'POST',
'https://realtime.oxylabs.io/v1/queries',
auth=('USERNAME', 'PASSWORD'),
json=payload,
)
# 将美化后的响应打印到标准输出。
pprint(response.json())const https = require("https");
const username = "USERNAME";
const password = "PASSWORD";
const body = {
source: "amazon_product",
domain: "nl",
query: "B08Y72CH1F",
parse: true,
context: [
{ key: "autoselect_variant", value: true },
],
};
const options = {
hostname: "realtime.oxylabs.io",
path: "/v1/queries",
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization:
"Basic " + Buffer.from(`${username}:${password}`).toString("base64"),
},
};
const request = https.request(options, (response) => {
let data = "";
response.on("data", (chunk) => {
data += chunk;
});
response.on("end", () => {
const responseData = JSON.parse(data);
console.log(JSON.stringify(responseData, null, 2));
});
});
request.on("error", (error) => {
console.error("Error:", error);
});
request.write(JSON.stringify(body));
request.end();https://realtime.oxylabs.io/v1/queries?source=amazon_product&domain=nl&query=B08Y72CH1F&parse=true&context[0][key]=autoselect_variant&context[0][value]=true&access_token=12345abcde<?php
$params = array(
'source' => 'amazon_product',
'domain' => 'nl',
'query' => 'B08Y72CH1F',
'parse' => true,
'context' => [
['key' => 'autoselect_variant', 'value' => true]
]
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://realtime.oxylabs.io/v1/queries");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERPWD, "USERNAME" . ":" . "PASSWORD");
$headers = array();
$headers[] = "Content-Type: application/json";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
echo $result;
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
const Username = "USERNAME"
const Password = "PASSWORD"
payload := map[string]interface{}{
"source": "amazon_product",
"domain": "nl",
"query": "B08Y72CH1F",
"parse": true,
"context": []map[string]interface{}{
{"key": "autoselect_variant", "value": true},
},
}
jsonValue, _ := json.Marshal(payload)
client := &http.Client{}
request, _ := http.NewRequest("POST",
"https://realtime.oxylabs.io/v1/queries",
bytes.NewBuffer(jsonValue),
)
request.SetBasicAuth(Username, Password)
response, _ := client.Do(request)
responseText, _ := ioutil.ReadAll(response.Body)
fmt.Println(string(responseText))
}
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Json;
using System.Threading.Tasks;
namespace OxyApi
{
class Program
{
static async Task Main()
{
const string Username = "USERNAME";
const string Password = "PASSWORD";
var parameters = new {
source = "amazon_product",
domain = "nl",
query = "B08Y72CH1F",
parse = true,
context = new dynamic [] {
new { key = "autoselect_variant", value = true },
}
};
var client = new HttpClient();
Uri baseUri = new Uri("https://realtime.oxylabs.io");
client.BaseAddress = baseUri;
var requestMessage = new HttpRequestMessage(HttpMethod.Post, "/v1/queries");
requestMessage.Content = JsonContent.Create(parameters);
var authenticationString = $"{Username}:{Password}";
var base64EncodedAuthenticationString = Convert.ToBase64String(System.Text.ASCIIEncoding.UTF8.GetBytes(authenticationString));
requestMessage.Headers.Add("Authorization", "Basic " + base64EncodedAuthenticationString);
var response = await client.SendAsync(requestMessage);
var contents = await response.Content.ReadAsStringAsync();
Console.WriteLine(contents);
}
}
}package org.example;
import okhttp3.*;
import org.json.JSONArray;
import org.json.JSONObject;
import java.util.concurrent.TimeUnit;
public class Main implements Runnable {
private static final String AUTHORIZATION_HEADER = "Authorization";
public static final String USERNAME = "USERNAME";
public static final String PASSWORD = "PASSWORD";
public void run() {
JSONObject jsonObject = new JSONObject();
jsonObject.put("source", "amazon_product");
jsonObject.put("domain", "nl");
jsonObject.put("query", "B08Y72CH1F");
jsonObject.put("parse", true);
jsonObject.put("context", new JSONArray().put(
new JSONObject()
.put("key", "autoselect_variant")
.put("value", true)
));
Authenticator authenticator = (route, response) -> {
String credential = Credentials.basic(USERNAME, PASSWORD);
return response
.request()
.newBuilder()
.header(AUTHORIZATION_HEADER, credential)
.build();
};
var client = new OkHttpClient.Builder()
.authenticator(authenticator)
.readTimeout(180, TimeUnit.SECONDS)
.build();
var mediaType = MediaType.parse("application/json; charset=utf-8");
var body = RequestBody.create(jsonObject.toString(), mediaType);
var request = new Request.Builder()
.url("https://realtime.oxylabs.io/v1/queries")
.post(body)
.build();
try (var response = client.newCall(request).execute()) {
if (response.body() != null) {
try (var responseBody = response.body()) {
System.out.println(responseBody.string());
}
}
} catch (Exception exception) {
System.out.println("Error: " + exception.getMessage());
}
System.exit(0);
}
public static void main(String[] args) {
new Thread(new Main()).start();
}
}{
"source": "amazon_product",
"domain": "nl",
"query": "B08Y72CH1F",
"parse": true,
"context": [
{
"key": "autoselect_variant",
"value": true
}
]
}在我们的示例中,我们使用同步的 Realtime 集成方法。如果您想使用 Proxy Endpoint 或异步的 Push-Pull 集成,请参阅 集成方法 部分。
请求参数值
通用
用于抓取 Amazon 产品页面的基本设置和自定义选项。
- 必填参数
本地化
将结果适配到特定地理位置、域名、语言。
重要说明: 在大多数页面类型上,Amazon 会根据客户的收货地址定制返回结果。因此,我们建议使用 geo_location 参数来设置您偏好的收货位置。您可以阅读更多关于在 Amazon 上使用 geo_location 的内容 此处.
其他
用于专门需求的附加高级设置和控制。
代码示例
{
"source": "amazon_product",
"domain": "de",
"query": "B0CW1QC1V1",
"parse": true,
"context": [
{
"key": "currency",
"value": "AUD"
}
]
}结构化数据
网页爬虫 API 能够提取包含 Amazon 产品结果的 HTML 或 JSON 对象,提供结果页面各元素的结构化数据。
输出数据字典
使用右侧导航或向下滚动页面浏览详细信息。
HTML 示例
JSON 结构
下表列出我们解析的每个 Amazon 产品页面元素的详细清单,包括其描述、数据类型,以及该元素是始终存在于布局中还是取决于所抓取的产品而可选。表中还包含一些元数据。
url
Amazon 产品的 URL。
字符串
page
当前页码。
整数
page_type
标识 Amazon 页面类型。
字符串
asin
Amazon 标准识别号。
字符串
asin_in_url
从 URL 中提取 Amazon 标准识别号 (ASIN)。
字符串
title
产品标题。
字符串
manufacturer
产品的制造商名称。
字符串
product_name
The name of the product.
字符串
description
从“产品描述”部分解析出的产品描述。
字符串
bullet_points
从“关于此商品”部分解析出的要点条目。
字符串
可选
类别
包含有关 Amazon 产品类别更详细信息的列表。
数组
可选
variation
包含有关 Amazon 产品变体更多详细信息的列表。
数组
可选
rating
产品的评分。
整数
价格
产品的价格。
float
price_upper
价格的上限。
float
可选
price_sns
标识产品是否属于“Subscribe & Save”计划的一部分。
float
price_initial
产品的原始非折扣价格。
float
price_shipping
运费价格。
float
可选
price_buybox
在 Buy Box 中显示的产品价格。
float
deal_type
标识促销优惠的类别。
字符串
可选
coupon
指示是否存在任何数字优惠券折扣。
字符串
可选
is_prime_eligible
指示该产品是否有资格参与 Amazon Prime。
boolean
is_addon_item
指示产品是否仅在订单满足最低价值门槛时才能购买。
boolean
可选
货币
价格所使用的货币。
字符串
discount_end
指示 Amazon 产品的促销折扣有效到的截止日期。
字符串
可选
stock
指示产品的库存水平。
字符串
reviews_count
该产品的评论数量。
整数
评价
包含各项评论及其相应详细信息的列表。
数组
answered_questions_count
有关 Amazon 产品的已回答客户问题的总数。
整数
可选
pricing_count
该产品的报价数量。
整数
可选
pricing_url
检索 Amazon 产品报价列表的 URL。
字符串
可选
pricing_str
Amazon 产品价格详情的字符串表示。该属性包含当前价格、任何折扣、促销和特价信息。
字符串
可选
featured_merchant
有关为某 Amazon 产品突出的主要卖家或供应商的详细信息列表。
对象
可选
sales_rank
有关 Amazon 产品在其所属类别中基于销售表现的排名位置信息的列表。
数组
可选
sns_discounts
指示作为“Subscribe & Save”计划一部分提供的任何折扣。
数组
developer_info
与产品的开发者或制造商相关的信息。
对象
可选
images
指示产品图片的 URL 列表。
数组
product_overview
包含产品关键属性及其描述的列表,提供有关产品特性的基本信息。
数组
可选
store_url
卖家商店网页的 URL。
字符串
可选
has_videos
指示产品是否有任何视频。
boolean
delivery
包含有关配送选项的信息列表。
对象
可选
brand
产品品牌。
字符串
可选
item_form
指定产品的物理形态或类型,详细说明其包装或交付使用的方式。
字符串
可选
sales_volume
在特定时间范围内售出的单位数量。
字符串
可选
other_sellers
列出其他销售该产品的卖家详情,包括卖家数量、其中的起始价格和基本运输信息。
字符串
可选
rating_stars_distribution
有关产品评分的详细分布列表。
数组
可选
buybox
有关产品价格的详细信息列表。
数组
可选
lightning_deal
指示该产品是否有限时促销优惠可用。
对象
可选
product_details
有关产品详细信息的信息列表。
对象
可选
product_dimensions
产品的尺寸。
字符串
可选
max_quantity
客户在单笔订单中被允许购买的某一 Amazon 产品的最大数量。
整数
可选
warranty_and_support
有关产品保修的详细信息列表。
对象
可选
discount.percentage
应用于 Amazon 产品原价的降幅百分比。
整数
可选
amazon_choice
指示该产品是否具有 Amazon's Choice 徽章。
boolean
可选
coupon_discount_percentage
指示使用优惠券适用的折扣百分比。
整数
可选
parent_asin
该产品所属的 Amazon 产品系列的主要标识符。
字符串
可选
created_at
抓取任务创建的时间戳。
时间戳
updated_at
抓取任务完成的时间戳。
时间戳
job_id
与抓取任务关联的作业 ID。
字符串
Category
此字段显示 Amazon 产品的分类层级结构。层级中的每个类别都是具有名称和 URL 的对象,表示从最广泛类别到最具体子类别的路径。
"category": [
{
"ladder": [
{
"name": "Office Products",
"url": "/office-products-supplies-electronics-furniture/b/ref=dp_bc_aui_C_1/133-6156367-1346746?ie=UTF8&node=1064954"
},
{
"name": "Office & School Supplies",
"url": "/Office-Supplies/b/ref=dp_bc_aui_C_2/133-6156367-1346746?ie=UTF8&node=1069242"
},
{
"name": "Paper",
"url": "/b/ref=dp_bc_aui_C_3/133-6156367-1346746?ie=UTF8&node=1069664"
},
{
"name": "Notebooks & Writing Pads",
"url": "/Notebooks-Writing-Pads/b/ref=dp_bc_aui_C_4/133-6156367-1346746?ie=UTF8&node=1069756"
},
{
"name": "Hardcover Executive Notebooks",
"url": "/Hardcover-Executive-Notebooks/b/ref=dp_bc_aui_C_5/133-6156367-1346746?ie=UTF8&node=490755011"
}
]
}
],ladder
包含 Amazon 产品面包屑的列表。
数组
ladder.name
Amazon 产品面包屑/类别的名称。
字符串
ladder.url
面包屑/类别的 URL。
字符串
广告
此字段包含有关在 Amazon 产品页面上展示的广告的信息。每个广告以对象形式表示,包含类型、位置、标题、ASIN、图片、位置、评分、评论数、Prime 资格和价格等详细信息。
...
"ads": [
{
"type": "organic_also_viewed",
"location": "carousel",
"title": "Camkix Tangentbordsrengöringssats – 1 x miniborste, 1 x rengöringsborste, 1 x tangentbordslockborttagare, 1 x luftfläkt och 1 x rengöringsduk – även för bärbara datorer, kameralinser, glasögon – hem och kontor",
"asin": "B07SRV9HQ4",
"images": [
"https://images-eu.ssl-images-amazon.com/images/I/81t5eLB69SL._AC_UL160_SR160,160_.jpg"
],
"pos": 1,
"rating": 4.3,
"reviews_count": 840,
"is_prime_eligible": false,
"price": 134.99,
"price_upper": 134.99
},
...
]
...type
Amazon 广告的类型。
字符串
位置
Amazon 广告投放位置的名称。
字符串
title
产品标题。
字符串
asin
Amazon 标准识别号。
字符串
images
产品图片的 URL。
字符串
pos
表示广告在所有可用广告结果中位置的唯一标识。
整数
rating
产品的评分。
整数
reviews_count
该产品的评论数量。
整数
is_prime_eligible
指示该产品是否有资格参与 Amazon Prime。
boolean
价格
产品的价格。
float
price_upper
如果适用,价格的上限。
float
评分星级分布
此字段包含产品的星级评分分布。每个对象表示一个星级评分以及给出该评分的评论所占的百分比。
...
"rating_stars_distribution": [
{
"rating": 5,
"percentage": 87
},
{
"rating": 4,
"percentage": 8
},
{
"rating": 3,
"percentage": 2
},
{
"rating": 2,
"percentage": 1
},
{
"rating": 1,
"percentage": 2
}
],
...
rating
指示评分数字(从 5 到 1 的刻度)。
整数
percentage
指示特定评分的百分比比率。
字符串
评论
包含产品客户评价的列表,每条评论以包含相关详细信息的对象表示。

"reviews": [
{
"id": "R22S287L9EGVTJ",
"title": "5.0 out of 5 stars Good keyboard",
"author": "JeffreyK",
"rating": 5,
"content": "Keyboard has been good so far. No problems. I read about the issue where the keyboard would spam keys. I think this is an issue with either messy macros and setting the actuation to low. I notice that sometimes, some of the keys are pressed around 0.2 mm without me pressing them. Might be the weight of the keycaps.If this is the case, if the actuation was set to 0.2mm, it would continuously register that press. Since I put my actuation at 1.4mm, it isn't a problem. However, I've only had the keyboard for a week. No issues so far.I'm used to tactile switches like MX Browns. The issue with linear switches like this one, is that sometimes I accidentally press keys because I can't feel the actuation of the keys. With these, since I can set their actuation. Accidental key press is not a problem. The rapid trigger is also pretty awesome. In games like Valorant/CS 2, it allows me to counterstrafe more consistently and quickly. I can juke right on the spot quickly. With a normal mech keyboard, it's not always spot on and consistent like that. Read more",
"timestamp": "Reviewed in the United States May 9, 2024",
"profile_id": "AH6T74ODE6XN2YQULBDPYJW7LNUQ",
"is_verified": false,
"review_from": "Top reviews from the United States"
},
...id
Amazon 评论的字母数字标识符。
字符串
title
评论的评分和标题。
字符串
author
提交该评论的用户。
字符串
rating
提交评论时给出的星级评分,通常在 1 到 5 之间。
整数
内容
评论内容的完整文本。
字符串
时间戳
评论的日期和地点,按 Amazon 提供的格式。
字符串
profile_id
评论作者个人资料的唯一标识符,用于链接到其 Amazon 个人资料。
字符串
is_verified
指示评论是否来自已验证购买。
boolean
review_from
提供有关评论来源的附加上下文(例如,特定地点的评论或热门评论)。
字符串
helpful_count (可选)
该评论获得的有用票数。
整数
product_attributes (可选)
识别产品的特性。
字符串
Variations
此字段包含有关产品不同变体的信息,例如颜色、尺寸、款式等。每个变体以对象表示,包含 ASIN、选择状态、尺寸(诸如颜色、尺寸、款式等属性)以及提示图片 URL 等详细信息。
...
"variation": [
{
"asin": "B07RM6QYWC",
"selected": false,
"dimensions": {
"Color": "Ocean Blue",
"Size": "128GB",
"Style": "Verizon"
},
"tooltip_image": "https://m.media-amazon.com/images/I/41zzpCgao9L._SS36_.jpg"
},
...
asin
产品变体的 Amazon 标准识别号 (ASIN)。
数组
selected
标识所选的产品变体。
boolean
dimensions
变体产品的属性维度。
对象
可选
dimensions.size
变体产品的尺寸。
字符串
可选
dimensions.color
变体产品的颜色。
字符串
可选
dimensions.style
变体产品的款式。
字符串
可选
dimensions.unit count
变体产品的标准单位数量。
字符串
可选
tooltip_image
变体图片的 URL。
字符串
可选
Warranty and Support
此字段包含有关产品保修和支持选项的信息。它包括产品保修的描述以及获取保修信息的链接。
...
"warranty_and_support": {
"description": "Product Warranty: For warranty information about this product, please click here",
"links": [
{
"title": "click here",
"url": "/gp/feature.html/ref=dp_warranty_request_3P?docId=1002406021"
}
]
},
...description
产品可用保修的描述。
字符串
链接
包含有关产品保修的更多信息的列表。
数组
links.title
保修的标题。
字符串
links.url
包含有关产品保修的更多信息的 URL。
字符串
Featured Merchant
此字段提供有关销售该产品的精选商家的信息。它包括商家名称、卖家 ID、商家页面链接、产品是否由 Amazon 履行以及发货来源等详细信息。
...
"featured_merchant": {
"name": "LYTEK LLC",
"seller_id": "A2OL0VKAHK1LYK",
"link": "/gp/help/seller/at-a-glance.html/ref=dp_merchant_link?ie=UTF8&seller=A2OL0VKAHK1LYK&isAmazonFulfilled=1",
"is_amazon_fulfilled": true,
"shipped_from": "Amazon"
},
...name
主要卖家的名称。
字符串
seller_id
卖家的 ID。
字符串
link
Amazon 卖家页面的 URL。
字符串
is_amazon_fulfilled
指示产品是否由 Amazon 自有物流网络履行
boolean
shipped_from (可选)
指示发货地点。
字符串
Sales Rank
此字段提供有关产品在 Amazon 特定类别中的销售排名信息。每个对象表示一个销售排名条目,包括排名本身和类别层级,展示通往该排名类别的类别层级结构。
...
"sales_rank": [
{
"rank": 1366,
"ladder": [
{
"url": "/gp/bestsellers/office-products/ref=pd_zg_ts_office-products",
"name": "Office Products "
}
]
},
{
"rank": 18,
"ladder": [
{
"url": "/gp/bestsellers/office-products/490755011/ref=pd_zg_hrsr_office-products",
"name": "Hardcover Executive Notebooks"
}
]
}
],
...rank
指示排名位置。
整数
ladder
包含有关产品被排名的类别的更详细信息的列表。
数组
ladder.url
相关畅销榜类别页面的 URL。
字符串
ladder.name
指示产品被排名的类别。
字符串
Delivery
此字段提供有关产品配送选项的信息,例如最快的配送方式和估计到达日期。
...
"delivery": [
{
"type": "Fastest delivery",
"date": {
"from": null,
"by": "Thursday, Jan 28"
}
}
],
...type
指示配送类型。
字符串
日期
包含有关配送日期的信息列表。
对象
date.from
发货地点。
字符串
date.by
预计送达日期。
字符串
Buy Box
Amazon 产品页面上的“Buy Box”部分,客户可以在此直接购买商品。该字段为买家提供重要信息,包括产品价格、库存可用性、配送选项和预计到达日期。
...
"buybox": [
{
"price": 199.99,
"stock": "Only 1 left in stock - order soon.",
"delivery_type": "Delivery",
"delivery_details": [
{
"date": {
"by": "Thursday, June 6",
"from": null
},
"type": "FREE delivery"
},
{
"date": {
"by": "Tuesday, June 4",
"from": null
},
"type": "Or fastest delivery"
}
]
},
...name
定价选项的名称。
字符串
可选
stock
产品的库存水平。
字符串
可选
delivery_type
指示配送类型。
字符串
可选
delivery_details
关于产品配送的详细信息列表。
数组
可选
日期
关于配送日期的详细信息列表。
对象
可选
delivery_details.by
预计送达日期。
字符串
可选
delivery_details.from
商品的发货地点。
字符串
可选
delivery_details.type
配送类型
字符串
可选
condition
商品的状态或成色。
字符串
可选
价格
产品的价格。
float
Lightning Deal
此字段提供有关 Amazon 限时闪购的信息,提供限时折扣价。闪购是对特定产品在有限数量内进行的限时促销,通常持续数小时。客户必须快速行动,因为一旦分配的时间或库存耗尽,优惠即失效。详情包括已认领百分比、折后价和剩余时间。
...
"lightning_deal": {
"percent_claimed": "0%",
"price_text": "10,999.00 (Save 52%)",
"expires": "Ends in 06h 30m 56s"
},
...percent_claimed
与默认价格相比的折扣量。
字符串
price_text
折后产品价格。
字符串
expires
指示闪购优惠的结束时间。
字符串
Product Overview
本节提供产品各个关键属性的结构化摘要。

...
"product_overview": [
{
"title": "Material",
"description": "Rubber"
},
{
"title": "Vehicle Service Type",
"description": "Passenger Car"
},
{
"title": "Auto Part Position",
"description": "Unknown"
},
{
"title": "Fit Type",
"description": "Universal Fit"
}
],
...product_overview
包含产品关键属性及其描述的列表。
数组
title
产品属性的标题。
字符串
description
产品属性的详细描述。
字符串
最后更新于
这有帮助吗?

