FatSecret nutrition API integration for food search, nutritional lookup, barcode scanning, recipe search, and food diary logging. Use when user needs to find nutritional information for foods, search the food database, scan product barcodes, look up calories/macros/micronutrients, search for healthy recipes, or log meals to their FatSecret diary.
Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
FatSecret nutrition API integration for food search, nutritional lookup, barcode scanning, recipe search, and food diary logging. Use when user needs to find nutritional information for foods, search the food database, scan product barcodes, look up calories/macros/micronutrients, search for healthy recipes, or log meals to their FatSecret diary.
metadata
{"credentials":{"required":[{"name":"FATSECRET_CONSUMER_KEY","description":"FatSecret API Consumer Key (get from platform.fatsecret.com)"},{"name":"FATSECRET_CONSUMER_SECRET","description":"FatSecret API Consumer Secret"}],"optional":[{"name":"FATSECRET_PROXY","description":"SOCKS5 proxy URL if FatSecret requires IP whitelisting (e.g., socks5://127.0.0.1:1080)"},{"name":"FATSECRET_CONFIG_DIR","description":"Custom config directory (default ~/.config/fatsecret). Use for persistent storage in containers."}]}}
FatSecret Nutrition API
Complete integration with FatSecret for food data lookup AND diary logging.
⚠️ Authentication Methods
This skill supports two authentication methods for different use cases:
Method
Use Case
User Login Required
Capabilities
OAuth2 (client_credentials)
Read-only access
❌ No
Food search, barcode lookup, recipes
OAuth1 (3-legged)
Full access
✅ Yes (one-time PIN)
All above + diary logging
Which to use?
Just searching foods? → OAuth2 (simpler, no user login)
Logging to user's diary? → OAuth1 (requires user authorization)
# Search works immediately
./scripts/fatsecret-cli.sh search "chicken breast"
4b. For Diary Logging (OAuth1) - One-time user authorization
# Run authentication flow
./scripts/fatsecret-cli.sh auth
# Follow prompts:# 1. Visit the authorization URL# 2. Log in with FatSecret account# 3. Authorize the app# 4. Enter the PIN shown# Now you can log foods
./scripts/fatsecret-cli.sh quick egg 3 Breakfast
📋 CLI Commands
Command
Auth Required
Description
search <query>
OAuth2
Search foods
barcode <code>
OAuth2
Barcode lookup
recipes <query>
OAuth2
Search recipes
auth
-
Run OAuth1 authentication
log
OAuth1
Add food to diary (interactive)
quick <food> [qty] [meal]
OAuth1
Quick log to diary
🤖 Agent Integration
For OpenClaw Agents
from scripts.fatsecret_agent_helper import (
get_authentication_flow,
complete_authentication_flow,
save_user_credentials
)
# Check authentication status
state = get_authentication_flow()
if state["status"] == "need_credentials":
# Ask user for Consumer Key/Secret# Save with: save_user_credentials(key, secret)passelif state["status"] == "need_authorization":
# Show authorization URL to user
url = state["authorization_url"]
# User visits URL, authorizes, gets PIN# Complete with: complete_authentication_flow(pin)passelif state["status"] == "already_authenticated":
# Ready to use diary functionsfrom scripts.fatsecret_diary_simple import quick_log
quick_log("egg", quantity=3, meal="Breakfast")
Where $CONFIG_DIR is ~/.config/fatsecret by default, or the value of FATSECRET_CONFIG_DIR if set.
To revoke access: Delete the config folder and revoke app access from your FatSecret account settings.
🐳 Container/Docker Environments
In containerized environments (Docker, OpenClaw sandbox), ~/.config/ may not persist across restarts. Use FATSECRET_CONFIG_DIR to point to a persistent volume:
# Set env var to persistent directoryexport FATSECRET_CONFIG_DIR="/home/node/clawd/config/fatsecret"# Or prefix commands
FATSECRET_CONFIG_DIR="/persistent/path" ./scripts/fatsecret-cli.sh auth
OpenClaw example - add to your shell init or AGENTS.md: