{"slug":"label-api-williamrobinson-dev-v1-label-compile-a31112","title":"Compile a structured product-label spec (dimensions, EU FIC or US FDA ruleset, i","host":"label.api.williamrobinson.dev","method":"POST","resource":"https://label.api.williamrobinson.dev/v1/label/compile","category":"code","description":"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 ","price_listed":0.15,"price_asked":0.15,"state":"answering","state_label":"Answering","checks_7d":1,"answered_7d":1,"latency_ms_median":602,"reported_calls_30d":1,"reported_payers_30d":1,"networks":["eip155:8453"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"body":{"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."]},"bodyType":"json","method":"POST","type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"body":{"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"barcode":{"additionalProperties":false,"properties":{"data":{"description":"Exactly 13 digits (with GS1 check digit) for ean13, exactly 12 for upca; any UTF-8 text up to 512 bytes for qrcode/datamatrix.","maxLength":512,"minLength":1,"type":"string"},"humanReadable":{"default":true,"description":"Draw the human-readable digits (1D only).","type":"boolean"},"symbology":{"enum":["ean13","upca","qrcode","datamatrix"],"type":"string"},"widthMm":{"description":"Requested symbol width incl. quiet zones; omitted = GS1 nominal / 20 mm for 2D.","maximum":300,"minimum":5,"type":"number"}},"required":["symbology","data"],"type":"object"},"format":{"additionalProperties":false,"properties":{"bleedMm":{"default":2,"maximum":5,"minimum":0,"type":"number"},"cornerRadiusMm":{"default":0,"description":"Must not exceed min(widthMm, heightMm) / 2; validated against the format's own dimensions.","minimum":0,"type":"number"},"heightMm":{"description":"Trim height, millimetres.","maximum":400,"minimum":20,"type":"number"},"safeMm":{"default":2,"description":"Inside the trim; mandatory text never enters it.","maximum":10,"minimum":0,"type":"number"},"widthMm":{"description":"Trim width, millimetres.","maximum":400,"minimum":20,"type":"number"}},"required":["widthMm","heightMm"],"type":"object"},"ingredients":{"items":{"additionalProperties":false,"properties":{"allergen":{"description":"Emphasised in the ingredient list and fed into the allergen-statement/scan checks.","type":"boolean"},"text":{"maxLength":120,"minLength":1,"type":"string"}},"required":["text","allergen"],"type":"object"},"maxItems":200,"type":"array"},"nutrition":{"additionalProperties":false,"properties":{"addedSugarsG":{"maximum":100000,"minimum":0,"type":"number"},"basis":{"enum":["100g","100ml","serving"],"type":"string"},"carbohydrateG":{"maximum":100000,"minimum":0,"type":"number"},"cholesterolMg":{"maximum":100000,"minimum":0,"type":"number"},"energyKcal":{"maximum":100000,"minimum":0,"type":"number"},"energyKj":{"maximum":100000,"minimum":0,"type":"number"},"fatG":{"maximum":100000,"minimum":0,"type":"number"},"fibreG":{"maximum":100000,"minimum":0,"type":"number"},"proteinG":{"maximum":100000,"minimum":0,"type":"number"},"saltG":{"maximum":100000,"minimum":0,"type":"number"},"saturatesG":{"maximum":100000,"minimum":0,"type":"number"},"servingSize":{"maxLength":40,"minLength":1,"type":"string"},"sodiumMg":{"maximum":100000,"minimum":0,"type":"number"},"sugarsG":{"maximum":100000,"minimum":0,"type":"number"},"transFatG":{"maximum":100000,"minimum":0,"type":"number"}},"required":["basis"],"type":"object"},"product":{"additionalProperties":false,"properties":{"brand":{"maxLength":120,"minLength":1,"type":"string"},"business":{"additionalProperties":false,"properties":{"address":{"maxLength":300,"minLength":1,"type":"string"},"name":{"maxLength":120,"minLength":1,"type":"string"}},"required":["name","address"],"type":"object"},"dateLine":{"description":"Rendered verbatim, e.g. \"Best before: see base\".","maxLength":80,"minLength":1,"type":"string"},"description":{"maxLength":400,"minLength":1,"type":"string"},"name":{"maxLength":120,"minLength":1,"type":"string"},"netQuantity":{"additionalProperties":false,"properties":{"unit":{"enum":["g","kg","ml","l","oz","fl oz","lb","pcs"],"type":"string"},"value":{"exclusiveMinimum":0,"maximum":100000,"type":"number"}},"required":["value","unit"],"type":"object"},"origin":{"maxLength":80,"minLength":1,"type":"string"},"storage":{"maxLength":200,"minLength":1,"type":"string"}},"required":["name"],"type":"object"},"ruleset":{"description":"eu-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.","enum":["eu-fic","us-fda","generic"],"type":"string"},"style":{"additionalProperties":false,"properties":{"accent":{"default":{"rgb":"#000000"},"oneOf":[{"additionalProperties":false,"properties":{"rgb":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"}},"required":["rgb"],"type":"object"},{"additionalProperties":false,"properties":{"cmyk":{"items":{"maximum":100,"minimum":0,"type":"number"},"maxItems":4,"minItems":4,"type":"array"}},"required":["cmyk"],"type":"object"}]},"background":{"default":{"rgb":"#ffffff"},"oneOf":[{"additionalProperties":false,"properties":{"rgb":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"}},"required":["rgb"],"type":"object"},{"additionalProperties":false,"properties":{"cmyk":{"items":{"maximum":100,"minimum":0,"type":"number"},"maxItems":4,"minItems":4,"type":"array"}},"required":["cmyk"],"type":"object"}]},"fontFamily":{"default":"liberation-sans","enum":["liberation-sans","liberation-serif"],"type":"string"},"logoHeightMm":{"default":10,"maximum":50,"minimum":3,"type":"number"},"logoPngBase64":{"contentEncoding":"base64","description":"PNG, base64, at most 256 KiB decoded, at most 2000 px per side; checked for a valid PNG signature and re-encoded before embedding.","type":"string"},"text":{"default":{"rgb":"#000000"},"oneOf":[{"additionalProperties":false,"properties":{"rgb":{"pattern":"^#[0-9a-fA-F]{6}$","type":"string"}},"required":["rgb"],"type":"object"},{"additionalProperties":false,"properties":{"cmyk":{"items":{"maximum":100,"minimum":0,"type":"number"},"maxItems":4,"minItems":4,"type":"array"}},"required":["cmyk"],"type":"object"}]}},"type":"object"},"warnings":{"default":[],"items":{"maxLength":200,"minLength":1,"type":"string"},"maxItems":20,"type":"array"}},"required":["format","ruleset","product"],"type":"object"},"bodyType":{"enum":["json","form-data","text"],"type":"string"},"method":{"enum":["POST"],"type":"string"},"type":{"const":"http","type":"string"}},"required":["type","method","bodyType","body"],"type":"object"},"output":{"properties":{"example":{"$defs":{"check":{"additionalProperties":false,"properties":{"code":{"type":"string"},"detail":{"maxLength":4096,"type":"string"},"status":{"enum":["passed","failed","not_checked"],"type":"string"}},"required":["code","status","detail"],"type":"object"},"textBox":{"additionalProperties":false,"properties":{"block":{"type":"string"},"bold":{"type":"boolean"},"fontSizePt":{"exclusiveMinimum":0,"type":"number"},"heightMm":{"minimum":0,"type":"number"},"lines":{"minimum":0,"type":"integer"},"widthMm":{"minimum":0,"type":"number"},"xHeightMm":{"minimum":0,"type":"number"},"xMm":{"type":"number"},"yMm":{"type":"number"}},"required":["block","xMm","yMm","widthMm","heightMm","fontSizePt","xHeightMm","lines","bold"],"type":"object"}},"$schema":"https://json-schema.org/draft/2020-12/schema","additionalProperties":false,"properties":{"allergens":{"additionalProperties":false,"properties":{"detectedUnmarked":{"items":{"additionalProperties":false,"properties":{"ingredient":{"type":"string"},"term":{"type":"string"}},"required":["ingredient","term"],"type":"object"},"type":"array"},"marked":{"items":{"type":"string"},"type":"array"}},"required":["marked","detectedUnmarked"],"type":"object"},"artifacts":{"items":{"additionalProperties":false,"properties":{"href":{"format":"uri","type":"string"},"mediaType":{"maxLength":128,"minLength":1,"type":"string"},"name":{"enum":["label.pdf","label.svg","proof.png","dieline.svg","report.json"],"type":"string"},"sha256":{"pattern":"^[a-f0-9]{64}$","type":"string"},"sizeBytes":{"minimum":0,"type":"integer"}},"required":["name","mediaType","sizeBytes","sha256","href"],"type":"object"},"maxItems":5,"type":"array"},"barcode":{"additionalProperties":false,"properties":{"checkDigitValid":{"type":["boolean","null"]},"data":{"type":"string"},"heightMm":{"minimum":0,"type":"number"},"magnification":{"type":["number","null"]},"moduleMm":{"minimum":0,"type":"number"},"quietZoneLeftMm":{"minimum":0,"type":"number"},"quietZoneRightMm":{"minimum":0,"type":"number"},"symbology":{"enum":["ean13","upca","qrcode","datamatrix"],"type":"string"},"truncated":{"type":"boolean"},"widthMm":{"minimum":0,"type":"number"}},"required":["symbology","data","checkDigitValid","moduleMm","magnification","widthMm","heightMm","quietZoneLeftMm","quietZoneRightMm","truncated"],"type":["object","null"]},"checks":{"items":{"$ref":"#/properties/output/properties/example/$defs/check"},"type":"array"},"contrast":{"additionalProperties":false,"properties":{"accentOnBackground":{"minimum":0,"type":"number"},"textOnBackground":{"minimum":0,"type":"number"}},"required":["textOnBackground","accentOnBackground"],"type":"object"},"expiresAt":{"format":"date-time","type":"string"},"fonts":{"additionalProperties":false,"properties":{"bold":{"type":"string"},"family":{"enum":["liberation-sans","liberation-serif"],"type":"string"},"regular":{"type":"string"}},"required":["family","regular","bold"],"type":"object"},"format":{"additionalProperties":false,"properties":{"areaCm2":{"minimum":0,"type":"number"},"bleedMm":{"type":"number"},"cornerRadiusMm":{"type":"number"},"heightMm":{"type":"number"},"safeMm":{"type":"number"},"smallPack":{"description":"Trim area below the ruleset's small-pack threshold (EU FIC Art. 13(3): 80 cm²).","type":"boolean"},"widthMm":{"type":"number"}},"required":["widthMm","heightMm","bleedMm","safeMm","cornerRadiusMm","areaCm2","smallPack"],"type":"object"},"layout":{"items":{"$ref":"#/properties/output/properties/example/$defs/textBox"},"type":"array"},"limitations":{"items":{"maxLength":4096,"type":"string"},"type":"array"},"minimumXHeightMm":{"minimum":0,"type":"number"},"ruleset":{"enum":["eu-fic","us-fda","generic"],"type":"string"},"status":{"enum":["passed","rejected"],"type":"string"},"timings":{"additionalProperties":false,"properties":{"layoutMs":{"minimum":0,"type":"number"},"renderMs":{"minimum":0,"type":"number"},"totalMs":{"minimum":0,"type":"number"}},"required":["layoutMs","renderMs","totalMs"],"type":"object"},"warnings":{"items":{"maxLength":4096,"type":"string"},"type":"array"}},"required":["status","ruleset","format","minimumXHeightMm","fonts","layout","barcode","allergens","contrast","checks","warnings","limitations","timings","expiresAt","artifacts"],"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[{"day":"2026-09-24","reachable":true,"status":402,"valid_402":true,"asked_usdc":0.15,"price_match":true,"latency_ms":602,"error":null}],"description_full":"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.","last_updated":"2026-09-11T20:08:19.463Z","schemes":["exact"]}