How to get book cover picture through amazon API [

2019-03-13 11:40发布

This question already has an answer here:

I want to get the cover of a book form its ASIN through Amazon API. I use the ItemLookup function, but I only get the author, manufacturer and the title.

ie :

<ItemAttributes>
<Author>Anna Gavalda</Author>
<Manufacturer>J'Ai Lu</Manufacturer>
<ProductGroup>Book</ProductGroup>
<Title>Ensemble, C'Est Tout (French Edition)</Title>
</ItemAttributes>

2条回答
在下西门庆
2楼-- · 2019-03-13 12:23

You can try this:

$track=$_GET['title'];

// Call To Amazon Predefined Class
$client = new AmazonECS(AWS_API_KEY, AWS_API_SECRET_KEY, 'com', AWS_ASSOCIATE_TAG);
$response = $client->category('Books')->responseGroup('Images,Reviews,ItemAttributes,OfferSummary')->search($track);

// To Get Image
<img src="<?php echo $response->Items->Item[0]->LargeImage->URL ?>" width="233" height="300">
查看更多
登录 后发表回答