Storefront api - product seo

I am querying the Storefront api for products and want to access the seo fields (title and description). In the documentation for the api seo is listed as a possible field for every version since 2021-01. However every time the fields seo.title and seo.description come back nulled. I tried every 2021 version of the api. The other product fields are populated properly and I double checked, that I populated the fields in the shopify admin panel.

This is my graphql query:

{
    productByHandle(handle: "alexandra") {
        handle
        description
        seo {
            title
            description
        }
    }
}

This is my response:

{
    "data": {
        "productByHandle": {
            "handle": "alexandra",
            "description": "Produktbeschreibung Der Unisex-Canvas-Shopper Alexandra mit groĂźem HAM-Artwork Kontrast-Druck ist multifunktional und fĂĽr jeden Anlass bereit. Material und Details 100% Baumwolle Pflege nicht waschen nicht bleichen nicht im Trockner trocknen nicht bĂĽgeln nicht chemisch reinigen",
            "seo": {
                "title": null,
                "description": null
            }
        }
    }
}

The graphql doesn’t give me a deprecation warning:

I already contacted support and they told me the api “behaves the way it should”. Is the seo data in my screenshot not the one i am querying? Or what actually happens here?

Thank you for your responses!

1 Like

Hi, could you check if you input SEO title and description manually on the product admin?

Shopify uses product title and description as SEO data by default, which means no SEO setting data exists.

As I checked my Storefront API Product root search, all of my products had nulls in SEO, but once I put manual data in SEO, that product returned SEO data in API, so productByHandle should have the same behavior.

Hope this will work for you.

2 Likes

That did work thank you.

Still find it strange, but now I know how to work around it.