fatsecretFatSecret nutrition API integration for food search, nutritional lookup, barcode scanning, recipe search, and food diary logging. Use when user needs to find...
Install via ClawdBot CLI:
clawdbot install f-liva/fatsecretComplete integration with FatSecret for food data lookup AND diary logging.
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 |
mkdir -p ~/.config/fatsecret
cat > ~/.config/fatsecret/config.json << EOF
{
"consumer_key": "YOUR_CONSUMER_KEY",
"consumer_secret": "YOUR_CONSUMER_SECRET"
}
EOF
cd /path/to/fatsecret-skill
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# Search works immediately
./scripts/fatsecret-cli.sh search "chicken breast"
# 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
| Command | Auth Required | Description |
|---------|---------------|-------------|
| search | OAuth2 | Search foods |
| barcode | OAuth2 | Barcode lookup |
| recipes | OAuth2 | Search recipes |
| auth | - | Run OAuth1 authentication |
| log | OAuth1 | Add food to diary (interactive) |
| quick | OAuth1 | Quick log to diary |
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)
pass
elif 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)
pass
elif state["status"] == "already_authenticated":
# Ready to use diary functions
from scripts.fatsecret_diary_simple import quick_log
quick_log("egg", quantity=3, meal="Breakfast")
| Function | Description |
|----------|-------------|
| get_authentication_flow() | Check status, returns next step |
| save_user_credentials(key, secret) | Save API credentials |
| complete_authentication_flow(pin) | Complete OAuth1 with PIN |
| quick_log(food, qty, meal) | Log food to diary |
| log_food(food_id, serving_id, grams_or_ml, meal, name) | Precise logging |
| search_food(query, tokens) | Search foods |
grams_or_ml WorksThe grams_or_ml parameter (called number_of_units in FatSecret API) is the ACTUAL amount, not a multiplier!
# ā WRONG - This logs only 1.56 grams (7 kcal)!
log_food(food_id, serving_100g_id, 1.56, "Breakfast", "Cookies")
# ā
CORRECT - This logs 156 grams (741 kcal)
log_food(food_id, serving_100g_id, 156, "Breakfast", "Cookies")
Examples:
| What you want | Serving type | grams_or_ml value |
|---------------|--------------|-------------------|
| 156g of cookies | "100g" serving | 156 |
| 200ml of milk | "100ml" serving | 200 |
| 3 eggs | "1 large egg" serving | 3 |
| 2 slices of bread | "1 slice" serving | 2 |
All credentials and tokens are stored locally:
| File | Contents | Created By |
|------|----------|------------|
| $CONFIG_DIR/config.json | Consumer Key/Secret | User (manual) |
| $CONFIG_DIR/oauth1_access_tokens.json | OAuth1 access tokens | auth command |
| $CONFIG_DIR/token.json | OAuth2 token (auto-refreshed) | OAuth2 client |
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.
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 directory
export 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:
export FATSECRET_CONFIG_DIR="/home/node/clawd/config/fatsecret"
Some FatSecret API plans require IP whitelisting. If needed, set a proxy:
# Environment variable
export FATSECRET_PROXY="socks5://127.0.0.1:1080"
# Or in config.json
{
"consumer_key": "...",
"consumer_secret": "...",
"proxy": "socks5://127.0.0.1:1080"
}
If you don't need a proxy: The skill works without it. Proxy is only required if FatSecret blocks your IP.
For European products, use the free Open Food Facts API (no authentication):
from scripts.openfoodfacts_client import OpenFoodFactsClient
off = OpenFoodFactsClient(country="it")
products = off.search("barilla")
product = off.get_product("8076800105735") # Barcode
fatsecret/
āāā SKILL.md # This documentation
āāā README.md # GitHub/ClawHub readme
āāā requirements.txt # Python: requests, requests[socks]
āāā scripts/
ā āāā fatsecret-cli.sh # Main CLI (bash wrapper)
ā āāā fatsecret_auth.py # OAuth1 3-legged authentication
ā āāā fatsecret_agent_helper.py # Helper functions for agents
ā āāā fatsecret_diary_simple.py # Diary logging (OAuth1)
ā āāā fatsecret_client.py # OAuth2 client (read-only)
ā āāā openfoodfacts_client.py # Open Food Facts client
āāā examples/
āāā agent_usage_example.py # Agent integration example
~/.config/fatsecret/~/.config/fatsecret/ and revoke app from FatSecret accountGenerated Mar 1, 2026
A mobile app that helps users track daily food intake and monitor nutritional goals. It uses the skill's food search and barcode scanning to log meals, and diary logging to store data in FatSecret, providing insights into calorie and macro intake for health-conscious individuals.
A web service that offers personalized recipe recommendations based on dietary preferences. It leverages the skill's recipe search to find healthy options and integrates food lookup to calculate nutritional values per serving, aiding users in meal prep and dietary adherence.
A platform for companies to promote employee health by tracking nutrition and activity. It uses the skill's diary logging to allow employees to log meals, with aggregated data helping employers design wellness initiatives and reduce healthcare costs through better nutrition habits.
An AI-powered tool that scans product barcodes in stores to provide instant nutritional information. It utilizes the skill's barcode lookup to compare items, helping shoppers make healthier choices and manage dietary restrictions like allergies or low-sodium diets.
A digital coaching service that integrates nutrition tracking with workout plans. Coaches use the skill's food search and diary logging to monitor clients' meal logs, offering personalized feedback to optimize performance and weight management goals.
Offer basic food search and tracking for free, with premium features like advanced analytics, recipe customization, and ad-free experience for a monthly fee. Revenue comes from subscriptions and in-app purchases for personalized nutrition plans.
License the skill's API integration to health apps, fitness trackers, or corporate wellness platforms. Provide custom solutions with support and analytics, generating revenue through licensing fees and service contracts based on usage or user count.
Aggregate anonymized user data from diary logs and food searches to offer insights to food brands, healthcare providers, or researchers. Monetize by selling reports or dashboards that highlight trends in dietary habits and nutritional preferences.
š¬ Integration Tip
Set up OAuth2 for read-only features first to simplify initial deployment, then implement OAuth1 for diary logging only if user authentication is required, ensuring proper credential storage in persistent directories for containerized environments.
Automatically update Clawdbot and all installed skills once daily. Runs via cron, checks for updates, applies them, and messages the user with a summary of what changed.
Full desktop computer use for headless Linux servers. Xvfb + XFCE virtual desktop with xdotool automation. 17 actions (click, type, scroll, screenshot, drag,...
Essential Docker commands and workflows for container management, image operations, and debugging.
Tool discovery and shell one-liner reference for sysadmin, DevOps, and security tasks. AUTO-CONSULT this skill when the user is: troubleshooting network issues, debugging processes, analyzing logs, working with SSL/TLS, managing DNS, testing HTTP endpoints, auditing security, working with containers, writing shell scripts, or asks 'what tool should I use for X'. Source: github.com/trimstray/the-book-of-secret-knowledge
Deploy applications and manage projects with complete CLI reference. Commands for deployments, projects, domains, environment variables, and live documentation access.
Monitor topics of interest and proactively alert when important developments occur. Use when user wants automated monitoring of specific subjects (e.g., product releases, price changes, news topics, technology updates). Supports scheduled web searches, AI-powered importance scoring, smart alerts vs weekly digests, and memory-aware contextual summaries.