Fetch blogs data using storefront API

Hi, anyone knows how to query all the blogs in shopify using storefront API? thanks

It’s on the documentation. Just googled “Shopify Blog Api” and this is the first result: https://shopify.dev/docs/admin-api/rest/reference/online-store/blog

1 Like

The accepted solution works, but OP asked for Storefront API rather than the Admin API. Here is how you would query blogs in the Storefront API.

query BlogPosts($query: String!) {
  articles(query: $query, first: 10) {
    edges {
      node {
        id
        title
        excerpt
        image {
          url
          altText
        }
      }
    }
  }
}

Also, keep in mind you can increase the value for “first: ” to however many blog posts you want to return.

Hope this helps.