Images Response Group
In addition to returning the URLs of the images, the response groups also returns the height and width dimensions of each image. Use these values to help you display the images correctly.
The images returned are associated with the merchant selling the item. For that reason, you must specify the merchant ID in the request when you use the Images response group. MerchantId, however, defaults to "Amazon." So, if the item is being sold by Amazon, specifying a MerchantId is not required. If you do not specify a MerchantId and a merchant other than Amazon is selling the item, Product Advertising API will not return images.
Relevant Operations
Operations that can use this response group include:
Response Elements
The following table describes the elements returned by the Images response group.
Images also returns the elements that all response groups return, which is described in Elements Common to All Response Groups.
Parent Response Group
The following response groups are parent response groups of the Images response group.
-
None
Child Response Group
The following response groups are child response groups of the Images response group.
-
None
Sample REST Use Case
All locales.
http://ecs.amazonaws.com/onca/xml?
Service=AWSECommerceService&
AWSAccessKeyId=[AWS Access Key ID]
&
Operation=ItemSearch&
ItemId=B000Q678OO&
ResponseGroup=Images&
SearchIndex=Blended&
Version=2008-08-19
Sample Response Snippet
The following response snippet shows the elements returned by the Images response group.
<Item> <ASIN>B000Q678OO</ASIN> <SmallImage> <URL>http://ecx.images-amazon.com/images/I/51YL4rlI%2B9L._SL75_.jpg</URL> <Height Units="pixels">75</Height> <Width Units="pixels">58</Width> </SmallImage> <MediumImage> <URL>http://ecx.images-amazon.com/images/I/51YL4rlI%2B9L._SL160_.jpg</URL> <Height Units="pixels">160</Height> <Width Units="pixels">124</Width> </MediumImage> <LargeImage> <URL>http://ecx.images-amazon.com/images/I/51YL4rlI%2B9L.jpg</URL> <Height Units="pixels">500</Height> <Width Units="pixels">389</Width> </LargeImage> <ImageSets> <ImageSet Category="primary"> <SwatchImage> <URL>http://ecx.images-amazon.com/images/I/51YL4rlI%2B9L._SL30_.jpg</URL> <Height Units="pixels">30</Height> <Width Units="pixels">23</Width> </SwatchImage> <SmallImage> <URL>http://ecx.images-amazon.com/images/I/51YL4rlI%2B9L._SL75_.jpg</URL> <Height Units="pixels">75</Height> <Width Units="pixels">58</Width> </SmallImage> <ThumbnailImage> <URL>http://ecx.images-amazon.com/images/I/51YL4rlI%2B9L._SL75_.jpg</URL> <Height Units="pixels">75</Height> <Width Units="pixels">58</Width> </ThumbnailImage> <TinyImage> <URL>http://ecx.images-amazon.com/images/I/51YL4rlI%2B9L._SL110_.jpg</URL> <Height Units="pixels">110</Height> <Width Units="pixels">86</Width> </TinyImage> <MediumImage> <URL>http://ecx.images-amazon.com/images/I/51YL4rlI%2B9L._SL160_.jpg</URL> <Height Units="pixels">160</Height> <Width Units="pixels">124</Width> </MediumImage> <LargeImage> <URL>http://ecx.images-amazon.com/images/I/51YL4rlI%2B9L.jpg</URL> <Height Units="pixels">500</Height> <Width Units="pixels">389</Width> </LargeImage> </ImageSet> </ImageSets>
The images are returned in two ways: under <Item> and under <ImageSets>. The images under under <Item> are specified by the <SmallImage> , <MediumImage> , and <LargeImage> elements.
The sizes of the images under <ImageSets> are specified by the _SLXXX_ suffix in the URL, where XXX is the number of pixels on the longest side of the image. A medium size image, for example, has 160 pixels on its longest side so it has the suffix _SL160_. This is the preferred way to reference images.
The ImageSets element attribute, Category, is set to Primary. Primary images are the same images that appear in the <Item> section.