Featured Product Image

Highlighted
New Member
24 0 0
I was looking through the documentation and i cant seem to find how you can determine the featured image for a product. Is there anyway to find the featured image through the API?
0 Likes
Highlighted
Shopify Staff
Shopify Staff
5704 1 319

I was looking through the documentation and i cant seem to find how you can determine the featured image for a product.

Wiki: http://wiki.shopify.com/Product

[In your admin, the featured image is the first one in the list, and you can re-order your images.]

0 Likes
Highlighted
New Member
24 0 0

Ah i see there is a “position” field in the images object.. Oops missed it.

Thanks

0 Likes
Highlighted
Shopify Staff
Shopify Staff
5704 1 319

You have a knack for making things difficult for yourself.

If you follow the link I provided to you you will see a variable for the featured image. It is called: product.featured_image. Cheers.

0 Likes
Highlighted
Shopify Staff
Shopify Staff
5704 1 319

Oh I see that’s posted under Developers. You used to work on a theme and now you’re working on an app. My apologies.

0 Likes
Highlighted
New Member
24 0 0

Actually in the API it looks like there is no “featured image” field available. I know in the template you have access to it.

so I am assuming that when I access the product images through the api I just need to find the image that has the position of 1. That I am guessing is the featured image. I have done some testing with a live store and it seems like the featured image is at the position of 1.

I finished the work on the theme I was building for a designer. I found the api and got a couple of ideas, so I stayed for that :)

0 Likes
Highlighted
New Member
24 0 0
0 Likes
Highlighted
Shopify Expert
1 0 0

I know this is an old thread, but is there anyway to retrieve only the featured image from the product rest API endpoint e.g. /products.json?fields=featured_image? It would be very useful, for example if you wanted to create something similar to the product admin screen, where there is small thumbnail of the product image ... could be done by returning a single value / object rather than an array of X images.

0 Likes