Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get alternative versions of book listings in Amazon PAAPI5 (get hardcover, paperpack, mass market versions of book listing)?

Version 4 of the Amazon product advertising api let you use the AlternateVersions response group to get related products, which for books let you get all the different formats of a book listing (hardcover, paperback, mass market, etc.)

Version 5 of the API does not have AlternateVersions for some reason. Is there any way to get the different versions of a book in PAAPI5?

like image 759
r04jj Avatar asked Dec 30 '25 03:12

r04jj


1 Answers

I'm having the same issue. In my case I need just hardcover and kindle version of a book.

GetVariations (successor of AlternateVersions) is for some reason not working for books and just returns no result back.

The only possible way that I'm aware of is to do two API request (SearchItems) including the specific search index Books for books and KindleStore for kindle files. Not specifying the search index normally returns you just the hardcopy of the Books search index.

To differentiate between books and kindle version check the ItemInfo.Classifications.ProductGroup.DisplayValue or ItemInfo.Classifications.Binding.DisplayValue

For some unknown reason (at least to me) the API is returning only a subset of results when not specifying the search index (in the below example the kindle one)

Example

In the following example I looking for the hardcopy or kindle of the book with ISBN 9780262043649 by doing a SearchItem request.

a) Hardcopy with given search index

Payload

{
 "Keywords": "9780262043649",
 "Resources": [
  "ItemInfo.Classifications",
  "ItemInfo.Title"
 ],
 "SearchIndex": "Books",
 "PartnerTag": "*******",
 "PartnerType": "Associates",
 "Marketplace": "www.amazon.com",
 "Operation": "SearchItems"
}

Response

{
 "SearchResult": {
  "Items": [
   {
    "ASIN": "0262043645",
    "DetailPageURL": "https://www.amazon.com/dp/0262043645?tag=getabstractcom&linkCode=osi&th=1&psc=1",
    "ItemInfo": {
     "Classifications": {
      "Binding": {
       "DisplayValue": "Hardcover",
       "Label": "Binding",
       "Locale": "en_US"
      },
      "ProductGroup": {
       "DisplayValue": "Book",
       "Label": "ProductGroup",
       "Locale": "en_US"
      }
     },
     "Title": {
      "DisplayValue": "Novacene: The Coming Age of Hyperintelligence (The MIT Press)",
      "Label": "Title",
      "Locale": "en_US"
     }
    }
   }
  ],
  "SearchURL": "https://www.amazon.com/s?k=9780262043649&i=stripbooks&rh=p_n_availability%3A-1&tag=getabstractcom&linkCode=osi",
  "TotalResultCount": 1
 }
}

b) Kindle with given search index

Payload

{
 "Keywords": "9780262043649",
 "Resources": [
  "ItemInfo.Classifications",
  "ItemInfo.Title"
 ],
 "SearchIndex": "KindleStore",
 "PartnerTag": "******",
 "PartnerType": "Associates",
 "Marketplace": "www.amazon.com",
 "Operation": "SearchItems"
}

Response

{
 "SearchResult": {
  "Items": [
   {
    "ASIN": "B08BT4MM18",
    "DetailPageURL": "https://www.amazon.com/dp/B08BT4MM18?tag=getabstractcom&linkCode=osi&th=1&psc=1",
    "ItemInfo": {
     "Classifications": {
      "Binding": {
       "DisplayValue": "Kindle Edition",
       "Label": "Binding",
       "Locale": "en_US"
      },
      "ProductGroup": {
       "DisplayValue": "Digital Ebook Purchas",
       "Label": "ProductGroup",
       "Locale": "en_US"
      }
     },
     "Title": {
      "DisplayValue": "Novacene: The Coming Age of Hyperintelligence",
      "Label": "Title",
      "Locale": "en_US"
     }
    }
   }
  ],
  "SearchURL": "https://www.amazon.com/s?k=9780262043649&i=digital-text&rh=p_n_availability%3A-1&tag=getabstractcom&linkCode=osi",
  "TotalResultCount": 1
 }
}

c) No specific search index

Payload

{
 "Keywords": "9780262043649",
 "Resources": [
  "ItemInfo.Classifications",
  "ItemInfo.Title"
 ],
 "PartnerTag": "*******",
 "PartnerType": "Associates",
 "Marketplace": "www.amazon.com",
 "Operation": "SearchItems"
}

Response

{
 "SearchResult": {
  "Items": [
   {
    "ASIN": "B08BT4MM18",
    "DetailPageURL": "https://www.amazon.com/dp/B08BT4MM18?tag=getabstractcom&linkCode=osi&th=1&psc=1",
    "ItemInfo": {
     "Classifications": {
      "Binding": {
       "DisplayValue": "Kindle Edition",
       "Label": "Binding",
       "Locale": "en_US"
      },
      "ProductGroup": {
       "DisplayValue": "Digital Ebook Purchas",
       "Label": "ProductGroup",
       "Locale": "en_US"
      }
     },
     "Title": {
      "DisplayValue": "Novacene: The Coming Age of Hyperintelligence",
      "Label": "Title",
      "Locale": "en_US"
     }
    }
   }
  ],
  "SearchURL": "https://www.amazon.com/s?k=9780262043649&rh=p_n_availability%3A-1&tag=getabstractcom&linkCode=osi",
  "TotalResultCount": 1
 }
}

You can try those examples in the API's scratchpad.

More information about the search index of the product advertising API is available on the official documentation here

like image 166
wprogLK Avatar answered Jan 05 '26 01:01

wprogLK



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!