Quantcast
Channel: Opinion: Shopify Community - Shopify APIs & SDKs
Viewing all articles
Browse latest Browse all 25503

Use JSON API to Retrieve Alternate Product Image Sizes? Medium Product Image Size? Thumbnail? by Zach Doe

$
0
0

In the Liquid template system, you can output specific product image sizes.
For example, the following outputs the medium image url:

{{ product.images[0] | product_img_url: 'medium' }}

When using the JSON API to retrieve products, the image and images properties seem to contain only one image url, which is the full-size image:

"image":{  "created_at":"XXX","id":XXX,"position":1,"product_id":XXX,"updated_at":"XXX","src":"XXX","variant_ids":[  

            ]
         }

Is it possible to access the smaller image sizes using the JSON API? I would like to display the medium-size images in my app, not the full-size.

The sizes available in Liquid are listed here: http://docs.shopify.com/themes/liquid-documentation/filters/url-filters#product_img_url

Thanks!


Viewing all articles
Browse latest Browse all 25503


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>