How to Scrape Shopify Stores: Complete Developer Guide
To scrape Shopify stores, start with the Storefront API or /products.json, the public JSON endpoints that return prices, variants, and availability on most stores. In our tests, both return errors on some storefronts, such as Gymshark's, so a web scraping script gets no data. This guide explains both endpoints, the HTML fallback, and full-store crawls with Decodo's Web Data API.
Lukas Mikelionis
Last updated: Nov 25, 2026
15 min read

TL;DR
- Web scraping Shopify stores starts with the Storefront API. With tokenless access, it worked on 7 of 8 stores tested and returned exact prices, currency, availability, and localized pricing.
- Where a store blocks both endpoints, use its product pages. Decodo's Web Data API /crawl fetched 200 Gymshark pages in under a minute.
- Shopify rate-limits each IP for each store. Use curl_cffi, which Shopify throttles later than plain Requests. Add rotating residential proxies to scale.
- Validate every daily run. A validation check rejects any run below 90% of the store's published product count.
What Shopify product data is worth scraping
Each use case needs specific product fields, shown with their Shopify field names:
- Competitor price monitoring. Extract price and compare_at_price for every variant, from each store, every day. A compare_at_price higher than price marks the product as on sale. To find which stores to monitor, use Shopify's Global Catalog, which searches all Shopify stores for merchants that sell a specific product.
- Assortment analysis. Extract title, tags, and product_type to see which new categories a brand adds over time. Assortment analysis is a common use case in web scraping for market research.
- Inventory tracking. The available boolean shows whether each variant is in stock. For stock levels, where the store exposes them, use inventory_quantity from /products/{handle}.js. The handle is the product's URL slug.
Confirm a site runs on Shopify
Before writing any scraping code, install curl_cffi and Beautiful Soup:
A quick way to detect Shopify is to request products.json, then the Storefront API, and check for valid JSON:
Allbirds and Jaxxon run on Shopify, so the function returns True for both, even though Jaxxon blocks products.json. For example.com, which doesn't run on Shopify, the function returns False:
The code uses curl_cffi with impersonate="chrome", which sends the same TLS fingerprint and HTTP/2 settings as Chrome. For a few requests, plain Requests works equally well. At high volume, Shopify lets curl_cffi send far more requests than plain Requests before it throttles them, even when plain Requests uses a Chrome User-Agent. Keep curl_cffi updated, because the chrome alias refers to the most recent Chrome version that your installed release supports.
If both checks fail, the store can still run on Shopify. The merchant may have blocked the endpoints, or anti-bot rules may be blocking your IP. Asset URLs on cdn.shopify.com in the page source usually mean that the store runs on Shopify. These asset URLs also appear on headless stores like Gymshark and SKIMS, which run a custom front end with Shopify as the backend.
A powered-by: Shopify response header confirms that the store runs on Shopify. Allbirds and SKIMS send this header, but Gymshark doesn't send it.
Test your target store first
Before you choose a method, check which endpoints your target store exposes. Take any product's handle, which is its URL slug, and check each endpoint:
On Gymshark, the JSON endpoints return 403 or 404, but the sitemap and the product page return 200. The product page includes JSON-LD (schema.org structured data embedded in the page):
Diagnostic results across famous Shopify stores
We ran the same checks on 8 well-known Shopify stores in November 2026. Of those, 2 blocked products.json, and only Gymshark also blocked the Storefront API. JSON-LD support varied by theme:
Store
products.json
Storefront API
Products in sitemap
.js
JSON-LD
Recommended method
allbirds.com
200
✅
368
✅
✅
Storefront API + .js
taylorstitch.com
200
✅
2,858
✅
✅
Storefront API + .js
fentybeauty.com
200
✅
951
✅
✅
Storefront API + .js
kyliecosmetics.com
200
✅
256
✅
✅
Storefront API + .js
jeffreestarcosmetics.com
200
✅
278
✅
❌
Storefront API + .js
redbullshopus.com
200
✅
925
✅
✅
Storefront API + .js
skims.com
404
✅
4,263
blocked
✅
Storefront API
gymshark.com
403
blocked
2,919
blocked
✅
HTML scraping, or Decodo /map + /crawl
Test more than one product before you decide that an endpoint is blocked, because some products can behave differently. On Jeffree Star, .js returns 404 for a mystery bag but returns 200 for ordinary products.
Disabled by the merchant or blocked by anti-bot rules. A 403 or 404 on products.json usually means an anti-bot block or the merchant's setup, like a headless front end that doesn't serve the endpoint. Residential IPs can avoid anti-bot blocks. An endpoint that the merchant disabled stays closed to every IP, so use the Storefront API or HTML scraping instead.
To distinguish between the 2 causes, retry the same request through a Decodo residential proxy. Your proxy username and password are on the Proxy setup tab under Residential in the Decodo dashboard. If the status code stays the same, the merchant likely disabled the endpoint. If it changes to 200, the block was IP-based:
Jaded London's status code changes to 200 through the proxy, so its block was IP-based. For Gymshark and SKIMS, the codes stay the same, which points to a block set by the merchant:
For SKIMS, use the Storefront API, which it still serves. For Gymshark, use HTML scraping, which takes product URLs from the sitemap and extracts JSON-LD from each page. Proxies help with HTML scraping too, because it makes thousands of page requests. To avoid requesting each page yourself, use Decodo's /map to list the URLs and /crawl to fetch the pages in one job.
Choose a method for your store
Ask these 3 questions, in this order:
- Does the Storefront API return 200? If yes, use it.
- If not, does products.json return 200? If yes, use it.
- If not, does either endpoint return 200 through a residential proxy? If yes, keep using that endpoint through Decodo residential proxies. If not, use HTML scraping or Decodo's /map and /crawl.

Each method also returns different fields. Check that your method has the data you need:
Method
Price
Currency
Availability
Stock level
Requests for a full catalog
Storefront API
Exact
✅
✅
Needs an access token
1 per 250 products
products.json
Exact, as a string
❌
✅
❌
1 per 250 products, up to 25,000
.js endpoint
Exact, in cents
❌
✅
inventory_quantity, if the store exposes it
1 per product
JSON-LD (HTML scraping)
Can lack cents
✅
✅
❌
1 per product page
Query the Storefront API without a token
Shopify's Storefront API is the documented way to read a store's catalog, and it supports tokenless access for product queries. Unlike products.json, the Storefront API returns prices with their currency, accepts a country code for localized pricing, and uses cursor-based pagination with no 25,000-product limit.
Send a GraphQL query to /api/{version}/graphql.json on the store's own domain. This function paginates the whole catalog, 250 products per request:
SKIMS blocks products.json, but its Storefront API works onskims.com:
Fetching all 4,262 products took 18 requests, while HTML scraping needs one request per product page. The function pauses one second between pages, and in our tests 1 to 2 requests per second stayed under Shopify's bot and crawler limits. Among the 8 stores tested, the API worked on all but Gymshark, whose front end doesn't serve /api.
Three details matter in production. For stock levels, use the .js endpoint, because quantityAvailable and metafields (custom product fields) need an access token. Shopify reports this query's cost as 430 (requestedQueryCost in the response), which leaves room for more fields under the tokenless limit of 1,000. Shopify also applies IP-level bot protection, so spread large monitoring jobs across rotating proxies.
Read the Storefront API record
For each variant, the API returns price as an object with amount and currencyCode, such as 34.0 and USD. Convert amount, which is a string, to a number before you compare prices. compareAtPrice is null unless the store sets one, and a variant is on sale only when its compareAtPrice amount is higher than its price amount. availableForSale is the availability flag.
Variant IDs are global IDs, such as gid://shopify/ProductVariant/…, and the number at the end matches the variant ID in products.json. The query reads up to 100 variants per product and prints a warning for any product that has more.
Scrape Shopify product data with products.json
The Shopify products.json endpoint returns the catalog in pages of up to 250 products.
Set up the request function
The products.json, sitemap, and HTML scraping methods below share one retry wrapper. Define it once:
On a 429, the wrapper retries with exponential backoff (10, 20, then 40 seconds), because Shopify can take about a minute to accept requests again. For other 4xx responses, such as a 404 on a deleted product, the wrapper raises an error immediately instead of retrying. At scale, rotating proxies make those waits rarer.
Fetch and paginate
The scraper paginates the catalog and stops at the first page with fewer than 250 products:
The output for Allbirds shows 368 products across 2 pages:
The 2-second delay keeps the loop well under the burst limits measured in the rate limits section. The code sets limit=250, the maximum, so each request returns 250 products instead of the default 30.
Shopify limits pagination to 25,000 products. When page × limit goes above 25,000, Shopify returns 400 Bad Request. So page 100 is the last one at limit=250, and the loop stops there with a warning. For larger catalogs, scrape collection by collection or use the Storefront API, which has no such limit.
Neither products.json nor the sitemap is an exact list of live product pages. On Fenty Beauty, 117 products in products.json were missing from the sitemap, and their URLs redirected to other pages. On Taylor Stitch, a later check found 2,872 products in the sitemap and 3,896 in products.json, and the sampled missing pages returned 200. The store's published count in /meta.json also matched products.json, so use it as the reference count.
Read the product record
This is the first Allbirds product, with only the fields that price and stock monitoring need:
Convert prices to numbers before you compare them, because they're strings. Don't assume every field has a value, as the empty product_type here shows. The product and each variant include updated_at, which you can store and compare between runs.
When a product is on sale, compare_at_price holds the original price, and price holds the sale price. Some stores leave compare_at_price null when there's no sale, and some set it to 0.00. Consider a variant on sale only when its compare_at_price is higher than its price. Automatic discounts and discount codes can apply at checkout without changing price, so the price field isn't always what a shopper pays.
products.json has no currency field, so record which market each price comes from, or use the Storefront API, which returns the currency. For stock levels, use the .js endpoint below.
Get more detailed product data with the .js endpoint
Unlike products.json, the /products/{handle}.js endpoint from Shopify's Ajax Product API includes barcodes, the media[] array, and stock levels where the store exposes them:
The output for the Men's Tree Runner includes the extra fields that products.json doesn't have:
The .js endpoint returns prices in the minor currency unit, unlike products.json. For USD, the minor currency unit is cents (7000 = $70.00).
inventory_quantity depends on what each store reports. Fenty Beauty and Kylie Cosmetics leave it empty, and Taylor Stitch appears to limit it to 40. Check the values on your target store before you rely on them. On stores that block .js, such as SKIMS, the public endpoints give the availability flag but not stock levels.
Tracking stock across a full catalog takes 1 .js request per product. For that volume, use rotating proxies.
Scrape a specific Shopify collection
Append /products.json to a collection URL to get only the products in that collection. Pass the collection path to scrape_shopify_products() as its path argument:
The mens-sneakers collection has 132 products, so 1 request returns all of them:
List all collections
The /collections.json endpoint returns the list of collections, with a product count for each:
Allbirds has 1,349 collections:
For stores with more than 25,000 products, scrape by collection, because the limit applies to each collection separately. Deduplicate by product id when you combine the results, because products can appear in several collections. Products that aren't in any collection won't appear, so compare your total with the store's published product count in /meta.json.
Extract product URLs from the XML sitemap
Shopify's /sitemap.xml is a sitemap index that points to child sitemaps. The child sitemap URLs contain query parameters that you can't guess, so read the index first and use each product sitemap URL exactly as listed. On stores that use Shopify Markets (Shopify's feature for selling in several countries), skip the localized sitemaps, which list the same products again. Fenty Beauty, for example, repeats its product sitemaps for 190 locales, so 380 sitemaps list 181,739 URLs for about 950 products.
The function reuses fetch_with_retry():
On Allbirds, the function finds 368 product URLs, the same count that products.json returned:
For stores that disable products.json, use these URLs for HTML scraping in the next section. Decodo's /map returns the same product URLs in 1 call, as shown in Crawl an entire Shopify store with /map and /crawl.
Scrape Shopify HTML when products.json is disabled
Some stores block both products.json and the Storefront API. When both return a 403 or 404, even through a residential proxy, extract product data from the HTML pages instead.
Many Shopify themes embed a <script type="application/ld+json"> block on product pages with schema.org Product structured data. The markup varies by theme. Some themes use Product, others use ProductGroup with a nested hasVariant array, and some put the price on the group instead of each variant. The parser handles all 3 cases and returns every variant:
The JSON-LD on this Taylor Stitch product page lists all 10 sizes:
Compare JSON-LD values with the price the page shows before you trust them at scale, because each theme builds its own JSON-LD. On Allbirds, 78 of 368 products had a JSON-LD price without cents, for example 15 for a product priced $15.60 in products.json. JSON-LD usually has no compare-at price either.
Gymshark's JSON-LD and the product data in its inline scripts both remove the cents from sale prices. The JSON-LD lists 30 for Gymshark's Running T-Shirt, but the product page shows $30.40:

On theme-based stores, the ShopifyAnalytics.meta object in the page source has exact prices in cents, such as 1560 for the $15.60 Allbirds product. Use it where JSON-LD lacks cents or is missing, as on Jeffree Star Cosmetics. With Beautiful Soup, find the script tag that contains var meta =, and parse the JSON after it. The object holds variant IDs and SKUs, but no availability.
Scraping each product page is slow on large catalogs. At about 4 seconds per page, including a 1-second pause, Gymshark's 2,919 products would take more than 3 hours one page at a time. Fetching pages in parallel, through rotating proxies or Decodo's /crawl, reduces that time. A 200-page Gymshark crawl finished in under a minute, compared with about 13 minutes for the same 200 pages one at a time.
Handle rate limits and anti-bot protections
Shopify doesn't publish rate limits for products.json, but it enforces them. Rapid requests from the same IP trigger 429 responses, with no Retry-After header.
Respect the request cadence
We measured these limits on products.json from a single home IP. The middle column counts requests sent as fast as possible before the first 429. In the last column, both clients send 5 requests per second:
Client
Burst before first 429
First 429 at 5 req/s
Plain Requests (Chrome User-Agent)
About 30 to 65 requests
After 13 to 14 s
curl_cffi (Chrome)
About 150 to 200 requests
After 47 to 52 s
The limit applies per IP and per store, and it depends on the client. The limit works like the leaky bucket that Shopify uses for its documented APIs. A fast burst fills the bucket, and it drains over time. When the bucket is full, Shopify returns a 429, not an empty array, and requests succeed again within about a minute.
A 2-second delay between paginated requests stays under these limits, and a delay of 1 to 2 seconds works for HTML product pages. The fetch_with_retry() wrapper above already handles the occasional 429. For more options, see retry logic for Python requests.
Because the limit is per store, a 429 from one store doesn't affect other stores on the same IP. Scrape several stores in parallel, one worker per store, instead of adding pauses between stores:
The 3 workers print their page lines mixed together. These are the totals at the end:
Common failures and their causes. These are the errors you'll see in the terminal, and what each one means:
- If the product count is far below the number of product URLs in the sitemap, pagination stopped early. Check the log for 429s and other errors.
- If products.json returns HTTP Error 401 and the homepage redirects to /password, the store is password-protected. Password protection is common before launch or on wholesale-only stores, and there's no public catalog to collect until the store opens.
- If a sitemap fails with xml.etree.ElementTree.ParseError: no element found, its URL is usually missing the query parameters. Fetch the sitemap index (/sitemap.xml) first and use the exact child sitemap URL from it.
- If products.json raises JSONDecodeError, the endpoint returned an HTML page instead of JSON. Retry through a residential proxy.
- If a request fails with HTTP Error 430, Shopify's security rejected it as possibly malicious, as its response codes explain. Retry it through a residential proxy as well.
Use proxies to scrape Shopify stores at scale
At scale, proxies help in 3 ways. They let you send parallel requests to one large store, replace a blocked IP, and see HTML pages with another market's prices.
Residential proxies use IP addresses that ISPs assign to real household devices. If a store blocks your own IP, it can still respond to a residential proxy IP. Rotating proxies give each request a new IP through a single gateway address.
Proxy traffic is billed per GB, and Shopify's compressed responses keep that traffic small. A 250-product products.json page is roughly 90 to 140 KB after compression, so a catalog of a few thousand products uses a few MB. Decodo's residential plans include a free trial and a pay-as-you-go option.
Configure Decodo residential proxies
First, create an account and open the Proxy setup tab under Residential in the dashboard. The tab shows your proxy username and password, and generates ready-to-copy endpoints for the location, session type, and protocol you select. The residential proxy quick start guide explains the full setup.

Scrape Shopify without blocks
Enhance your web scraper with Decodo residential proxies, offering 115M+ ethically-sourced IPs, advanced geo-targeting options, a 99.86% success rate, an average response time under 0.6s, and more.
The dashboard's generated endpoints use port 10000, and either port works. The format below uses gate.decodo.com:7000 for every location, and sets the country, session type, and session duration through username parameters:
By default, each request gets a new IP. This default works well for products.json pagination, because IP rotation spreads the page requests across IPs, each with its own rate limit. Rotate the IP but keep the same impersonate setting, so every request has a consistent, real-browser fingerprint. For cookie-based flows, such as a chosen currency, use a sticky session by adding session and sessionduration (in minutes) to the username, as in user-USERNAME-session-1-sessionduration-10.
Get prices for a specific market
When you set a country with the @inContext directive, the Storefront API returns that country's catalog and currency, if the store sells there. For HTML pages, a geo-targeted proxy can do the same. This query reads one Fenty Beauty product in 3 countries:
The output shows each country's price:
Canada is one of Fenty Beauty's markets, so the Storefront API returns the price in CAD. The UK isn't one of its markets, so the Storefront API uses the store's primary market and currency instead.
With products.json, the URL subfolder selects the market, not the IP. /en-ca/products.json returns the same CAD prices, but no currency field. Use the Storefront API when you need the currency code.
A subfolder works only for markets that the store serves on that domain, so check the sitemap index for the locales that exist. A missing subfolder returns 404, for example /en-gb/ on Fenty Beauty.
Unlike products.json, HTML pages can switch currency by IP geolocation. Fenty Beauty shows USD to US visitors and CAD to Canadian visitors. To scrape the pages that shoppers in one market see, add the country parameter to the proxy username, for example user-USERNAME-country-ca. Decodo's residential pool covers 195+ countries.
Scrape Shopify with the Decodo Web Data API
The code above works for most public Shopify stores. At 50+ stores on a daily schedule, though, retry logic, proxy rotation, and fallback chains become a separate project. Decodo's Web Data API reduces that work to a single HTTP call per page, with proxies, JavaScript rendering, and anti-bot handling built in. The Shopify Scraper API page shows the same API applied to Shopify.
One API key gives you these endpoints:
- /scrape fetches one URL and returns HTML, Markdown, or parsed JSON.
- /map lists a site's URLs from its sitemap and page links in a single synchronous call.
- /crawl collects a site's pages in an asynchronous job.
- /search returns search results for a query.
For Shopify, /scrape replaces the HTTP layer of the scripts above, and /map and /crawl replace the sitemap parsing and page fetching.
Scrape a product page with /scrape
The Web Data API quick start guide shows how to get an API key. The API code uses the standard Requests library (pip install requests). The earlier snippets import curl_cffi under the same name, requests, so put the API code in a new file. Copy parse_jsonld() from the HTML scraping section into it, along with its from bs4 import BeautifulSoup line:
The API returns the product page, and parse_jsonld() reads every variant from its JSON-LD:
The price matches the $22 on the page. The returned HTML also has the displayed price, so use a CSS selector where JSON-LD prices have no cents, as on Gymshark sale items.
A few parameters matter for Shopify:
- proxy_pool sets the proxy type. "standard" works for simple pages, including typical Shopify product pages. The default, "premium", is built for sites with complex anti-bot measures.
- headless renders the page in a headless browser ("headless": "html"), for sites that render their content client-side with JavaScript. Shopify themes usually put the JSON-LD in the server-rendered HTML, so requests without browser rendering are enough.
- geo sets the country the request comes from, so the store serves that market's catalog and prices. Set it on every Shopify request, because stores can redirect visitors by country. For example, Gymshark redirects visitors from Spain to its EU store, with euro prices. api_scrape() uses United States by default.
If the API rejects the key (401 or 403), api_scrape() stops immediately and shows the API's message.
Fetch Shopify products.json with /scrape
The same call works for products.json. The content field holds the JSON body as a string:
A single request returns 250 products:
Use this approach to monitor many stores that don't block products.json, without running your own proxies. Each request returns 250 products, and the API rotates IPs for you.
The Web Data API pricing page lists the current plans, including a free plan for testing. The full parameter list, including browser actions for JavaScript-heavy pages, is in the scrape parameters docs. Decodo also has an official Python SDK for the Web Data API.
Crawl an entire Shopify store with /map and /crawl
A Shopify crawler on the Web Data API has 2 steps. One discovers URLs and the other extracts their data, as explained in crawling vs. scraping. To crawl a Shopify store, first use /map to list the product URLs, so you know how many pages to crawl. /crawl then reads the same sitemap and fetches the pages as an asynchronous job.
The crawl runs on Decodo's servers, which read the sitemap, route requests through proxies, and fetch pages in parallel. Every page request goes through the premium proxy pool, the one built for sites with complex anti-bot measures.
The examples below crawl Gymshark, whose storefront returns errors on both JSON endpoints. Add the code to the file from the previous section, because it reuses API_URL, HEADERS, and parse_jsonld().
Map every product URL with /map
The /map endpoint lists a site's URLs in one synchronous call, from its sitemap and the links on the page you submit. /map is the API version of the sitemap function above, and a quick way to find all URLs on a domain before you crawl it.
Send the store URL with select_paths to keep only product pages:
The call took about 12 seconds and returned every product URL in the sitemap:
On all 6 stores we mapped, /map returned every primary-market product URL in Shopify's sitemap index.
These /map parameters matter for Shopify, and the map parameters docs describe the rest:
- sitemap sets where the URLs come from. "only" uses the sitemap alone, "include" (the default) adds the links on the page, and "skip" ignores the sitemap. The response's sitemap_status confirms which source the URLs came from.
- select_paths and exclude_paths are regex filters on the URL path. ^/products/ keeps only paths that start with /products/, so it also removes localized URLs like /es-US/products/{handle} that Gymshark's sitemap lists. Add "exclude_paths": ["gift-card"] to exclude the gift card product.
To try the same request without code, open the Web Data API playground in the dashboard. Select Map, enter the store URL, and under Advanced settings, set Sitemap to Only and Select paths to ^/products/. The JSON response appears below the form, with its status code and response time.

Crawl the store with /crawl
The /crawl endpoint runs as an asynchronous job. You start it, poll its status (or set a callback_url for a webhook), then fetch the results. With "sitemap": "only", /crawl fetches the sitemap URLs that match select_paths.
These functions start a crawl, wait for it, and download the pages:
The crawl finished in under a minute, and every page had JSON-LD:
The parameters that matter for a Shopify crawl are below, and the crawl parameters docs describe the rest:
- limit sets the maximum number of pages in the job. Start with a small value to check the output, then increase it to the /map count.
- output sets the result format. Use "html" to keep the <script> tags that hold the JSON-LD. The default, "markdown", works best for text content.
- max_duration stops a long crawl after a set number of seconds and keeps the pages already collected.
Crawls of a few hundred product pages finished in about a minute. A 200-page Gymshark crawl took 57 seconds, and all 368 Allbirds pages took 46 seconds. Polling every 10 seconds is enough.
For scheduled jobs, set callback_url (and a passthrough value to verify the sender) instead of polling, and download the results when the callback arrives.
Cost is per request, and each job's status includes a requests count, which the full crawl script saves in its JSON file. The billing page lists the current rates for each plan and the responses that aren't billed.
When you scrape Shopify stores that serve products.json, /scrape is the more cost-efficient path. Allbirds' full catalog takes 2 requests through products.json, compared with a 368-page crawl. Use /crawl for stores that block both the Storefront API and products.json, or when you need the product pages as shoppers see them.
Complete script
Save the script as shopify_scraper.py and pass it one or more store URLs, for example python shopify_scraper.py https://www.allbirds.com https://kyliecosmetics.com. This Shopify web scraper tries the Storefront API first, then products.json, and then HTML scraping, which reads the JSON-LD on each product page:
This is the output for Allbirds and Kylie Cosmetics. Allbirds shows 317 products instead of 368, because its catalog shrank between runs (products.json showed the same drop):
Each store gets its own JSON and CSV file, named after its domain and the run time. The JSON file holds a metadata block and the full products array, which detect_changes() in the scheduling section compares between runs. The CSV has one row per variant, and its currency column is filled when the data comes from the Storefront API or JSON-LD. To load the data elsewhere, such as a database, follow the guide to saving scraped data.
Without arguments, the script scrapes STORE_URL. If a store fails, for example because it blocks your IP, the script prints the error and continues with the next store. To route requests through Decodo residential proxies, uncomment the proxy lines and add your credentials. With proxies enabled, the script retries a 403 on a new IP.
For a long list of stores, run scrape_store() in a thread pool with one worker per store, as in the rate limits section. The script reads each store's primary market. For another market's prices, add the @inContext directive and the country variable from Get prices for a specific market to its query.
The script handled every type of store tested without code changes. Allbirds, Fenty Beauty, Kylie Cosmetics, and SKIMS used the Storefront API, each in under a minute. On Gymshark, the script switched to HTML scraping automatically. On 12 more random stores from Shopify's Global Catalog, the script worked as is on 11, and through Decodo residential proxies on the 12th.
Shopify crawler script with /map and /crawl
The second script collects a store's product data through Decodo's Web Data API instead. The crawler maps the product URLs, runs one crawl, parses the JSON-LD, and saves one row per variant as JSON and CSV. Save it as shopify_crawler.py. It uses Requests and Beautiful Soup, not curl_cffi (pip install requests beautifulsoup4):
This is the output with LIMIT set to 50. /map found 2,999 product URLs this time instead of 2,919, because Gymshark's catalog changed between runs:
The CSV has one row per size, so you can track the availability of each one. Gymshark's JSON-LD repeats the same SKU on every size, so key the rows by URL and size. These leggings were on sale:
The HTML that /crawl returns also has the displayed price, so parse it for exact sale prices on Gymshark. Set LIMIT to None to crawl every URL that /map found.
Automate scraping on a schedule
Price monitoring and inventory tracking need recurring runs. On a server, cron is the standard way to schedule web scraping tasks.
Schedule with cron
On Linux or macOS, add the line below with crontab -e. This line uses the full path to Python (here, a virtualenv in .venv), because cron runs with a minimal PATH. The store URLs come from stores.txt, one per line. flock -n skips the run if the previous one is still running, and the lock is released even if a run crashes:
flock is included in util-linux on Linux. On macOS, install it with brew install flock. On Windows, use Task Scheduler and set If the task is already running to Do not start a new instance.
A scheduled script usually runs on a cloud server, and stores can treat datacenter IPs as bot traffic. Enable the script's residential proxy lines before you schedule it.
Detect price changes between runs
The function below compares 2 runs of the complete script by variant ID. Shopify variant IDs are unique and don't change, while merchants can rename a product handle. The function reports price, compare-at price, and availability changes, plus new and removed variants. It works with Storefront API and products.json runs, which include variant IDs:
JSON-LD runs have no variant IDs, so compare their rows by URL and size instead.
Validate each run before you use its changes
A run can finish without errors and still be wrong, for example when pagination stops early or a price parses as zero.
validate_run() rejects a run when its product count falls below 90% of the count the store publishes in /meta.json. A blocked /meta.json also rejects the run, while a missing one (404, as on SKIMS) holds it for review. It also holds zero prices for review, along with any price change above 50% that detect_changes() reports. The demo loads the current run and the previous run from the complete script's files:
The full Allbirds run passes, and a copy truncated after page 1 is rejected:
Product counts change between runs. Allbirds' products.json count fell from 368 to 317 in 2 days. A fixed count, or the last run's total, would have rejected this good run. On stores without /meta.json, use the number of product URLs in the sitemap instead, which can be lower than the published count.
For a daily run, put the detect_changes() and validate_run() code, with its imports but without the demo lines, in daily_check.py, and add the code below. The file names include a timestamp, so the function sorts them and compares each store's newest run with the one before it. It skips JSON-LD runs, such as Gymshark's, because they have no variant IDs:
This is the output with an Allbirds run from 2 days earlier and a single Kylie Cosmetics run:
To run the check every day, replace the cron line with this one, which runs daily_check.py after the scraper:
If the store blocks your server's IP, send the /meta.json request through the scraper's proxies too, or the check rejects every run. For JSON-LD stores, compare rows by URL and size, and check the count against the number of product URLs in the sitemap. Then push the accepted changes to a database, spreadsheet, or notification system.
If you prefer visual workflows to cron scripts, use Decodo's n8n integration.
Final thoughts
For web scraping Shopify stores, start with the Storefront API, which needs no access token and worked on 7 of the 8 stores tested. Test each store first, and retry a 403 or 404 through a Decodo residential proxy, because the block may depend on your IP. For daily monitoring, schedule the complete script, check each run with validate_run(), and reject any run below 90% of the store's published product count. Where a store blocks both endpoints, Decodo's /map lists the product URLs and /crawl fetches the pages in parallel, not one at a time.
For related eCommerce scraping tutorials, see how to scrape Target product data, scraping Amazon product data, scraping Etsy, and price scraping.
Decodo's Web Data API includes a free plan, so test /map and /crawl on your own target store before you scale.
Skip the boilerplate
Track competitor pricing across thousands of Shopify stores with Decodo's Web Data API.
About the author

Lukas Mikelionis
Senior Account Manager
Lukas is a seasoned enterprise sales professional with extensive experience in the SaaS industry. Throughout his career, he has built strong relationships with Fortune 500 technology companies, developing a deep understanding of complex enterprise needs and strategic account management.
Connect with Lukas via LinkedIn.
All information on Decodo Blog is provided on an as is basis and for informational purposes only. We make no representation and disclaim all liability with respect to your use of any information contained on Decodo Blog or any third-party websites that may belinked therein.

