Headless Commerce and What It Changes for Data Access

Cover for “Headless Commerce and What It Changes for Data Access”: traditional versus headless store architecture and where product data ends up

4 min read

In a headless store, the shop front that shoppers see and the commerce engine that holds products, prices and stock are separate systems connected by APIs. Retailers adopt it for reasons such as design freedom and performance. For anyone collecting product data it changes where the data shows up. Data moves out of server-rendered markup and into embedded page state or API calls the browser makes. That can make collection cheaper and cleaner, or more expensive and fragile, depending on which part of the architecture you meet and what you are permitted to use.

Key takeaways

  • Headless storefronts deliver product data in one of two places: JSON embedded in the HTML (server-rendered) or API calls made by the browser (client-rendered).
  • Embedded state is often the easiest reliable source: structured, already in the page, one request per page.
  • Client-side API calls may use credentials issued to the store’s own frontend. Visible in the browser is not the same as authorized for you.
  • Start from documented, permitted interfaces. Undocumented internal endpoints are cheap until they change or someone asks whether you were allowed.
  • No reliable figure exists for how many retailers run headless. Check each source.

Three architectures, three places to look

Where the product data surfaces

Three storefront architectures, and the point where product data becomes visible

Traditional storefrontCommerce engineServer-rendered HTMLdata in markupBrowserHeadless, server-renderedCommerce engineStorefront APIFrontend serverHTML + page statedata in embedded JSONBrowserHeadless, client-renderedCommerce engineStorefront APIApp shell HTMLlittle or no dataBrowser JS calls APItoken issued to the storeRendered pageproduct data visible in what the page deliverscredentials belong to the store, not to a collector
Simplified architectures; real stores often mix them. Graphic: JsonEngine.

In a traditional storefront the commerce platform renders each page with the product data in the markup, often alongside JSON-LD. In a server-rendered headless store a separate frontend fetches the data from the commerce engine’s storefront API, renders the page and usually embeds the same data as a JSON blob so the browser app can take over without fetching it again. In a client-rendered store the server sends little more than an application shell, and the browser fetches product data itself.

Embedded state: often the best thing on the page

Server-rendered frameworks commonly ship the data used to build the page inside a script tag. For a collector that is valuable: it is structured, typed and complete enough to render the page, and it arrives in the same single request as the HTML. We looked at where five large US retailers keep their product data in where e-commerce data actually lives.

Python
import json, re, requests

UA = {"User-Agent": "ExampleCollector/1.0 (+https://example.com/bot)"}
html = requests.get("https://shop.example.com/p/trail-jacket", headers=UA, timeout=(5, 30)).text

# Many server-rendered frameworks embed page data in a JSON script tag.
m = re.search(r'<script[^>]+type="application/json"[^>]*>(.*?)</script>', html, re.S)
state = json.loads(m.group(1)) if m else None

Treat the structure as internal to the site: it can change with any release, so validate fields rather than trusting paths blindly. The validation rules we would apply to any parser apply here too.

Client-side API calls: visible is not authorized

When the browser fetches product data, you can see those requests in its developer tools. That does not make the endpoint yours to use. Some storefront APIs, such as Shopify’s Storefront API, require an access token issued to the store’s own frontend. Such a token sits in the page because the store’s app needs it, not because the store has granted it to third parties. Reusing it, or exploring internal routes that the site hasn’t documented, moves a project from reading what the store publishes to using its systems in ways it hasn’t offered.

Platforms draw this line explicitly. WooCommerce describes its Store API as public endpoints for customer-facing product, cart and checkout functionality. Adobe Commerce blocks anonymous access to its REST catalog endpoints by default. Shopify documents a public Ajax API for product data alongside its token-based Storefront API. Where a store offers a documented public interface or a feed, use that. Where it doesn’t, the page itself, and what is embedded in it, is the honest boundary.

What headless changes for cost and stability

Cheap is not the same as sound

Collection approaches for headless stores by cost and stability, in our judgment

Collection cost per pagelowerhighermorestablelessstableDocumented storefront API or feedEmbedded page stateServer-rendered markupBrowser renderingUndocumented internal APIcheap, but unstable and permission unclear
JsonEngine’s qualitative assessment, not measured data. Positions vary by store. Graphic: JsonEngine.
SituationEffect on costEffect on stability
Data embedded in server-rendered pagesOne request per page, structured parsing, no browser neededChanges with frontend releases; validate fields
Data only after client-side renderingA browser for each page: many more requests and much more computeDepends on scripts and timing as well as markup
Documented public storefront API or feedLowest per recordHighest: it exists to be used
Undocumented internal endpointLow per recordLowest: no notice of change, and permission unclear

The positions are our judgment, and individual stores vary. The pattern still holds: the cheapest-looking route is not the soundest one, and the soundest is usually the one the store chose to publish.

A sequence that works

  1. Look for a documented feed or API for your use case, and check the store’s terms.
  2. Check robots.txt for the paths you plan to fetch, including any API paths.
  3. Read the page source for JSON-LD and embedded state before considering anything heavier.
  4. Render in a browser only when the data exists nowhere else in what the page delivers, and budget for the extra cost.
  5. Stop at credentials. Anything that needs a token, key or login the store hasn’t issued to you is out of scope without the store’s agreement.

For when a source has no usable interface at all, see web scraping vs official APIs.

Quick answers

What is headless commerce?

An architecture in which the storefront that shoppers see is a separate application from the commerce engine that manages products, prices and orders. The two communicate through APIs.

Is it easier to scrape a headless store?

Sometimes. Server-rendered headless pages often embed structured product data as JSON, which is easier to parse than markup. Client-rendered stores may need a browser, which is costlier.

Can I use the API calls I see in my browser’s network tab?

Not automatically. Some storefront APIs use tokens issued to the store’s own frontend. Visible in the browser is not the same as authorized for you; use documented interfaces or ask the store.

What is embedded page state?

Data a server-rendered page includes, usually as JSON in a script tag, so the browser application can display the page without fetching the data again.

How many retailers use headless commerce?

We know of no reliable public figure. Check each source individually rather than assuming an architecture.

Collection that fits each store

We work out where each store’s data lives and what it permits before we collect. See custom datasets or ask about a store.