← All guides

What Should a Product API for Shopping Agents Return?

Published November 14, 2026 · Reviewed November 14, 2026 · Ingenious AI team

The short answer: Return the product record your other layers already publish: a stable id, title, price with its currency, explicit availability, the canonical url, and an image — per item, in list and single-item endpoints, with pagination that lets an agent walk the whole catalogue deterministically. Consistency is the trust property: the API, the feed, and the page's JSON-LD must tell one story, generated from one source. AXO's endpoint hints include /api/products because agents look there first. Document the shape on your developers page and let the audit confirm agents can discover it.

Audit my store — free

What is a product API?

A product API is an HTTP endpoint (conventionally under /api/products) that returns a store's catalogue data as structured responses — typically JSON — for programs to consume: list views with pagination and single-item views by id or sku. It is the queryable form of the same product truth a feed publishes in bulk and JSON-LD publishes per page.

The record shape: mirror your other layers

Fields per item: id (stable, shared with your feed), title, price, currency, availability, url, image — the feed's core seven — plus the enrichments your catalogue genuinely supports: brand, category, sku, variant references. The mirroring is deliberate. Agents reconcile stores across layers; a product whose API price disagrees with its page offers price triggers the same distrust as any cross-layer mismatch, and the reconciliation cost lands on your store's reputation, not on the agent's code.

Generate all three layers from the one product service inside your stack. If the API is served by your platform, check its field mapping once against your feed and a page's JSON-LD and note discrepancies in your runbook — platform APIs occasionally expose a pre-discount price where pages show the selling price, and knowing your stack's quirk beats discovering it via an agent's mismatch report.

List semantics: pagination an agent can walk

Catalogue lists need deterministic pagination: a stable sort order (by id is fine), explicit page or cursor parameters, and a total count or a reliable next link. An agent enumerating 2,000 products across 40 pages must be able to prove it saw all of them exactly once; offset pagination over a catalogue being edited mid-walk fails that proof, which is why cursor-based paging over stable ids is the professional choice at scale.

Filtering deserves the same determinism: category, availability, and price-range filters with documented parameters turn your API from a dump into a query tool — the difference between an agent that can answer 'in-stock waterproof boots under $150' from your API and one that must download everything and filter locally. Document every parameter in the openapi.json; undocumented filters are undiscovered filters.

Availability and price freshness

An API response is a statement made now, so its availability and price carry a stronger freshness expectation than a nightly feed's. Serve them from the live product service, cache briefly if you must (and publish the cache behaviour honestly in your docs if it exceeds minutes), and never let the API become the stalest layer — agents will weight it as the freshest and be burned accordingly.

Error honesty completes the freshness contract: a discontinued product returns a clear 404 or a tombstone stating its status, not a 200 with nulls; a price that cannot be determined returns an error, not a zero. Agents handle explicit failure gracefully — they route around it. They handle confident nonsense by learning to distrust the source.

Identity, variants, and reconciliation keys

Every item should carry the keys other systems reconcile by: your internal id, the sku, and the canonical url. Variants should be addressable — either as their own items with a parent reference or as structured variant objects — with per-variant price and availability, mirroring the ProductGroup discipline in your markup. An agent that can name the exact variant can transact on it; one that receives only the parent must go back to the page and start interpreting again.

Keep the id stable across everything: same id in feed, API, and (where emitted) markup identifiers. Stability is what turns three layers into one dataset viewed three ways — and one dataset is what an agent can build reliable behaviour on. The feed discipline in the sync guide applies to the API unchanged: one source, known freshness, loud failures.

Auth, limits, and politeness

Read-only product data that mirrors public pages can usually be public, with rate limits to keep enumeration cheap and abuse bounded. Publish the limits in your docs and honour them in headers so agents can pace themselves — an agent throttled without information retries badly; an agent told '600 requests/minute, here is the remaining count' behaves like a good citizen because it can.

If your platform requires keys for the storefront API, document the self-serve route to a read-only key for agent integrators, and keep the bar proportionate: the data is public on your pages, so the key is a metering device, not a moat. Friction beyond metering selects for exactly the scrapers you least want, who ignore keys entirely.

Documenting and discovering

The API exists, for agent purposes, when it is discoverable: linked from the developers page (itself linked from the storefront footer), described in openapi.json, and consistent with the paths AXO scans for (/api/products is the conventional root — use it or document the redirect). A beautiful API at an unguessable path under a name only your team uses scores like the cookware store's did before its docs page: as if it were not there.

Close the loop with the audit: paste the developers or homepage surface that references the API into the free audit and confirm the endpoints dimension registers the references. Then spot-check one agent-style flow by hand: list page one, fetch one item, compare its price and availability against the product page. Three requests, total confidence in the layer.

The 5-action product API standard

  1. Mirror the core seven fields — id, title, price, currency, availability, url, image — identical to feed and JSON-LD, from one source.
  2. Paginate deterministically: stable sort, cursors or pages with totals, documented filters for category, availability, price.
  3. Serve fresh facts: live price and stock, explicit errors instead of nulls and zeros, tombstones for discontinued items.
  4. Address variants and keys: per-variant price/availability, stable ids and skus shared across every layer.
  5. Publish and link the docs: developers page, openapi.json, conventional /api/products path — then audit for discoverability.

Worked example: the API that disagreed with its own store

Example — fictional, for illustration. A sports store documents its platform's product API and celebrates — until an integrator reports that the API quotes a jacket at $180 while the product page and checkout say $144 (a standing 20% promotion). The platform API exposes the list price; promotions live in a separate pricing layer the API does not apply. Agents reconciling the layers do the arithmetic of distrust: one of the store's voices is wrong about money, so all of them require verification.

The store's fix is documentation plus a thin normalisation: its developers page states the promotion rule plainly, and a small proxy endpoint republishes the API with selling prices applied, matching feed and pages. Unglamorous work — but the incident teaches the guide's core lesson in one move: an API's value is not its existence or even its uptime. It is its agreement with everything else you publish. Agents do not need more data from you. They need one consistent dataset they can stop second-guessing.

Related guides and the standing invitation

Companion reading for this topic: What Agent-Facing Endpoints Does a Store Need? · Why Publish openapi.json for Agent Discovery? · What Is a Machine-Readable Product Feed? · Why Do Transactional Agents Need a Cart API?.

Whatever this guide led you to change, prove it the way every guide in this series ends: re-run the free audit on the same page and compare the dimension it names, read how the audit works if a finding is unclear, and see plans if you want the full guidance report and re-audit history while you work. A change you have not re-measured is a hope, not a fix.

Run the free audit · All guides

Sources

Frequently asked questions

What fields should a product API return?

The core seven shared with your feed and JSON-LD: stable id, title, price, currency, availability, canonical url, and image — plus brand, category, sku, and variant structure where your catalogue supports them. Consistency across layers matters more than extra fields.

Why must API, feed, and page markup agree?

Because agents reconcile across layers. A price disagreement between your API and your page's offers block marks your data as unreliable generally, not just at the point of mismatch. Generate all layers from one product source.

What pagination do agents need?

Deterministic pagination: a stable sort order, page or cursor parameters, and a total or next link that lets the agent prove it enumerated the whole catalogue exactly once. Cursor paging over stable ids is the robust choice at scale.

Should the product API require an API key?

For public read-only catalogue data, keep friction proportionate: the same facts are visible on your pages. If keys are required by your platform, document a self-serve read-only route and publish rate limits so agents can pace themselves.

How fresh must API availability be?

Fresher than your feed, because agents weight API responses as current statements. Serve from the live product service, cache only briefly, and return explicit errors or tombstones rather than stale or null facts.

← Back