{"openapi":"3.1.0","info":{"title":"Lagomy Evidence API","description":"Sourced UK supplement evidence. Records, never advises.","version":"0.1.0"},"paths":{"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/evidence":{"post":{"summary":"Evidence","description":"Return stored evidence if we have it, otherwise run the crew.","operationId":"evidence_evidence_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvidenceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvidenceResponse"}}}},"404":{"description":"No precomputed evidence for this ingredient."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/product/{product_id}":{"get":{"summary":"Product","description":"Every ingredient in a product, with stored evidence where we have it.","operationId":"product_product__product_id__get","parameters":[{"name":"product_id","in":"path","required":true,"schema":{"type":"string","title":"Product Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductResponse"}}}},"404":{"description":"No product found with this id."},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/products":{"get":{"summary":"Products","description":"Every product in the dataset, for listing and selection.","operationId":"products_products_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ProductSummary"},"type":"array","title":"Response Products Products Get"}}}}}}}},"components":{"schemas":{"EvidenceRequest":{"properties":{"ingredient":{"type":"string","title":"Ingredient"},"probe":{"type":"string","title":"Probe","default":"What do published UK sources say about this ingredient?"}},"type":"object","required":["ingredient"],"title":"EvidenceRequest","description":"What a caller sends us."},"EvidenceResponse":{"properties":{"ingredient":{"type":"string","title":"Ingredient"},"evidence":{"$ref":"#/components/schemas/IngredientEvidence"},"prose":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Prose"},"guardrail_triggered":{"type":"boolean","title":"Guardrail Triggered","default":false}},"type":"object","required":["ingredient","evidence"],"title":"EvidenceResponse","description":"What we return. prose is None when the guardrail gate strips it."},"EvidenceStatement":{"properties":{"text":{"type":"string","title":"Text"},"source_url":{"type":"string","title":"Source Url"},"source_authority":{"type":"string","title":"Source Authority"},"retrieval_date":{"type":"string","format":"date","title":"Retrieval Date"}},"type":"object","required":["text","source_url","source_authority","retrieval_date"],"title":"EvidenceStatement","description":"One sourced claim. The provenance unit of the whole API."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"IngredientEvidence":{"properties":{"canonical_name":{"type":"string","title":"Canonical Name"},"role":{"items":{"$ref":"#/components/schemas/EvidenceStatement"},"type":"array","title":"Role","default":[]},"food_sources":{"items":{"$ref":"#/components/schemas/EvidenceStatement"},"type":"array","title":"Food Sources","default":[]},"reference_intake":{"items":{"$ref":"#/components/schemas/EvidenceStatement"},"type":"array","title":"Reference Intake","default":[]},"upper_limit":{"items":{"$ref":"#/components/schemas/EvidenceStatement"},"type":"array","title":"Upper Limit","default":[]},"regulatory_flags":{"items":{"$ref":"#/components/schemas/EvidenceStatement"},"type":"array","title":"Regulatory Flags","default":[]}},"type":"object","required":["canonical_name"],"title":"IngredientEvidence","description":"The structured record for one ingredient, field by field."},"ProductIngredientEvidence":{"properties":{"ingredient_id":{"type":"string","title":"Ingredient Id"},"ingredient_name":{"type":"string","title":"Ingredient Name"},"canonical_name":{"type":"string","title":"Canonical Name"},"amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Amount"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"basis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Basis"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"matched_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Matched Key"},"match_type":{"type":"string","title":"Match Type"},"evidence":{"anyOf":[{"$ref":"#/components/schemas/IngredientEvidence"},{"type":"null"}]}},"type":"object","required":["ingredient_id","ingredient_name","canonical_name","match_type"],"title":"ProductIngredientEvidence","description":"One ingredient in a product, with its dose and evidence if we have any."},"ProductResponse":{"properties":{"product_id":{"type":"string","title":"Product Id"},"ingredients":{"items":{"$ref":"#/components/schemas/ProductIngredientEvidence"},"type":"array","title":"Ingredients"},"matched_count":{"type":"integer","title":"Matched Count"},"unmatched_count":{"type":"integer","title":"Unmatched Count"}},"type":"object","required":["product_id","ingredients","matched_count","unmatched_count"],"title":"ProductResponse","description":"Every ingredient in a product, with per-ingredient provenance."},"ProductSummary":{"properties":{"product_id":{"type":"string","title":"Product Id"},"brand_name":{"type":"string","title":"Brand Name"},"product_name":{"type":"string","title":"Product Name"},"form":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Form"},"ingredient_count":{"type":"integer","title":"Ingredient Count"}},"type":"object","required":["product_id","brand_name","product_name","ingredient_count"],"title":"ProductSummary","description":"One product in the catalogue listing."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}