1
votes

So, I am using Shopify for a clients eCommerce store and I’m creating a node js program that loops through the excel spreadsheet and imports style names, vendor names, variants, etc. However, I have a bunch of product images that contain the matching style number in their name so I want to loop through that directory of images and insert those images to each matching style number in the spreadsheet.

I however I can’t seem to find if Shopify’s CDN has a base url I can append the image names to the end of. If anyone knows please let me know.

Edit: So I have found that the first part of the shopify image url is linked to the ID of your store and does not change, however I have found out that Shopify generates the ending code randomly after uploading the image. Do you think this would happen if I was to supply the url without that generated code at the end of the url? Ex url. //cdn.shopify.com/s/files/1/0222/9076/t/10/assets/logo.png?796

The "?796" is the generated code.

Appreciate it!

1

1 Answers

2
votes

Each store has an unique base URL for their files CDN.

So if all of the products are from the same store they will share the same URL structure with the only difference being the file name.

The last part of the URL is not required it just prevents caching of the image ( can't confirm if it's only for that ).

So if you use //cdn.shopify.com/s/files/1/0222/9076/t/10/assets/ + IMAGE_NAME you should be good to go.

You can test it with //cdn.shopify.com/s/files/1/0222/9076/t/10/assets/logo.png where there is no argument at the end.