Invalid image URLs returned by Storefront API

sigh
New Member
3 0 0

I am getting back image URLs from the Storefront API that point to non-existent files on the Shopify CDN.

I'm not going to post shop details in a public forum, so how can I get help with this apparent Shopify error? I tried partner support and they (unhelpfully) pointed me to these public forums.

Thanks.

0 Likes
Jason
Shopify Expert
10354 155 1988

What can you post? This is a community forum so we'd need a little bit to work with. Do understand that you might not want to add all the details here so maybe throw them into a github gist or something that you delete later.

Are you sure it's a non existent url? is it the version number that's wrong? missing? something else?

I jump on these forums to help and share some insights. Not looking to be hired, and not looking for work.

Don't hand out staff invites or give admin password to forum members unless absolutely needed. In most cases the help you need can be handled without that.


★ http://freakdesign.com.au ★
0 Likes
sigh
New Member
3 0 0

We use the Storefront API transformedSrc field to get Shopify CDN image URLs. For at least one shop, many of these URLs lead to a CDN 404 error.

As far as I understand, an invalid URL from this field is either an API error or a CDN error. The transformations are best-effort, but they're ignored if unsupported; and for this shop, simply requesting transformedSrc with no transformations still leads to a 404 error page.

The query is very simple:

 

query ($id: ID!) {
  product: node(id: $id) {
    ... on Product {
      id
      images(first: 1) {
        edges {
          node {
            id
            originalSrc
            transformedSrc(maxWidth: 128, maxHeight: 128)
          }
        }
      }
    }
  }
}

 

Example of a bad transformedSrc URL returned by the Storefront API: https://cdn.shopify.com/s/files/1/0670/1711/products/4121_nickel_mach3_128x128.jpg?v=1601313804

I expect Shopify needs to look into this to determine whether the API or the CDN is at fault.

0 Likes
awwdam
Shopify Staff
Shopify Staff
61 5 2

Hey @sigh,

We did a bit of digging with the info you shared. Based on this specific behaviour, and intended functionality of how images are hosted, this would not be directly related to the our Storefront API.  I would suggest reaching out to a merchant experiencing this types of issue, and encourage them to contact our support team directly - feel free to share this link

awwdam | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes