用 Products.get_competitive_pricing_for_asins 取不到目标ASIN的商品信息!?| Amazon Selling Partner API
- 7月19日
- 讀畢需時 3 分鐘

我在日本站点(Marketplace ID:A1VC38T7YXB528)使用API获取竞争价格信息,却遇到了若干ASIN的信息无法按预期获取的现象。
执行环境:AWS Lambda
Runtime:python3.9
正在执行的代码如下
from sp_api.api import Products
from sp_api.base.marketplaces import Marketplaces
def lambda_handler(event, context):
ASIN_LIST = ['B099RSQ9JR', 'B09SYMGWNM', 'B08ZHSWRJN', 'B0921SBWSY', 'B07QGSRCZD']
obj = Products(marketplace=Marketplaces.JP, credentials=event['credentials'])
result = obj.get_competitive_pricing_for_asins(ASIN_LIST)
return result.payload
用目标ASIN ['B099RSQ9JR', 'B09SYMGWNM', 'B08ZHSWRJN', 'B0921SBWSY', 'B07QGSRCZD'] 执行时,5个ASIN中只得到2个结果。
执行结果
[
{
"ASIN": "B099RSQ9JR",
"Product": {
"CompetitivePricing": {
"CompetitivePrices": [
{
"belongsToRequester": false,
"condition": "New",
"subcondition": "New",
"Price": {
"LandedPrice": {
"CurrencyCode": "JPY",
"Amount": 12000
},
"ListingPrice": {
"CurrencyCode": "JPY",
"Amount": 12000
},
"Shipping": {
"CurrencyCode": "JPY",
"Amount": 0
}
},
"CompetitivePriceId": "1"
}
],
"NumberOfOfferListings": [
{
"condition": "New",
"Count": 4
},
{
"condition": "Any",
"Count": 4
}
]
},
"Identifiers": {
"MarketplaceASIN": {
"MarketplaceId": "A1VC38T7YXB528",
"ASIN": "B099RSQ9JR"
}
},
"SalesRankings": [
{
"ProductCategoryId": "fashion_display_on_website",
"Rank": 34189
},
{
"ProductCategoryId": "2221186051",
"Rank": 146
}
]
},
"status": "Success"
},
{
"ASIN": "B09SYMGWNM",
"Product": {
"CompetitivePricing": {
"CompetitivePrices": [],
"NumberOfOfferListings": []
},
"Identifiers": {
"MarketplaceASIN": {
"MarketplaceId": "A1VC38T7YXB528",
"ASIN": "B09SYMGWNM"
}
},
"SalesRankings": []
},
"status": "Success"
},
{
"ASIN": "B08ZHSWRJN",
"Product": {
"CompetitivePricing": {
"CompetitivePrices": [],
"NumberOfOfferListings": []
},
"Identifiers": {
"MarketplaceASIN": {
"MarketplaceId": "A1VC38T7YXB528",
"ASIN": "B08ZHSWRJN"
}
},
"SalesRankings": []
},
"status": "Success"
},
{
"ASIN": "B0921SBWSY",
"Product": {
"CompetitivePricing": {
"CompetitivePrices": [],
"NumberOfOfferListings": []
},
"Identifiers": {
"MarketplaceASIN": {
"MarketplaceId": "A1VC38T7YXB528",
"ASIN": "B0921SBWSY"
}
},
"SalesRankings": []
},
"status": "Success"
},
{
"ASIN": "B07QGSRCZD",
"Product": {
"CompetitivePricing": {
"CompetitivePrices": [
{
"belongsToRequester": false,
"condition": "New",
"subcondition": "New",
"Price": {
"LandedPrice": {
"CurrencyCode": "JPY",
"Amount": 16000
},
"ListingPrice": {
"CurrencyCode": "JPY",
"Amount": 16000
},
"Shipping": {
"CurrencyCode": "JPY",
"Amount": 0
}
},
"CompetitivePriceId": "1"
}
],
"NumberOfOfferListings": [
{
"condition": "New",
"Count": 2
},
{
"condition": "Any",
"Count": 2
}
]
},
"Identifiers": {
"MarketplaceASIN": {
"MarketplaceId": "A1VC38T7YXB528",
"ASIN": "B07QGSRCZD"
}
},
"SalesRankings": [
{
"ProductCategoryId": "fashion_display_on_website",
"Rank": 239300
},
{
"ProductCategoryId": "2221209051",
"Rank": 1920
}
]
},
"status": "Success"
}
]
指定目标ASIN ['B099RSQ9JR'] 时,能够得到结果。
执行结果
[
{
"ASIN": "B099RSQ9JR",
"Product": {
"CompetitivePricing": {
"CompetitivePrices": [
{
"belongsToRequester": false,
"condition": "New",
"subcondition": "New",
"Price": {
"LandedPrice": {
"CurrencyCode": "JPY",
"Amount": 12000
},
"ListingPrice": {
"CurrencyCode": "JPY",
"Amount": 12000
},
"Shipping": {
"CurrencyCode": "JPY",
"Amount": 0
}
},
"CompetitivePriceId": "1"
}
],
"NumberOfOfferListings": [
{
"condition": "New",
"Count": 4
},
{
"condition": "Any",
"Count": 4
}
]
},
"Identifiers": {
"MarketplaceASIN": {
"MarketplaceId": "A1VC38T7YXB528",
"ASIN": "B099RSQ9JR"
}
},
"SalesRankings": [
{
"ProductCategoryId": "fashion_display_on_website",
"Rank": 34189
},
{
"ProductCategoryId": "2221186051",
"Rank": 146
}
]
},
"status": "Success"
}
]
指定目标ASIN ['B09SYMGWNM'] 时,得不到结果。
执行结果
[
{
"ASIN": "B09SYMGWNM",
"Product": {
"CompetitivePricing": {
"CompetitivePrices": [],
"NumberOfOfferListings": []
},
"Identifiers": {
"MarketplaceASIN": {
"MarketplaceId": "A1VC38T7YXB528",
"ASIN": "B09SYMGWNM"
}
},
"SalesRankings": []
},
"status": "Success"
}
]
已确认未返回结果的ASIN是有效的,且在www.amazon.co.jp上确实存在。除本次举例的ASIN外,同样的现象也在发生。
至于认证所用的凭据,鉴于有时能够返回结果,已确认其正确且具备所需权限。
查阅了文档并尝试了排查步骤,但问题未能解决。
我向Amazon Selling Partner开发者支持以及 https://developer.amazon.com/ 的论坛咨询了该问题。
从支持得到的答复是,
对于可选择颜色的商品,需要指定点击颜色时的ASIN来进行调用。
也就是说,对于存在颜色或尺寸等变体的商品,必须指定选择到具体变体的ASIN信息。
唉,得到答案后发现并不算什么大事,却着实卡了不少时间。



留言