简体   繁体   English

如何从亚马逊的产品广告 API 中获取图片和描述?

[英]How can I get images and description from Amazon's Product Advertising API?

I am using the Amazon Product Advertising API (formerly ECS) in PHP to get product information using an ASIN code.我正在使用 PHP 中的亚马逊产品广告 API(以前称为 ECS)来使用 ASIN 代码获取产品信息。 I can get the information but images and product descriptions are missing.我可以获得信息,但缺少图像和产品描述。 I've looked around the API class and couldn't find anything helpful.我查看了 API class 并找不到任何有用的东西。 The code I am using to get the product details is:我用来获取产品详细信息的代码是:

$client = new AmazonECS(get_option('awskey'), get_option('awssecret'), 'UK'); 
$response = $client->lookup('0596157134'); 
var_dump($response); // Debugging

Is it possible with the API or is there another way to get the product description and image?是否可以使用 API 或者是否有其他方法可以获取产品描述和图像?

The item lookup call you are making only returns basic information about the product.您进行的项目查找调用仅返回有关产品的基本信息。 You will need to use the ResponseGroup parameter to specify what information you want Amazon to return (see Amazon's ItemLookup Documentation for more information).您将需要使用 ResponseGroup 参数来指定您希望 Amazon 返回的信息(有关更多信息,请参阅Amazon 的 ItemLookup 文档)。 If you want to get the images and product description, you can request the "Medium" response group.如果您想获取图片和产品描述,您可以请求“中”响应组。 Try the following call:尝试以下调用:

$response = $client->responseGroup('Medium')->lookup('0596157134'); 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM