Back to Knowledge Hub
Deployment

Scraping Shopify: Storefront API, Ajax or Browser?

Compare Shopify Storefront GraphQL, hosted-theme Ajax JSON and rendered pages by access, product variants, currency context and the evidence each surface supplies.

BotBrowser Team

Documentation

Want the structured docs for Deployment?

This article lives in the editorial library. For step-by-step setup, reference material, and ongoing updates, jump into the docs section.

Scraping Shopify starts with choosing the surface that can actually answer the product-data question. Storefront GraphQL, the Ajax API for Shopify-hosted themes and a rendered page have different contracts. Storefront access can be tokenless for a documented subset; Ajax does not require a token but is not the API for custom storefronts. A browser adds presentation evidence when that is the authorized question. BotBrowser provides profile-backed browser configuration; it does not supply Shopify product data, create API credentials or authorize access to an administration interface. Choose the documented surface and its access scope before choosing an automation tool.

Three Shopify surfaces answer different questions: Storefront GraphQL for supported commerce data, hosted-theme Ajax for documented JSON operations, and a browser for rendered presentation. Product identity, currency context and completeness remain attached to the selected source.

TL;DR

  • Storefront GraphQL supports both tokenless and token-based access. The supported fields and access model matter more than a generic API label.
  • Ajax is documented for Shopify-hosted themes. It is not a general data interface for every storefront built with Shopify.
  • Product JSON has a documented variant limit, and its monetary values use the customer's presentment currency. Keep those conditions with the observation.
  • A resolved browser request is not proof of HTTP success, valid product data or complete results.
  • Use rendering for an authorized presentation question; browser configuration cannot establish API permission or the meaning of a price.

Contents

Identify the Shopify surface

The Storefront API reference describes GraphQL access to commerce capabilities, including products, collections and carts. A request names the fields needed for an application instead of parsing a theme's layout. This is useful when the required question is about data covered by the documented schema and the selected access model. It does not mean every field is available without credentials, or that a particular integration may use the returned data for any purpose. The operation, supported scope and authorized use are separate parts of source selection.

The Ajax API overview describes a lightweight interface for themes hosted by Shopify. It returns JSON without requiring an access token or client identifier, but the documentation explicitly excludes custom storefronts. A site using Shopify commerce behind a custom frontend does not thereby inherit every hosted-theme Ajax behavior. Establish the storefront architecture from the approved integration or owner before selecting that interface. A familiar platform name in a page is insufficient evidence that a particular documented route applies to it.

SurfaceSuitable questionBoundary to retain
Storefront GraphQLWhich requested commerce fields are available through this supported operation?Tokenless scope and token-based features differ
Hosted-theme AjaxWhat does a documented theme JSON operation return in this customer context?Shopify-hosted themes only; operation-specific limits apply
Rendered pageWhat does the authorized interface display in the observed state?Displayed state is not an API schema or proof of complete catalog data

These are source-selection rules rather than measured speed rankings. No fixed cost comparison follows from the names GraphQL, JSON and browser. A narrowly requested API result can reduce unnecessary page work, while a task about visible formatting still needs evidence of presentation. The price-monitoring architecture separates source observations from publication; the Shopify surface choice belongs in the observation contract. Record which surface answered the question so a later change from JSON to rendered text does not appear to be an ordinary price update.

The rendered page also needs a defined scope. It can show a product option, a formatted amount or a localized availability message in a particular state. It cannot establish that all variants or all products have been returned merely because the interface loaded. Before building a browser collector, write the field question in terms of the evidence required. If a supported data operation already supplies that evidence, rendering another representation may introduce disagreement without resolving a missing fact. If the question is explicitly visual, an API value alone does not demonstrate the displayed result.

Keep access models separate

The current Storefront API documentation explicitly supports tokenless access as well as token-based authentication. Its tokenless list includes products and collections, selling plans, search, pages and other content, and cart operations. The documented tokenless complexity limit is 1,000. That limit describes a particular access mode, not a permission grant for arbitrary collection, and it should not be converted into an instruction to divide a workload until it fits. Confirm the current operation and field requirements against the integration's supported scope.

The same reference lists features requiring token-based access, including product tags, metaobjects or metafields, menus and customers. Public and private access tokens also have different exposure rules: a public token is intended for client-side contexts, while a private token must remain on the server. Do not copy a server credential into a browser script because a GraphQL request appears easy to reproduce. Public visibility, successful authentication and an approved data use are distinct properties; none should be inferred from the other two.

Shopify's API authentication overview distinguishes Storefront access from Admin API app identity and Customer Account customer authentication. A product-data observation must not treat those identities as interchangeable. A Storefront response is not evidence that an application can read administration data, and a customer session is not a substitute for an app's required access. Record the API family and the supported access mode, without storing reusable credentials in the observation record. Keep secret material outside fixtures, screenshots and incident reports.

The Ajax overview adds another important distinction: unauthenticated does not mean unlimited. It states that there are no hard rate limits, while abuse-prevention measures still apply. That wording cannot support a promised request volume or a recipe for avoiding restrictions. Ajax also contains cart operations, so describing the entire API as read-only would be wrong. For a product-reading task, select the documented reading operation and avoid operations that modify a customer's cart. A refusal should remain an access outcome rather than a reason to switch accounts or routes.

Preserve product and currency context

The Ajax Product reference documents product retrieval using a locale-aware URL and a product handle. A handle identifies the requested product in that context; it does not establish a universal identifier across shops or surfaces. Retain the shop, product reference and selected variant where relevant. If a comparison joins results from a rendered page and an API, define how the product and variant were matched. A shared title is not sufficient evidence that both observations describe the same purchasable option.

That reference limits the variants array to a maximum of 250 variants. A successful product response therefore cannot prove that an arbitrarily large product's variant set was exhaustively observed. Record the documented source limit alongside the application's completeness requirement. If the task requires a complete variant inventory that this result cannot establish, return an incomplete outcome or select another approved source with the required contract. Do not label an unobserved variant unavailable merely because it did not appear in a limited response.

The same Product documentation says monetary properties are returned in the customer's presentment currency. Keep the amount and its established currency context together rather than assuming a shop's default currency or a browser language determines both. A country label, a currency symbol and a configured locale are different evidence. When a source does not establish the currency required by a comparison, retain the uncertainty instead of attaching the browser's preferred locale as a commercial fact.

The Amazon source and browser comparison separates presentation inputs from offer conditions. That distinction applies even when an API result and a page are collected by the same browser session. Preserve their source types and observation times independently, together with relevant product selection and customer context. If a visible amount disagrees with a JSON field, first establish whether both represent the same variant and currency. Rendering success alone does not decide which observation answers the application's field question.

Keep completeness separate from freshness as well. An observation can be recent but omit a required variant; a complete saved fixture can be unsuitable for a current-price task. Store collection outcome, source time where available and the collector's observation time with their actual meanings. Do not use the completion time of an entire run as if every product was observed then. These are application-owned data distinctions, not additional properties promised by Shopify's Product endpoint. They allow the consumer to decide whether a record is usable without pretending that absent source evidence exists.

Check the response before accepting data

MDN's Fetch API reference states that a fetch promise resolves when response headers arrive, even when the HTTP response represents an error. A fulfilled request is therefore only one transport observation. Check the HTTP outcome before interpreting a response as product data, and record a refusal distinctly from an empty result. Neither a completed browser navigation nor a resolved promise establishes that the expected commerce representation was supplied.

CheckEvidence neededOutcome when missing
HTTP resultActual response status and final sourceRetain request failure or refusal, not an empty catalog
RepresentationBody matches the selected API or page contractClassify unexpected content before parsing fields
Product meaningRequired product, variant and currency contextKeep incomplete or noncomparable records out of price changes
CompletenessRequired scope fits the documented source limitsDo not publish partial coverage as an exhaustive result

The representation row depends on the chosen surface. JSON from a documented Ajax operation and HTML from a rendered storefront are not interchangeable inputs to a parser. A response can have a successful HTTP status while still failing an application's field contract. Preserve a minimal permitted example of the unexpected content so the parser change can be explained. Do not store an entire authenticated session or unrelated customer information merely to demonstrate that a product field was absent.

Fetch also operates within browser request rules, including CORS, as the MDN reference explains. A browser-side request failure should not automatically be attributed to missing product data or bad credentials. Record the observed failure and the calling context before choosing an explanation. Changing browser configuration cannot grant a server's missing access permission, and a different client execution context is not evidence that the intended integration is authorized. Diagnose the supported application path rather than treating every unsuccessful response as an extraction obstacle.

For an owned fixture, exercise the acceptance decisions with distinct inputs: an HTTP error, a body in an unexpected format, an unmatched variant, and a source-limited result. The expected outcomes follow the table rather than a claim about a live shop. An HTTP failure stays a failure; a format mismatch does not become a missing price; an unmatched option is noncomparable; incomplete coverage remains incomplete. Retain the prior accepted record separately from the failed refresh so a collection incident cannot silently become a false stock or price event.

Use rendering for presentation evidence

A browser is useful when the approved question concerns what an interface actually displays: selected options, localized text, formatting or the result of a permitted interaction. The Storefront reference documents a data API, not the behavior of every merchant's frontend. Do not assume that retrieving a product object proves which option a theme selected or how it formatted an amount. Conversely, visible text is an observation of a particular interface state rather than the complete supported API object.

BotBrowser's getting-started documentation covers profile-backed browser setup, automation connections, proxy-aware contexts, verification and cleanup. Those capabilities let an authorized harness declare and inspect its browser inputs. They do not authenticate an Admin API app, produce Shopify credentials or supply a merchant's catalog. Record intended configuration separately from evidence that the profile actually loaded and the page reached the expected state. A configuration file describes intent; the observation must establish the result required by the harness.

For a permitted presentation fixture, keep the observed product selection, page state and relevant browser configuration attached to the captured value. Compare displayed wording or formatting only against a question that the fixture can answer. A screenshot can demonstrate what was visible in that fixture, but it cannot prove a merchant's global stock or every customer's price. Minimal retained evidence should explain the selected field without exposing reusable account state. Where a field cannot be attributed to the intended product option, stop before promoting the text into an accepted comparison.

The Ajax Product reference provides a concrete reason to keep source semantics: its currency context belongs to the customer-facing response. Browser preferences may influence presentation, but they do not independently establish that context. If a comparison intentionally changes presentation inputs, state which input changed and preserve the observed commercial context separately. Do not relabel a different currency or selected option as a price movement. That distinction remains necessary even when every page in the browser run loaded without an error.

No live Shopify shop collection or access experiment is implied by these source-selection rules. The documented APIs establish their published scope; an authorized runtime observation would establish only its own result and context. A local rendering check of a saved fixture can verify layout and parser handling, while leaving real-shop availability, access and product correctness untested. Keep those acceptance claims separate so a successful local fixture does not become a promise about external storefront behavior.

Choose the smallest documented source

Start with a concrete question and an approved source contract. For requested commerce fields, assess the relevant Storefront operation and its supported access model. For a Shopify-hosted theme's documented product JSON, assess the Ajax Product contract and its limits. For visible presentation, use an authorized browser observation of the relevant state. This is a decision about the evidence needed, not a rule that every task must progressively escalate from API to browser when data is unavailable.

Before implementing the collector, write down why the selected source can satisfy the required product, variant, currency and completeness conditions. If it cannot, identify the missing evidence instead of filling it from a different surface without a matching rule. A change of source should be a reviewed schema decision because fields with similar names can have different contexts. The shared price pipeline can then accept a comparable observation or retain an explicit limitation, without hiding source changes behind one apparently stable amount.

Access policy is independent of technical readability. RFC 9309 explicitly states that robots rules are not access authorization. A readable product page, a tokenless API feature or a crawler allowance does not establish the full permitted use for a separate application. Confirm the actual integration and collection scope. When the required access or data is unavailable, return that limitation to the application rather than changing client identity, account or route to continue.

The selection result should name one supported surface, the field evidence expected from it and the conditions for accepting the observation. It should also state what remains unknown: omitted variants, unresolved currency, an unverified customer context or an access refusal. That result is useful even when no fresh product value is published. It prevents a renderer, parser or browser setting from being asked to solve an authorization or source-completeness problem that its contract cannot answer.

FAQ

Does the Storefront API always need an access token?

No. Its current documentation lists a tokenless subset and separate token-based features. Check the requested operation and fields rather than assuming either unrestricted access or a universal token requirement.

Is Ajax available to every custom Shopify frontend?

No. Shopify documents Ajax for its hosted themes and explicitly excludes custom storefronts. Establish the architecture before relying on that interface.

Does a successful product response prove all variants were collected?

No. The Product reference documents a variant limit. Completeness depends on the source's scope and the application's required coverage, not HTTP success alone.

Can browser language establish the currency of a product amount?

No. Currency needs evidence from the selected source context. Browser preferences describe configuration and cannot replace that commercial meaning.

Sources

Practical conclusion

Choose Shopify Storefront GraphQL for supported commerce-data questions, hosted-theme Ajax for its documented JSON operations, and a browser for authorized presentation evidence. Preserve the selected access model, product and variant context, currency meaning and completeness limits. BotBrowser supplies browser inputs; the chosen source must supply the product facts and applicable access contract. Accept a comparable observation or return the specific missing evidence before publishing a price or availability change.

#Web Scraping#Browser Automation#Privacy

This article is part of the guide: Browser Deployment and Release: Operations Map

Run the same check in BotBrowser

Load a profile, keep the signals you just read about consistent inside the browser, and confirm the result on your own machine before a rollout.