Tuesday, 28 March 2017

Amazon Product Advertising API Integration Advance - Item | Product Search by Keywords with Script Code




Amazon Product Advertising API Integration Advance - Item/Product Search by Keywords



Hopefully you are ready with all prerequisite for integrating Amazon Product Advertising API as per our Amazon Product Advertising API integration Basics
We are now going to demonstrate how you can implement functionality to get/fetch the items/Products from Amazon Product Base as per your specified search keywords and specific category. You can provide “All” if you want to search the product within all the available item base.

/*
* This function will give you first 10 top seller items on the basis of keyword provided
*/

/*
 * To handle item search
 */

$amazonEcs = new AmazonECS(AWS_API_KEY, AWS_API_SECRET_KEY, COUNTRY_CODE, AWS_ASSOCIATE_TAG);

$amazonEcs->associateTag(AWS_ASSOCIATE_TAG);


function getSearchResults($key) {

    global $amazonEcs;

    try {
        $response = $amazonEcs->category('All')->responseGroup('Medium,OfferSummary,VariationSummary')->search($key);

// You can change the parameters ( “Medium,OfferSummary,VariationSummary” ) according to your need

    } catch (Exception $e) {

        $response = $e->getMessage() ;

    }

    return $response;
}


When you get the valid response from here you can easily parse the object as in case of product item feed. You can check the same at Amazon Product Advertising API Integration Advance - Fetch Top Seller Item Feed


Note: Amazon Product Advertising API has threshold limit over request so avoid quick requests. You may add some delay at your side to make request after some delay.




Thanks for your valuable comments and suggestion.

 


No comments:

Post a Comment

YouTube TV | Know All About Features, Subscription & Access

YouTube TV is Live | Know All About YouTube TV YouTube TV is finally live and available to Big US cities only. Now you ...