Get USDA Foods (Batch)
usda_get_foodsFetch nutrient profiles for 2–20 foods in a single API call. More efficient than calling usda_get_food N times when you already have multiple FDC IDs. All values are per 100g (no portion scaling). Use the nutrients[] filter to limit response size — strongly recommended for batch calls. For side-by-side comparison with a formatted table, use usda_compare_foods instead. Failed IDs (not found or no data) are reported in the failed[] array rather than aborting the entire batch.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fdcIds | Yes | FDC IDs to fetch — 2 to 20 IDs. Use usda_search_foods to discover IDs. | |
| nutrients | No | Filter to specific nutrient IDs (e.g. [1003, 1004, 1005, 1008]). Strongly recommended — full profiles can be large. Use usda_list_nutrients to look up IDs. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Present when the call failed. Absent on success. | |
| foods | No | Successfully fetched foods. | |
| failed | No | IDs that returned no data. Check these with usda_search_foods to verify they exist. |