How to get book cover picture through amazon API [

2019-03-13 12:33发布

问题:

This question already has an answer here:

  • How do I get a book graphic and description from the Amazon Book API? 3 answers

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>

回答1:

See How do I get a book graphic and description from the Amazon Book API?

Also, interesting article about using Amazon images here: http://bibwild.wordpress.com/2008/03/19/think-you-can-use-amazon-api-for-library-service-book-covers/



回答2:

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">