Not having the time to pour though 500 pages of documentation - I have a few simple calls I need to make from the Amazon API - can somebody famalir give me the shortcuts Call 1 - send product URL and get back thumb. Call 2 - send product URL and get back loaded with my affiliate code seems simple enough - does somebody know these calls off the top of their heads. I will even pay a few bucks via paypal if somebody really wants and can help fast.
You cannot send a URL via an API call and get anything back. You have to know the ASIN of the product and then use ItemLookup to get those details that you want.
What your looking for can be found here: http://docs.amazonwebservices.com/AWSEcommerceService/2005-02-23/ , it's not 500 pages, and then you'll actually know exactly what you are doing. For what you are trying to do, you only need to make one call to the webservice, but you should probably first let people know if you are working in soap or rest, what programming language you are using, etc. , this way, you can receive the best answer to your situation. You'll need the asin number like Markowe said, and you'll also need your developer key, a way to parse the xml response. Hope this post was helpful. thanks, PuReWebDev
Very helpful thank you - A quick background of what we are doing We are going to allow a user to input a URL from Amazon. We want to take this URL and come back with a thumbnail and the link loaded with our affiliate code. using a LAMP backend. soap or rest undecided. So back to the question - what is the best way to parse out the ASIN - a quick review shows me the ASIN is usually the 3rd field after amazon.com ie.. www.amazon.com/something/something/ASIN/ can someone confirm? or is there a better way to grab. then the next question would be how to handle and parse out internationals.
Hmm, tricky. Are you SURE there's no simpler way than having the user paste in a url? It's not the usual way the API is used - usually the customer has browsed to the product in question through your API interface so you already have the ASIN stored by that point. Well, you would extract the ASIN with a regular expression match, like so: <?php $string = 'http://www.amazon.com/gp/product/B00023RSUA/ref=s9subs_c4_at1-rfc_g1-2991_g1?pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-2&pf_rd_r=04YX03QMDB6AT9N5GHJN&pf_rd_t=101&pf_rd_p=278240301&pf_rd_i=507846'; $ASIN = preg_match('/(B[0-9 A-Z]{9})/', $string, $ASINS); echo $ASINS[0]; // assumes there was only one ASIN in the string, shouldn't be more ?> PHP: I just picked a product page at random, I really couldn't guarantee that this would be 100% accurate in extracting the ASIN - it assumes the ASIN is a 'B' followed by 9 digits. Then you would get your ASIN and construct an ItemLookup call (assuming REST): http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=YOURDEVELOPERKEY&Operation=ItemLookup&AssociateTag=YOURAFFILIATECODE Code (markup): You would have to parse the XML returned to extract the DetailPageURL (ready loaded with your affiliate code), the Medium/Small/LargeImageURL or whatever other data you wanted. That is definitely outside the scope of this forum, and anyway, I got AWS problems of my own! Good luck! P.S. I am not an expert in this stuff, but it works for me.