How to use the productsearch API from Amazon in the SP API?

Viewed 158

I have an example when the productsearch in the Amazon Catalogue returns the expected product, but in the listCatalogItems it doesn't. I am not sure if the first is accessible in the API, but there should be a similar alternative I think.

https://sellercentral-europe.amazon.com/product-search/search?q=461439-001

This calls the 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": []
}


Now, when searching the same thing using the SP API using Node.js, we get something totally different:

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")

And this is the response:

> 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 } ] }

Why do we get totally different results for the same input? In other words, what is the best way to get the ASIN by having the part number as input?

0 Answers
Related