Amazon development team has developed a world class product advertising API in php. Millions of customers are using every day this robust, scalable, and reliable technology for product advertising in his blog.
All Product Advertising API is open source (free). Join today to get access of Product Advertising API as developer. Many bloggers and web store owners are already using this realizing financial gains.
Required Knowledge and Skills
For implementing this API you required to fimiliar with XML syntax and struture and also basic knowledge of web servers ( REST/SOAP ). In addition, you must have familiar with PHP programming language. Go to the following links:
W3 Schools XML Tutorial
W3 Schools Web Services Tutorial
PHP Tutorial
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
<?php //Enter your IDs define("Access_Key_ID", "[Your Access Key ID]"); define("Associate_tag", "[Your Associate Tag ID]"); //Set up the operation in the request function ItemSearch($SearchIndex, $Keywords){ //Set the values for some of the parameters $Operation = "ItemSearch"; $Version = "2013-08-01"; $ResponseGroup = "ItemAttributes,Offers"; //User interface provides values //for $SearchIndex and $Keywords //Define the request $request= "http://webservices.amazon.com/onca/xml" . "?Service=AWSECommerceService" . "&AssociateTag=" . Associate_tag . "&AWSAccessKeyId=" . Access_Key_ID . "&Operation=" . $Operation . "&Version=" . $Version . "&SearchIndex=" . $SearchIndex . "&Keywords=" . $Keywords . "&Signature=" . [Request Signature] . "&ResponseGroup=" . $ResponseGroup; //Catch the response in the $response object $response = file_get_contents($request); $parsed_xml = simplexml_load_string($response); printSearchResults($parsed_xml, $SearchIndex); } ?> |
Above PHP code implement an product search request in which customer can enter their keywords. Copy above php code and save in a file “simpleStore.php”.
Create a file named amazonAffiliate.php and copy paste below code. In below code you will find a simple form for enter your search keywords.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
<table align='left'> <?php print(" <form name='SearchTerms' action=SimpleStore.php method='GET'> <tr><td valign='top'> <b>Choose a Category</b><br> <select name='SearchIndex'> <option value='Books'>Books</option> <option value='DVD'>DVD</option> <option value='Music'>Music</option> </select> </td></tr> <tr><td><b>Enter Keywords</b><br><input type='text' name='Keywords' size='40'/></td></tr> <input type='hidden' name='Action' value='Search'> <input type='hidden' name='CartId' value=$CartId> <input type='hidden' name='HMAC' value=$HMAC> <tr align='center'><td><input type='submit'/></td></tr> </form> "); ?> </table> |
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.
Article Tags: Amazon affiliates program, amazon associate, download amazon php API, download amazon product advertising