Hi I was wondering if it is possible to make a script that can get the url of an amzon product image of a product page such as http://www.amazon.com/Nokia-N73-Sil...sr_1?ie=UTF8&s=wireless&qid=1195844283&sr=8-1 it would get the image address of the product. Please tell me how to do this Thanks
I do something like this to get the cover images of DVDs from Amazon. You do need a Subscriber ID (and an Associate ID if you want to link back to them and make money), see here for more info. I am grabbing the item info from a UPC with the following code. You will get some XML that you will need to parse for the SmallImage, MediumImage or LargeImage tags that contain the image url: <? $amazonAssociateId = 'my-assocate-id-get-your-own'; $amazonSubscriberId = 'my-subscriber-id'; $amazonWebSrvHost = 'webservices.amazon.com'; $amazonWebSrvPath = '/onca/xml'; $lookupUPC = '097363314479'; $amazonXML=getAmazonMovieInfo($amazonSubscriberId, $amazonAssociateId,$amazonWebSrvHost,$amazonWebSrvPath,$lookupUPC); print $amazonXML; function getAmazonMovieInfo($amazonSubscriberId,$amazonAssociateId,$amazonWebSrvHost,$amazonWebSrvPath,$upc) { $query_string="Service=AWSECommerceService" . "&SubscriptionId=" . $amazonSubscriberId . "&AssociateTag=" . $amazonAssociateId . "&Operation=ItemLookup" . "&SearchIndex=DVD" . "&MerchantId=All&IdType=UPC" . "&ItemId=" . $upc . "&Condition=All" . "&ResponseGroup=Request,Images,Small,ItemAttributes"; $fetchedXML = getURL($amazonWebSrvHost,$amazonWebSrvPath,$query_string); return $fetchedXML; } function getURL($host,$path,$query_string) { $toReturn=''; $toOpen = "http://" . $host . $path . "?" . $query_string; $fh = fopen($toOpen, "r"); if ($fh) { while (!feof($fh)) { $toReturn .= fgets($fh, 512); } fclose($fh); } else { print "Error fetching data from Amazon.com"; } return $toReturn; } ?> PHP: This example grabs the movie info xml from amazon based on the UPC of one of favorite movies "Virtuosity" and prints it out. From there you can just use the xml info you need, like the "SmallImage" for the cover art. There is really a ton of stuff you can do with the amazon api, the above was a stripped down version of what i actually use on a dvd site. Hope this helps!