I am working on an application that returns products from Amazon:
client.itemSearch({
condition: 'New',
keywords: decodeURI(req.query.q),
merchantId: 'Amazon',
itemPage: page,
responseGroup: 'ItemAttributes,Offers,Images' + ',ShippingCharges'
}, (err, results, response) => {
// work on results / response
})
... returns the following answers:

The problem is that the API is right when the page is set to 2, 3, etc. The values are as follows:
- On page 1: 65 total, 7 pages
- On page 2: 56 total, 6 pages
- On page 3: 45 total, 5 pages
- On page 4: 38 total, 4 pages
- On page 5: ERROR (whole answer undefined)
It looks like this API is just broken.
I need to know how many pages to display pagination on an external interface. How to do it?
source
share