{"topic_id":"ingredient_lookup_endpoint_spec","category":"global","context":"---\ntopic_id: ingredient_lookup_endpoint_spec\ncategory: API-SPEC\ntitle: /api/v1/ingredient_lookup Endpoint Specification\nlang: en\nsource: aafco_ch6_2024_parsed.json + eu_fmr_products_20260714_v4.json + cfia_approved_ingredients.json\ndate_parsed: 2026-07-19\ntokens_estimated: 800\n---\n\n# /api/v1/ingredient_lookup Endpoint Specification\n\n## Purpose\n**Cross-standard ingredient lookup for pet food regulatory compliance.**\n\nCurrently supports 3 data sources with different data types (all local files, verified 2026-07-19):\n- **AAFCO Ch6 (2024 OP)**: Ingredient definitions — 650 entries across 34 numeric chapters + tentative codes (`pdf-parsed/us-2026/aafco_ch6_2024_parsed.json`, verbatim-backed by `pdf-raw/aafco_ch6_2024.txt`)\n- **EU FMR Reg68**: Feed products — 4,704 products in 13 category codes incl. 1,164 `Unknown` (`pdf-parsed/eu_fmr_products_20260714_v4.json`)\n- **CFIA FeedList**: Registered feed descriptions — 7,366 entries, livestock species only (`pdf-parsed/ca-2026/cfia_approved/cfia_approved_ingredients.json`)\n\n## Endpoint Signature\n\n```\nGET /api/v1/ingredient_lookup?query=<keyword>&standard=<standard>&category=<category>&limit=<limit>\n```\n\n### Query Parameters\n\n| Parameter | Type | Required | Description |\n|---|---|---|---|\n| `query` | string | Yes | Search keyword (e.g. \"barley\", \"salmon\", \"whey\") |\n| `standard` | string | No | Filter by standard: `aafco` / `eu_fmr` / `cfia` / `all` (default) |\n| `category` | string | No | Filter by cross-category (draft mapping, see 02_cross_index_overview) |\n| `limit` | int | No | Max results (default 50, max 500) |\n\n## Response Format (illustrative — all entries below are REAL records)\n\n```json\n{\n  \"query\": \"salmon\",\n  \"results\": [\n    {\n      \"standard\": \"EU_FMR_Reg68\",\n      \"reg68_code\": \"10_Fish\",\n      \"id\": \"002444-EN\",\n      \"name\": \"Salmon Protein Hydrolysate 95% (HBC-SPH 95%)\"\n    },\n    {\n      \"standard\": \"EU_FMR_Reg68\",\n      \"reg68_code\": \"10_Fish\",\n      \"id\": \"009865-EN\",\n      \"name\": \"Dehydrated salmon meat proteins\"\n    },\n    {\n      \"standard\": \"AAFCO_Ch6\",\n      \"code\": \"87.36\",\n      \"name\": \"Phaffia Yeast (color additive for salmonid fish feed)\",\n      \"note\": \"AAFCO 2024 parsed set has no salmon-ingredient definition; matches are use-context mentions\"\n    }\n  ],\n  \"total_results\": 3,\n  \"standards_searched\": [\"EU_FMR_Reg68\", \"AAFCO_Ch6\", \"CFIA_FeedList\"]\n}\n```\n\n## Verified Data Profiles\n\n### AAFCO Ch6 2024 (650 entries) — chapter → content (verified against parsed entries)\n| Chapters | Content | Count |\n|---|---|---|\n| 12,42,69,75,78,93,48 | Cereal grains & co-products (barley, grain sorghum, oats, rice, rye, wheat, corn) | 79 |\n| 15,27 | Brewers/distillers co-products | 16 |\n| 24,71,84 | Oil-seed & plant-protein meals (cottonseed, canola/other, soybean) | 60 |\n| 51 | Fish & marine | 18 |\n| 54 | Milk products (whey, casein, buttermilk…) | 40 |\n| 63 | Molasses & beet products | 17 |\n| 57 | Minerals | 139 |\n| 33 | Fats & oils | 21 |\n| 36 | Fermentation products | 15 |\n| 96 | Yeast | 13 |\n| 90 | Vitamins | 42 |\n| 66 | Non-protein nitrogen (urea, biuret) | 5 |\n| 30 | Enzymes | 3 |\n| 73 | Chemical preservatives | 36 |\n| 40,45,81,60 | Pomace/forage/screenings/miscellaneous (60.x incl. kelp, pulses, BSFL) | 62 |\n| 21 | Citrus co-products | 3 |\n| 87 | Special-purpose & color additives (mixed) | 53 |\n| 16,18,22,70,74,T | Parse artifacts & tentative codes | 28 |\n| **Total** | | **650** |\n\nNote: the classic AAFCO chapter 9 (animal protein products) is NOT present in the parsed 2024 set — do not promise animal-meal definitions in responses.\n\n### EU FMR Reg68 (4,704 products) — category code → count (verified)\n`Unknown` 1164 · `6_Forages` 815 · `11_Minerals` 526 · `9_Animal_products` 362 · `7_Other_plants` 327 · `4_Tubers` 311 · `3_Legumes` 309 · `2_Oil_seeds` 245 · `1_Cereals` 185 · `12_Fermentation` 156 · `8_Milk` 118 · `5_Other_seeds` 101 · `10_Fish` 85\n\n### CFIA FeedList (7,366 entries)\nLivestock feed registry extracted from CFIA FeedList datalists. Species: Layer Chicken, Broiler Chicken, Turkey, Swine, Dairy, Beef, Sheep, Fish, Minor Species, Livestock and Multiple Species — **no dog/cat entries**; do not return CFIA results for pet-species queries without this caveat.\n\n## Implementation Notes\n\n1. **AAFCO Ch6 lookup**: Search `name`+`definition` fields in the 650-entry JSON\n2. **EU FMR lookup**: Search `name` field in 4,704 products (filter by `reg68_category_code`)\n3. **CFIA lookup**: Search `name` field in 7,366 entries (filter by `feed_type` + `species`)\n4. Query latency target: < 200ms (12,720 total entries, in-memory index)\n\n## Data Type Heterogeneity\n\nThese 3 standards are NOT 1:1 mappable:\n- **AAFCO Ch6** = ingredient definitions (what an ingredient IS)\n- **EU FMR** = registered feed products\n- **CFIA FeedList** = registered livestock feeds/brands\n\nCross-mapping is at the **category level** (draft), not the ingredient level. The planned `cross_standard_ingredient_index.json` does NOT exist yet — see 02_cross_index_overview for current status.\n\n---\n\n*Last updated: 2026-07-19 (verified against local data files)*\n","sources":[],"tokens_estimated":800,"generated_at":null,"tip":"Use /api/v1/topics to discover more topics. /api/v1/nutrient for precise single-point queries. /api/v1/cross_compare for 2-3 standard comparisons."}