Home>

I want to know how to get products in the ranking with the new amazon sdk (api) called PA-API v5.0 (Amazon API).

I want to get salesrank (sales ranking), but I don't know the detailed method because of the new api.

The language is PHP.

We aim to get rankings with reference to the following website.

https://webservices.amazon.com/paapi5/documentation /getbrowsenodes.html

http://piyopiyocs.blog115.fc2.com /blog-entry-290.html

The code is as follows.

// $keyword = 'Backworld';
$searchIndex = "Books";
$browseNodeId = "507300";
$itemCount = 1;
$resources = array (
    SearchItemsResource :: ITEM_INFOTITLE,
    SearchItemsResource :: OFFERSLISTINGSPRICE);
$searchItemsRequest = new SearchItemsRequest ();
$searchItemsRequest->setSearchIndex ($searchIndex);
// $searchItemsRequest->setKeywords ($keyword);
$searchItemsRequest->setItemCount ($itemCount);
$searchItemsRequest->setBrowseNodeId ($browseNodeId);
$searchItemsRequest->setPartnerTag ($partnerTag);
$searchItemsRequest->setPartnerType (PartnerType :: ASSOCIATES);
$searchItemsRequest->setResources ($resources);


(In this state, the keyword is not selected and an error occurs.)

Question 1: How to get sales ranking of browseNodeId = 507300 (genre) in Books (category)

If i know anyone, please teach us.

  • Answer # 1

    If you want to include ranking in the result data, you can add it to $resources
    If you are using the official SDK, you can specify all the data that can be acquired with this.

    $resources = SearchItemsResource :: getAllowableEnumValues ​​();

    Get the ranking order
    In v5,TopSellers: Check back later for updates!

    https://webservices.amazon.com/paapi5/documentation/migration-guide/pa-api-40-to-50-mapping.html