Product Advertising API は、画像を次の2通りの方法で返します。
<Item> の下の <SmallImage> , <MediumImage> および <LargeImage> 要素
画像サイズが _SLXXX_ という修飾子で指定されている場合は、<ImageSets> の下。ここで、XXX は、画像の長辺のピクセル数です。例えば、中サイズの画像の長辺は160ピクセルになっています。
次のレスポンス例は、画像を返す1番目の方法です。
<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>各画像は商品 ID (上の例では ASIN) に関連付けられています。 画像の詳細は次の通りです。
画像のサイズ。要素 <SmallImage> , <MediumImage> および <LargeImage> で指定されます。
Amazon の画像サーバ上の画像 URL
画像の高さと幅。単位はピクセルで、画像の表示に使用します。
標準的な解像度は、24ビットカラー、96ピクセル/インチです。
次のレスポンス例は、画像を返す2番目の方法です。
<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><ImageSets> の下の画像のサイズは、URL の _SLXXX_ サフィックスで指定されます。ここで、XXX は画像の長辺のピクセル数です。例えば、中サイズの画像は長辺が160ピクセルであるため、サフィックスは _SL160_ になります。これは、画像を参照する際の推奨方法です。
ImageSets 要素の Category 属性には、Primary を設定します。Primary画像は、<Item> セクションに現れる画像と同じものです。