Extract product data from schema.org/Product markup on a product detail page

domain: agentic-commerce · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Fetch the product detail page HTML and extract all <script type='application/ld+json'> blocks; parse each block as JSON and filter for objects whose '@type' equals 'Product' or contains 'Product' in an array.
  2. Pull canonical fields: name, description, sku, brand.name, offers (price, priceCurrency, availability, url), aggregateRating (ratingValue, reviewCount), and image.
  3. Fall back to Microdata extraction (itemtype='https://schema.org/Product') if JSON-LD is absent; walk itemprop attributes to reconstruct the same field set.
  4. Normalize the offers field: it may be a single Offer object or an array of Offer objects representing variants; iterate all and pick the lowest or most relevant price for your use case.
  5. Map schema.org availability URIs (e.g., 'https://schema.org/InStock', 'https://schema.org/OutOfStock') to your internal enum so downstream logic is decoupled from raw URI strings.
  6. Cache the extracted structured data with a TTL derived from the page's Cache-Control header to avoid re-fetching on every agent loop iteration.

Known gotchas

Related routes

Extract structured product data from a product detail page (PDP) without an official API
agentic-commerce · 6 steps · unrated
Build agent-readable product feeds using schema.org/Product markup and MCP catalog endpoints so AI agents can discover, compare, and purchase products without scraping
schema.org/Product · 6 steps · unrated
Programmatically validate Schema.org structured data markup for Product and Article types
developers.google.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans