Ben Borgers

How to get Shopify storefront data without authentication

May 9, 2022

Shopify has a Storefront API that lets you get public information about your store, but it requires authentication and is a somewhat-involved GraphQL API.

Instead, thereā€™s an alternative (ā€œhiddenā€) API: all you have to do is to add .json to the end of a URL!

Imagine that your Shopify site is at example.com. You could get JSON data about your products in your store via this URL:

example.com/products.json

Or you could get data about your storeā€™s collections via this URL:

example.com/collections.json

You can even get data for a specific collection or specific product:

example.com/collections/:collection_id.json
example.com/products/:product_id.json

Most pages that you can navigate to on your Shopify site can be extracted as API data by adding .json to the end of the URL.

This can be super useful if youā€™re building a ā€œheadlessā€ Shopify site and want a simple API to get data from your site without needing to use authentication tokens or a GraphQL API.

More blog posts

Subscribe to my newsletter for a monthly round-up of new blog posts and projects Iā€™m working on!

Twitter ↗ RSS feed ↗