Install
openclaw skills install fdc-apiInteract with the USDA FoodData Central (FDC) API to search for foods and retrieve detailed nutritional information. Use when the user asks to look up food nutrition data, search for foods by name, get nutritional details for specific foods, or query the USDA food database. Requires FDC_API_KEY environment variable to be set.
openclaw skills install fdc-apiThis skill provides access to the USDA FoodData Central API for searching foods and retrieving detailed nutritional information.
Language: All food descriptions and search queries must be in English. The database does not support searching in other languages.
Geographic Scope: This is a US-focused database. The "Branded" data type contains primarily US commercial food products. While "Foundation" and "SR Legacy" include generic foods (like "apples, raw" or "chicken, grilled"), brand-specific items will be American brands. European or other international brands will generally not be found.
The skill requires a valid FDC API key to function. The key should be available via the FDC_API_KEY environment variable.
If FDC_API_KEY is not set, guide the user through this onboarding process:
~/.openclaw/openclaw.json{
"env": {
"FDC_API_KEY": "your-40-character-api-key-here"
}
}
All API requests are made to https://api.nal.usda.gov/fdc/v1 with authentication via the X-Api-Key header.
X-RateLimit-Limit, X-RateLimit-Remaining) are included in all responsesSearch for foods by keyword using /foods/search endpoint.
Usage:
./skills/fdc-api/scripts/fdc_search.sh "search query" [pageSize] [dataType]
Parameters:
search query (required): Keywords to search for (e.g., "cheddar cheese")pageSize (optional): Number of results to return (1-200, default: 10)dataType (optional): Filter by data type - "Branded", "Foundation", "Survey (FNDDS)", "SR Legacy"Example:
./skills/fdc-api/scripts/fdc_search.sh "apple" 5
./skills/fdc-api/scripts/fdc_search.sh "milk" 10 "Foundation"
Response Format: Returns a formatted table with:
Retrieve detailed nutritional information for a specific food by FDC ID.
Usage:
./skills/fdc-api/scripts/fdc_food.sh <fdcId> [format] [nutrients]
Parameters:
fdcId (required): The FDC ID of the food (from search results)format (optional): "abridged" or "full" (default: "full")nutrients (optional): Comma-separated list of up to 25 nutrient numbers to filter (e.g., "203,204,205")Example:
./skills/fdc-api/scripts/fdc_food.sh 168917
./skills/fdc-api/scripts/fdc_food.sh 168917 full "203,204,205"
Response Format: Returns formatted output with:
Common error codes and their meanings:
./skills/fdc-api/scripts/fdc_search.sh "banana" 5./skills/fdc-api/scripts/fdc_food.sh 173944Common nutrient numbers for filtering:
To filter by specific nutrients, pass them as comma-separated values:
./skills/fdc-api/scripts/fdc_food.sh 168917 full "208,203,204,205"