Skip to content
All articles

Structured sources

Shopify product scraper: public structured data

Build a Shopify product scraper around public structured data, verify variants and prices, and handle missing fields.

url2llm4 min read

A Shopify product scraper should use public structured product data when the storefront exposes it. When that source is unavailable or incomplete, make a separate Markdown or HTML request for the page. Product pages can mix stable fields with theme-specific content, so compare the returned fields with the visible page before using them for a feed or monitor.

When you request the shopify format, url2llm reads public storefront JSON. This is not a promise that every store exposes every product field. If that request fails, make a separate Markdown or HTML request to inspect the public page. A request that explicitly asks for shopify requires that structured data to be available.

Which product fields do you actually need?

Define the output before choosing a scraper. A catalog index may need URL, title, image, and variant identifiers. A pricing monitor also needs current price, currency, availability, and a fetch time. A merchandising analysis may need page copy and screenshots. These jobs have different freshness and validation needs.

Job Source to inspect first Check before use
Catalog discovery Public sitemap and product URLs Canonical URL and duplicates
Product fields Public structured storefront data Variants, currency, missing values
Page copy Rendered HTML or Markdown Theme content and selected variant
Visual check Screenshot Locale, device, selected state

Shopify's Storefront API documentation describes an official API for storefront data. Access to that API depends on the store and its credentials. A public page scraper should not be described as having that access.

How do you fetch a public Shopify page?

Start with the product URL and request only the formats you need. The shopify format asks url2llm to capture structured Shopify data when available:

curl -X POST https://api.url2llm.com/v1/scrape \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"url":"https://store.example/products/item","formats":["shopify","markdown"]}'

Inspect the response before building around any field. A store can change its theme, public data exposure, or product configuration. If the structured capture fails, handle that result explicitly and decide whether a separate page scrape can answer the job.

Read data.shopify as source data, then validate the exact fields your job needs. A variant's displayed price can depend on the selected option, country, or currency. Match the same product URL, variant, and locale when comparing structured data with the visible page. Do not silently fill a missing field from an unrelated variant.

How do you keep product data current?

Use /v1/map to discover product URLs, then choose which pages to scrape. A map result is a URL list, not product content. For price monitoring, force a fresh fetch when the acceptable cache age is zero. For less time-sensitive copy, a cached read may be useful. Retain the fetch timestamp and compare like-for-like variants and currencies.

Do not treat a missing price as zero or a missing availability field as out of stock. Those are extraction states, not product facts. The API guide covers the output and failure checks. The JavaScript rendering guide helps when a theme loads key content after the initial HTML.

Test one representative product with variants in the url2llm playground before scaling to a whole store. That single check exposes many schema assumptions early.

Try it on a real page.

Inspect the formats and response before adding a page to your pipeline.

Start free