我有一个例子,当productsearch
亚马逊目录中的返回预期的产品,但listCatalogItems
它没有。我不确定第一个是否可以在 API 中访问,但我认为应该有一个类似的替代方案。
https://sellercentral-europe.amazon.com/product-search/search?q=461439-001
这将调用https://sellercentral-europe.amazon.com/productsearch/search?query=461439-001&page=1
URL:
{
"numberOfPages": 1,
"numberOfResults": 3,
"indexSummaries": [...],
"products": [{
"asin": "B07HGQV1MS",
"detailPageURL": "http://www.amazon.co.uk/dp/B07HGQV1MS",
"imageUrl": "https://m.media-amazon.com/images/I/51NbiwOo98L._SS160_.jpg",
"title": "HP Z600 Dual LGA1366 System Board 461439-001 460840-002 (Certified Refurbished)",
...
}, ...],
"debugInfo": []
}
现在,当使用 Node.js 使用 SP API 搜索相同的东西时,我们会得到完全不同的东西:
const getASINFromPartNumber = async partNumber => {
const res = await sellingPartner.callAPI({
operation: "listCatalogItems",
endpoint: "catalogItems",
query: {
MarketplaceId: ['A1F83G8C2ARO7P'],
Query: partNumber
}
})
const asin = findValue(res, "Items.0.Identifiers.MarketplaceASIN.ASIN")
return asin
}
const asin = await getASINFromPartNumber("461439-001")
这是回应:
> console.log(res.Items[0])
< { Identifiers:
< { MarketplaceASIN: { MarketplaceId: 'A1F83G8C2ARO7P', ASIN: 'B079184W1J' } },
< AttributeSets:
< [ { Binding: 'Electronics',
< Brand: 'RGBS',
< Label: 'RGBS',
< Manufacturer: 'RGBS',
< PackageDimensions: [Object],
< PartNumber: '651687-001',
< ProductGroup: 'CE',
< ProductTypeName: 'ACCESSORY_OR_PART_OR_SUPPLY',
< Publisher: 'RGBS',
< SmallImage: [Object],
< Studio: 'RGBS',
< Title:
< 'RGBS 2.5" SFF SAS SATA HDD Tray Caddy for HP Proliant 651687-001 651699-001 G8 Gen8 Gen9 G9 ML350p ML350 DL360e DL360p DL320e DL380e DL380P DL160 SL270s 230 series with 4 mounting screws' } ],
< Relationships: [],
< SalesRankings:
< [ { ProductCategoryId: 'pc_display_on_website', Rank: 34592 },
< { ProductCategoryId: '430435031', Rank: 213 } ] }
为什么我们在相同的输入下得到完全不同的结果?换句话说,通过将部件号作为输入来获取 ASIN 的最佳方法是什么?