commerce $0.0003 / call
GTIN Validate
Validate GTIN-8, UPC/GTIN-12, EAN/GTIN-13 and GTIN-14 check digits; no product lookup.
commerce.gtin-validatecommerce.offer-extract · v1.0.0
Extract bounded Product offers from supplied JSON-LD HTML with source pointers, missing-price warnings and separate aggregate ranges.
{
"html": "<script type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"Product\",\"name\":\"Coffee beans, 500 g\",\"sku\":\"BEANS-500\",\"offers\":{\"@type\":\"Offer\",\"price\":\"8.99\",\"priceCurrency\":\"USD\",\"availability\":\"https://schema.org/InStock\",\"url\":\"/beans\"}}</script>",
"baseUrl": "https://example.com/shop"
}{
"offers": [
{
"productName": "Coffee beans, 500 g",
"sku": "BEANS-500",
"gtin": null,
"offerType": "Offer",
"price": "8.99",
"currency": "USD",
"lowPrice": null,
"highPrice": null,
"url": "https://example.com/beans",
"availability": "https://schema.org/InStock",
"itemCondition": null,
"priceValidUntil": null,
"source": {
"productBlock": 0,
"productPointer": "",
"offerBlock": 0,
"offerPointer": "/offers"
},
"warnings": []
}
],
"productsFound": 1,
"productsWithoutOffers": 0,
"invalidBlocks": 0,
"unresolvedReferences": 0,
"unsupportedOffers": 0,
"truncated": false,
"scope": "Extracts declared Product offers from supplied JSON-LD, including simple @id references. No fetching, JavaScript rendering, JSON-LD context expansion or live price/stock verification. Aggregate ranges and conditional price specifications are not guessed as purchasable prices. Prices support at most six decimal places."
}Generated from the actual handler using this example input; this is a preview, not a paid API call. Paid responses wrap the result with a receipt and recovery expiry.
Add credits in the workspace and keep your API key in private environment storage. Use the same request ID and exact body to recover a lost response within ten minutes.
// Node.js 22+. Read the key from your private environment.
const requestId = Date.now() + '_' + crypto.randomUUID();
const response = await fetch('https://agent-utilities.agent-utilities.workers.dev/v1/tools/commerce.offer-extract', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + process.env.AGENT_UTILITIES_API_KEY,
'Idempotency-Key': requestId
},
body: JSON.stringify({
"html": "<script type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"Product\",\"name\":\"Coffee beans, 500 g\",\"sku\":\"BEANS-500\",\"offers\":{\"@type\":\"Offer\",\"price\":\"8.99\",\"priceCurrency\":\"USD\",\"availability\":\"https://schema.org/InStock\",\"url\":\"/beans\"}}</script>",
"baseUrl": "https://example.com/shop"
})
});
const data = await response.json();
if (!response.ok) throw new Error(data.error?.message ?? 'Request failed');
console.log(data);
// On response loss, retry this SAME requestId, tool and body.
// Do not rerun the line that generates requestId for a retry.{
"type": "object",
"properties": {
"html": {
"type": "string",
"maxLength": 100000
},
"baseUrl": {
"type": "string",
"maxLength": 2048
},
"maxOffers": {
"type": "integer",
"minimum": 1,
"maximum": 50
}
},
"required": [
"html"
],
"additionalProperties": false
}{
"type": "object",
"properties": {
"offers": {
"type": "array",
"items": {
"type": "object",
"properties": {
"productName": {
"type": [
"string",
"null"
]
},
"sku": {
"type": [
"string",
"null"
]
},
"gtin": {
"type": [
"string",
"null"
]
},
"offerType": {
"type": "string"
},
"price": {
"type": [
"string",
"null"
]
},
"currency": {
"type": [
"string",
"null"
]
},
"lowPrice": {
"type": [
"string",
"null"
]
},
"highPrice": {
"type": [
"string",
"null"
]
},
"url": {
"type": [
"string",
"null"
]
},
"availability": {
"type": [
"string",
"null"
]
},
"itemCondition": {
"type": [
"string",
"null"
]
},
"priceValidUntil": {
"type": [
"string",
"null"
]
},
"source": {
"type": "object",
"properties": {
"productBlock": {
"type": "number"
},
"productPointer": {
"type": "string"
},
"offerBlock": {
"type": "number"
},
"offerPointer": {
"type": "string"
}
},
"required": [
"productBlock",
"productPointer",
"offerBlock",
"offerPointer"
],
"additionalProperties": false
},
"warnings": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"productName",
"sku",
"gtin",
"offerType",
"price",
"currency",
"lowPrice",
"highPrice",
"url",
"availability",
"itemCondition",
"priceValidUntil",
"source",
"warnings"
],
"additionalProperties": false
}
},
"productsFound": {
"type": "number"
},
"productsWithoutOffers": {
"type": "number"
},
"invalidBlocks": {
"type": "number"
},
"unresolvedReferences": {
"type": "number"
},
"unsupportedOffers": {
"type": "number"
},
"truncated": {
"type": "boolean"
},
"scope": {
"type": "string"
}
},
"required": [
"offers",
"productsFound",
"productsWithoutOffers",
"invalidBlocks",
"unresolvedReferences",
"unsupportedOffers",
"truncated",
"scope"
],
"additionalProperties": false
}Prices are experimental. The service currently allows 1,000 new calls per day across all accounts. Failed operations return reserved credits. Successful results are encrypted for ten-minute retry recovery. Review data handling and service limits.
commerce $0.0003 / call
Validate GTIN-8, UPC/GTIN-12, EAN/GTIN-13 and GTIN-14 check digits; no product lookup.
commerce.gtin-validatecommerce $0.0005 / call
Compare requested product attributes with an offered variant and list missing or mismatched fields.
commerce.variant-comparecommerce $0.0008 / call
Choose the lowest-cost whole-pack combination for a required count with exact prices and explicit pack limits; up to 20 interchangeable offers.
commerce.pack-plan