74trust / 100

Label Compile

by Product-Label Artwork Compiler in Documents & files

x402 APIPassing, checked 2 h ago

Compile a structured product-label spec (dimensions, EU FIC or US FDA ruleset, ingredients/allergens, nutrition, GS1 barcode, brand style) into a deterministic print-ready PDF with trim/bleed/safe boxes and embedded fonts, an SVG proof, a dieline, and a report auditing x-height legibility, allergen emphasis, nutrition order, and barcode check digits/quiet zones. Not a legal review of packaging compliance.

POST
https://label.api.williamrobinson.dev/v1/label/compile
Price
$0.15
per call in USDC
Uptime
95.7%
last 30 days
Response time
771 ms
876 ms slowest 5%
Last check
Passed
2 h ago, next any minute now

Run a free test callHow to call it

Reliability

All checks passedSome failedAll failedNot checked

Status and outage history · Atom feed

How to call it

POST https://label.api.williamrobinson.dev/v1/label/compile

Each call costs $0.15 in USDC on Base, paid with the request over x402.

Run a free test callOne unpaid request, the way an agent sends it. You see the payment challenge it gets back. Nothing is charged.

Example request

From the listing.

POST https://label.api.williamrobinson.dev/v1/label/compile
content-type: application/json

{
  "barcode": {
    "data": "5901234123457",
    "humanReadable": true,
    "symbology": "ean13"
  },
  "format": {
    "bleedMm": 2,
    "cornerRadiusMm": 3,
    "heightMm": 60,
    "safeMm": 2,
    "widthMm": 100
  },
  "ingredients": [
    {
      "allergen": true,
      "text": "Wheat flour"
    },
    {
      "allergen": false,
      "text": "Sunflower oil"
    },
    {
      "allergen": false,
      "text": "Sourdough culture"
    },
    {
      "allergen": false,
      "text": "Sea salt"
    },
    {
      "allergen": true,
      "text": "Sesame seeds"
    }
  ],
  "nutrition": {
    "basis": "100g",
    "carbohydrateG": 68.5,
    "energyKcal": 442,
    "energyKj": 1850,
    "fatG": 14.2,
    "fibreG": 3.4,
    "proteinG": 10.6,
    "saltG": 1.2,
    "saturatesG": 1.8,
    "sugarsG": 2.1
  },
  "product": {
    "brand": "Stonebake",
    "business": {
      "address": "14 Mill Lane, Bristol BS1 4ST, United Kingdom",
      "name": "Stonebake Bakery Ltd"
    },
    "dateLine": "Best before: see lid",
    "description": "Crisp sourdough crackers baked with stone-milled wheat flour.",
    "name": "Stonebake Sourdough Crackers",
    "netQuantity": {
      "unit": "g",
      "value": 150
    },
    "origin": "Baked in Italy",
    "storage": "Store in a cool, dry place. Reseal after opening."
  },
  "ruleset": "eu-fic",
  "style": {
    "accent": {
      "rgb": "#8a3b12"
    },
    "background": {
      "rgb": "#ffffff"
    },
    "fontFamily": "liberation-sans",
    "text": {
      "rgb": "#000000"
    }
  },
  "warnings": [
    "May contain traces of milk."
  ]
}

Parameters

ParameterTypeRequiredDescription
barcodeobjectNo
formatobjectYes
ingredientsarray of objectNo
nutritionobjectNo
productobjectYes
rulesetstringYeseu-fic = EU Reg. 1169/2011 mandatory-particulars/x-height/allergen-emphasis/nutrition-order checks; us-fda = 21 CFR 101 PDP/type-size/FALCPA "Contains:"/Nutrition-Facts-order checks; generic = advisory x-height only, no mandatory-particulars checks. One of: eu-fic, us-fda, generic.
styleobjectNo
warningsarray of stringNo Default: [].

Example response

The provider's example. We can't check it without paying. Shortened for display.

Example response, 301 lines
{
  "allergens": {
    "detectedUnmarked": [],
    "marked": [
      "Wheat flour",
      "Sesame seeds"
    ]
  },
  "artifacts": [
    {
      "href": "https://label.api.williamrobinson.dev/v1/label/artifacts/0123456789abcdef0123456789abcdef0123456789abcdef/label.pdf",
      "mediaType": "application/pdf",
      "name": "label.pdf",
      "sha256": "20361c4fe6d39dfdc1c9dc7af8b44ef2022c178a6934170fda56863dbc642d45",
      "sizeBytes": 23309
    },
    {
      "href": "https://label.api.williamrobinson.dev/v1/label/artifacts/0123456789abcdef0123456789abcdef0123456789abcdef/label.svg",
      "mediaType": "image/svg+xml",
      "name": "label.svg",
      "sha256": "b664f2085d9bbb0da3438681f726fd2e168cf9bc29fb8e4d5848890fdfdc5eaa",
      "sizeBytes": 5472
    },
    {
      "href": "https://label.api.williamrobinson.dev/v1/label/artifacts/0123456789abcdef0123456789abcdef0123456789abcdef/proof.png",
      "mediaType": "image/png",
      "name": "proof.png",
      "sha256": "18debfc496d9ea19cb5b0455faf7524c88884b28d161f4b33396640c1ba17e0b",
      "sizeBytes": 154380
    },
    {
      "href": "https://label.api.williamrobinson.dev/v1/label/artifacts/0123456789abcdef0123456789abcdef0123456789abcdef/dieline.svg",
      "mediaType": "image/svg+xml",
      "name": "dieline.svg",
      "sha256": "d36b7424a763ec866f7f71eabbf6205e0949794ba8bc6a14fb3bc1e15a7ef44c",
      "sizeBytes": 609
    },
    {
      "href": "https://label.api.williamrobinson.dev/v1/label/artifacts/0123456789abcdef0123456789abcdef0123456789abcdef/report.json",
      "mediaType": "application/json",
      "name": "report.json",
      "sha256": "7c1f3db881e8538063b3925a7c5066db13f26aa0c77a06dfff5c1eaf421d7ebc",
      "sizeBytes": 8226
    }
  ],
  "barcode": {
    "checkDigitValid": true,
    "data": "5901234123457",
    "heightMm": 22.400000000000002,
    "magnification": 0.8753016894609815,
    "moduleMm": 0.28884955752212393,
    "quietZoneLeftMm": 3.1773451327433633,
    "quietZoneRightMm": 2.0219469026548675,
    "symbology": "ean13",
    "truncated": true,
    "widthMm": 32.64
  },
  "checks": [
    {
      "code": "RULESET_SUPPORTED",
      "detail": "\"eu-fic\" is a supported ruleset",
      "status": "passed"
    },
    {
      "code": "MANDATORY_BLOCKS",
      "detail": "Every mandatory particular for \"eu-fic\" is present: product name, net quantity, business name/address, date line",
      "status": "passed"
    },
    {
      "code": "ALLERGEN_EMPHASIS",
      "detail": "Every allergen keyword match in the ingredient list is marked allergen: true",
      "status": "passed"
    },
    {
      "code": "NUTRITION_ORDER",
      "detail": "Nutrition rendered in the eu-fic declaration order: energy, fat, saturates, carbohydrate, sugars, fibre, protein, salt",
      "status": "passed"
    },
    {
      "code": "LOGO_VALID",
      "detail": "No logo was supplied",
      "status": "not_checked"
    },
    {
      "code": "TEXT_FITS",
      "detail": "All mandatory text fits within the safe area at or above the legal minimum text size, with no line wider than its column",
      "status": "passed"
    },
    {
      "code": "MIN_X_HEIGHT",
      "detail": "Every mandatory text box meets or exceeds its 0.9 mm x-height floor",
      "status": "passed"
    },
    {
      "code": "SAFE_ZONE",
      "detail": "Every drawn element, including ink extents and the barcode column, stays within the 2 mm safe zone",
      "status": "passed"
    },
    {
      "code": "NUTRITION_FORMAT",
      "detail": "Nutrition declared in tabular format with the values aligned (FIC Art. 34(2))",
      "status": "passed"
    },
    {
      "code": "NET_QUANTITY_PLACEMENT",
      "detail": "Only enforced under us-fda (21 CFR 101.105(f))",
      "status": "not_checked"
    },
    {
      "code": "BARCODE_VALID",
      "detail": "Check digit valid for \"5901234123457\"",
      "status": "passed"
    },
    {
      "code": "BARCODE_MAGNIFICATION",
      "detail": "Magnification 0.88x",
      "status": "passed"
    },
    {
      "code": "BARCODE_QUIET_ZONE",
      "detail": "Quiet zones drawn: 3.18 mm left, 2.02 mm right",
      "status": "passed"
    },
    {
      "code": "QR_MODULE_SIZE",
      "detail": "Only applies to 2D symbologies",
      "status": "not_checked"
    },
    {
      "code": "CONTRAST",
      "detail": "Contrast ratio 7.73:1 meets the 4.5:1 target",
      "status": "passed"
    },
    {
      "code": "GLYPH_COVERAGE",
      "detail": "Every character is covered by liberation-sans",
      "status": "passed"
    },
    {
      "code": "FONTS_EMBEDDED",
      "detail": "2 embedded TrueType font program(s) found (regular + bold)",
      "status": "passed"
    },
    {
      "code": "PDF_BOXES",
      "detail": "TrimBox and BleedBox are present in the generated PDF",
      "status": "passed"
    }
  ],
  "contrast": {
    "accentOnBackground": 7.73487762982462,
    "textOnBackground": 21
  },
  "expiresAt": "2026-09-13T17:27:50.368Z",
  "fonts": {
    "bold": "LiberationSans-Bold.ttf",
    "family": "liberation-sans",
    "regular": "LiberationSans-Regular.ttf"
  },
  "format": {
    "areaCm2": 60,
    "bleedMm": 2,
    "cornerRadiusMm": 3,
    "heightMm": 60,
    "safeMm": 2,
    "smallPack": true,
    "widthMm": 100
  },
  "layout": [
    {
      "block": "header.brand",
      "bold": true,
      "fontSizePt": 7.5,
      "heightMm": 2.955891927083333,
      "lines": 1,
      "widthMm": 96,
      "xHeightMm": 1.3978474934895833,
      "xMm": 4,
      "yMm": 4
    },
    {
      "block": "header.name",
      "bold": true,
      "fontSizePt": 12.5,
      "heightMm": 4.926486545138888,
      "lines": 1,
      "widthMm": 96,
      "xHeightMm": 2.329745822482639,
      "xMm": 4,
      "yMm": 7.255891927083333
    },
    {
      "block": "header.description",
      "bold": false,
      "fontSizePt": 6.5,
      "heightMm": 2.561773003472222,
      "lines": 1,
      "widthMm": 96,
      "xHeightMm": 1.211467827690972,
      "xMm": 4,
      "yMm": 12.482378472222223
    },
    {
      "block": "body.ingredients",
      "bold": false,
      "fontSizePt": 6.5,
      "heightMm": 4.969481336805556,
      "lines": 2,
      "widthMm": 59.56959149810366,
      "xHeightMm": 1.211467827690972,
      "xMm": 4,
      "yMm": 16.344151475694446
    },
    {
      "block": "body.nutrition",
      "bold": false,
      "fontSizePt": 6.5,
      "heightMm": 21.82343967013889,
      "lines": 9,
      "widthMm": 59.56959149810366,
      "xHeightMm": 1.211467827690972,
      "xMm": 4,
      "yMm": 21.613632812500004
    },
    {
      "block": "body.nutrition.values",
      "bold": false,
      "fontSizePt": 6.5,
      "heightMm": 21.82343967013889,
      "lines": 9,
      "widthMm": 59.56959149810366,
      "xHeightMm": 1.211467827690972,
      "xMm": 4,
      "yMm": 21.613632812500004
    },
    {
      "block": "footer.netQuantity",
      "bold": true,
      "fontSizePt": 5.5,
      "heightMm": 2.167654079861111,
      "lines": 1,
      "widthMm": 59.56959149810366,
      "xHeightMm": 1.025088161892361,
      "xMm": 4,
      "yMm": 44.737072482638894
    },
    {
      "block": "footer.storage",
      "bold": false,
      "fontSizePt": 5.5,
      "heightMm": 2.167654079861111,
      "lines": 1,
      "widthMm": 59.56959149810366,
      "xHeightMm": 1.025088161892361,
      "xMm": 4,
      "yMm": 47.2047265625
    },
    {
      "block": "footer.origin",
      "bold": false,
      "fontSizePt": 5.5,
      "heightMm": 2.167654079861111,
      "lines": 1,
      "widthMm": 59.56959149810366,
      "xHeightMm": 1.025088161892361,
      "xMm": 4,
      "yMm": 49.672380642361105
    },
    {
      "block": "footer.business",
      "bold": false,
      "fontSizePt": 5.5,
      "heightMm": 4.204945746527777,
      "lines": 2,
      "widthMm": 59.56959149810366,
      "xHeightMm": 1.025088161892361,
      "xMm": 4,
      "yMm": 52.14003472222221
    },
    {
      "block": "warnings.0",
      "bold": false,
      "fontSizePt": 5.5,
      "heightMm": 2.167654079861111,
      "lines": 1,
      "widthMm": 59.56959149810366,
      "xHeightMm": 1.025088161892361,
      "xMm": 4,
      "yMm": 56.644980468749985
    }
  ],
  "limitations": [
    "This is an automated heuristic compliance check, not a legal review; consult qualified counsel before printing regulated packaging.",
    "Allergen detection is a fixed keyword match against ingredient text, not a food-science parser; it can both miss and over-match unusual phrasing.",
    "x-height is measured from the embedded font's own OS/2.xHeight metric, which can differ from a caliper measurement of printed type.",
    "eu-fic's \"largest surface\" area test and us-fda's principal-display-panel area test both use the label's own trim area as a proxy; a real pack's largest surface may differ.",
    "CMYK colours are converted to sRGB with a naive (1-c)(1-k) formula for the SVG/PNG preview, with no ICC profile; the PDF's own CMYK fills are exact and unaffected.",
    "The generated PDF is not PDF/X-1a certified: it carries no OutputIntent or ICC profile.",
    "Layout uses fixed header/body/footer/barcode-zone templates; no freeform positioning.",
    "Only Latin-script text covered by the Liberation Sans/Serif glyph sets is supported; unsupported characters are reported by GLYPH_COVERAGE.",
…

Call it from code

The curl command shows the payment challenge. The JavaScript and Python versions pay and call, and never pay more than $0.15.

curl: see the payment challenge
# bash or zsh: see the payment challenge. Nothing is charged.
curl -sS -g -i -X POST 'https://label.api.williamrobinson.dev/v1/label/compile' \
  -H 'content-type: application/json' \
  --data-raw '{"barcode":{"data":"5901234123457","humanReadable":true,"symbology":"ean13"},"format":{"bleedMm":2,"cornerRadiusMm":3,"heightMm":60,"safeMm":2,"widthMm":100},"ingredients":[{"allergen":true,"text":"Wheat flour"},{"allergen":false,"text":"Sunflower oil"},{"allergen":false,"text":"Sourdough culture"},{"allergen":false,"text":"Sea salt"},{"allergen":true,"text":"Sesame seeds"}],"nutrition":{"basis":"100g","carbohydrateG":68.5,"energyKcal":442,"energyKj":1850,"fatG":14.2,"fibreG":3.4,"proteinG":10.6,"saltG":1.2,"saturatesG":1.8,"sugarsG":2.1},"product":{"brand":"Stonebake","business":{"address":"14 Mill Lane, Bristol BS1 4ST, United Kingdom","name":"Stonebake Bakery Ltd"},"dateLine":"Best before: see lid","description":"Crisp sourdough crackers baked with stone-milled wheat flour.","name":"Stonebake Sourdough Crackers","netQuantity":{"unit":"g","value":150},"origin":"Baked in Italy","storage":"Store in a cool, dry place. Reseal after opening."},"ruleset":"eu-fic","style":{"accent":{"rgb":"#8a3b12"},"background":{"rgb":"#ffffff"},"fontFamily":"liberation-sans","text":{"rgb":"#000000"}},"warnings":["May contain traces of milk."]}'

# x402 v2 sends the challenge base64-encoded in the PAYMENT-REQUIRED header (v1 sends it in the body).
# To read the header:
curl -sS -g -o /dev/null -D - -X POST 'https://label.api.williamrobinson.dev/v1/label/compile' \
  -H 'content-type: application/json' \
  --data-raw '{"barcode":{"data":"5901234123457","humanReadable":true,"symbology":"ean13"},"format":{"bleedMm":2,"cornerRadiusMm":3,"heightMm":60,"safeMm":2,"widthMm":100},"ingredients":[{"allergen":true,"text":"Wheat flour"},{"allergen":false,"text":"Sunflower oil"},{"allergen":false,"text":"Sourdough culture"},{"allergen":false,"text":"Sea salt"},{"allergen":true,"text":"Sesame seeds"}],"nutrition":{"basis":"100g","carbohydrateG":68.5,"energyKcal":442,"energyKj":1850,"fatG":14.2,"fibreG":3.4,"proteinG":10.6,"saltG":1.2,"saturatesG":1.8,"sugarsG":2.1},"product":{"brand":"Stonebake","business":{"address":"14 Mill Lane, Bristol BS1 4ST, United Kingdom","name":"Stonebake Bakery Ltd"},"dateLine":"Best before: see lid","description":"Crisp sourdough crackers baked with stone-milled wheat flour.","name":"Stonebake Sourdough Crackers","netQuantity":{"unit":"g","value":150},"origin":"Baked in Italy","storage":"Store in a cool, dry place. Reseal after opening."},"ruleset":"eu-fic","style":{"accent":{"rgb":"#8a3b12"},"background":{"rgb":"#ffffff"},"fontFamily":"liberation-sans","text":{"rgb":"#000000"}},"warnings":["May contain traces of milk."]}' \
  | grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 --decode
JavaScript: pay and call
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

// Pays at most $0.15 per call.
const client = new x402Client().setSpendControls({ maxAmountPerPayment: "$0.15" });
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? ToolVet checks it first for $0.005. Pay for that from a separate
// client: this one is capped at $0.15 per payment. GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Flabel.api.williamrobinson.dev%2Fv1%2Flabel%2Fcompile&method=POST
const res = await pay("https://label.api.williamrobinson.dev/v1/label/compile", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({
    "barcode": {
      "data": "5901234123457",
      "humanReadable": true,
      "symbology": "ean13"
    },
    "format": {
      "bleedMm": 2,
      "cornerRadiusMm": 3,
      "heightMm": 60,
      "safeMm": 2,
      "widthMm": 100
    },
    "ingredients": [
      {
        "allergen": true,
        "text": "Wheat flour"
      },
      {
        "allergen": false,
        "text": "Sunflower oil"
      },
      {
        "allergen": false,
        "text": "Sourdough culture"
      },
      {
        "allergen": false,
        "text": "Sea salt"
      },
      {
        "allergen": true,
        "text": "Sesame seeds"
      }
    ],
    "nutrition": {
      "basis": "100g",
      "carbohydrateG": 68.5,
      "energyKcal": 442,
      "energyKj": 1850,
      "fatG": 14.2,
      "fibreG": 3.4,
      "proteinG": 10.6,
      "saltG": 1.2,
      "saturatesG": 1.8,
      "sugarsG": 2.1
    },
    "product": {
      "brand": "Stonebake",
      "business": {
        "address": "14 Mill Lane, Bristol BS1 4ST, United Kingdom",
        "name": "Stonebake Bakery Ltd"
      },
      "dateLine": "Best before: see lid",
      "description": "Crisp sourdough crackers baked with stone-milled wheat flour.",
      "name": "Stonebake Sourdough Crackers",
      "netQuantity": {
        "unit": "g",
        "value": 150
      },
      "origin": "Baked in Italy",
      "storage": "Store in a cool, dry place. Reseal after opening."
    },
    "ruleset": "eu-fic",
    "style": {
      "accent": {
        "rgb": "#8a3b12"
      },
      "background": {
        "rgb": "#ffffff"
      },
      "fontFamily": "liberation-sans",
      "text": {
        "rgb": "#000000"
      }
    },
    "warnings": [
      "May contain traces of milk."
    ]
  }),
});
console.log(res.status, await res.text());
Python: pay and call
# pip install "x402[requests,evm]"
import os
from eth_account import Account
from x402 import x402ClientSync
from x402.http.clients import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client

# Pays at most $0.15 per call.
client = x402ClientSync().set_spend_controls({"max_amount_per_payment": "$0.15"})
register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"])))

with x402_requests(client) as session:
    res = session.post(
        "https://label.api.williamrobinson.dev/v1/label/compile",
        json={
            "barcode": {
                "data": "5901234123457",
                "humanReadable": True,
                "symbology": "ean13",
            },
            "format": {
                "bleedMm": 2,
                "cornerRadiusMm": 3,
                "heightMm": 60,
                "safeMm": 2,
                "widthMm": 100,
            },
            "ingredients": [
                {
                    "allergen": True,
                    "text": "Wheat flour",
                },
                {
                    "allergen": False,
                    "text": "Sunflower oil",
                },
                {
                    "allergen": False,
                    "text": "Sourdough culture",
                },
                {
                    "allergen": False,
                    "text": "Sea salt",
                },
                {
                    "allergen": True,
                    "text": "Sesame seeds",
                },
            ],
            "nutrition": {
                "basis": "100g",
                "carbohydrateG": 68.5,
                "energyKcal": 442,
                "energyKj": 1850,
                "fatG": 14.2,
                "fibreG": 3.4,
                "proteinG": 10.6,
                "saltG": 1.2,
                "saturatesG": 1.8,
                "sugarsG": 2.1,
            },
            "product": {
                "brand": "Stonebake",
                "business": {
                    "address": "14 Mill Lane, Bristol BS1 4ST, United Kingdom",
                    "name": "Stonebake Bakery Ltd",
                },
                "dateLine": "Best before: see lid",
                "description": "Crisp sourdough crackers baked with stone-milled wheat flour.",
                "name": "Stonebake Sourdough Crackers",
                "netQuantity": {
                    "unit": "g",
                    "value": 150,
                },
                "origin": "Baked in Italy",
                "storage": "Store in a cool, dry place. Reseal after opening.",
            },
            "ruleset": "eu-fic",
            "style": {
                "accent": {
                    "rgb": "#8a3b12",
                },
                "background": {
                    "rgb": "#ffffff",
                },
                "fontFamily": "liberation-sans",
                "text": {
                    "rgb": "#000000",
                },
            },
            "warnings": [
                "May contain traces of milk.",
            ],
        },
    )
    print(res.status_code, res.text)

Security scan

No findings

We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
2 h agoPassed402782 ms$0.15
6 h agoPassed402807 ms$0.15
10 h agoPassed402856 ms$0.15
14 h agoPassed402682 ms$0.15
18 h agoPassed402839 ms$0.15
Show 10 older checks
22 h agoPassed402771 ms$0.15
26 h agoPassed402705 ms$0.15
30 h agoPassed402740 ms$0.15
34 h agoPassed402876 ms$0.15
38 h agoPassed402759 ms$0.15
41 h agoPassed402915 ms$0.15
45 h agoPassed402768 ms$0.15
2 days agoPassed402738 ms$0.15
2 days agoPassed402825 ms$0.15
2 days agoPassed402782 ms$0.15