Token导航 LogoToken导航TokenDH.com
研究检索敏感数据clawhub未标认证来源可访问clear审计提醒

fatsecretfatsecret 搜索

Agent Skill

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

总安装

26,071

周安装

1,065

GitHub Stars

公开资料未说明

下载量

8,350
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:fatsecret(fatsecret 搜索)
来源仓库:https://github.com/f-liva/fatsecret
安装命令:
openclaw skills install fatsecret
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install fatsecret

简介

集成 FatSecret 营养数据库,支持食物搜索与条形码扫描查询。

  • 适合健康管理、饮食规划或健身人群追踪每日营养素摄入。
  • 返回每百克热量、蛋白质、脂肪等详细营养成分表。fatsecret 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 部分食品数据来自用户贡献,可能存在录入误差需交叉验证。
  • 商业用途请查阅其 API 使用条款,避免超出免费额度限制。

SKILL.md

name
fatsecret
description
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
description
FatSecret API Consumer Key (get from platform.fatsecret.com)
description
FatSecret API Consumer Secret
optional
description
SOCKS5 proxy URL if FatSecret requires IP whitelisting (e.g., socks5://127.0.0.1:1080)
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:

MethodUse CaseUser Login RequiredCapabilities
OAuth2 (client_credentials)Read-only access❌ NoFood 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)

🚀 Quick Start

1. Get API Credentials

  1. Go to https://platform.fatsecret.com
  2. Register an application
  3. Copy your Consumer Key and Consumer Secret

2. Save Credentials

mkdir -p ~/.config/fatsecret
cat > ~/.config/fatsecret/config.json << EOF
{
  "consumer_key": "YOUR_CONSUMER_KEY",
  "consumer_secret": "YOUR_CONSUMER_SECRET"
}
EOF

3. Install Dependencies

cd /path/to/fatsecret-skill
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

4a. For Read-Only (OAuth2) - No user login needed

# 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

CommandAuth RequiredDescription
search <query>OAuth2Search foods
barcode <code>OAuth2Barcode lookup
recipes <query>OAuth2Search recipes
auth-Run OAuth1 authentication
logOAuth1Add food to diary (interactive)
quick <food> [qty] [meal]OAuth1Quick 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)
    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")

Agent Helper Functions

FunctionDescription
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

⚠️ IMPORTANT: How grams_or_ml Works

The 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 wantServing typegrams_or_ml value
156g of cookies"100g" serving156
200ml of milk"100ml" serving200
3 eggs"1 large egg" serving3
2 slices of bread"1 slice" serving2

🔐 Credential Storage

All credentials and tokens are stored locally:

FileContentsCreated By
$CONFIG_DIR/config.jsonConsumer Key/SecretUser (manual)
$CONFIG_DIR/oauth1_access_tokens.jsonOAuth1 access tokensauth command
$CONFIG_DIR/token.jsonOAuth2 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.

🐳 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 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"

🌐 Proxy Configuration (Optional)

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.

🌍 Open Food Facts (Alternative)

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

📁 File Structure

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

⚠️ Security Notes

  1. Credentials are stored locally in ~/.config/fatsecret/
  2. OAuth1 tokens don't expire unless you revoke them
  3. OAuth1 grants full access to your FatSecret diary (read + write)
  4. To uninstall safely: Delete ~/.config/fatsecret/ and revoke app from FatSecret account

🔗 References

  • FatSecret API: https://platform.fatsecret.com/docs
  • OAuth1 Guide: https://platform.fatsecret.com/docs/guides/authentication/oauth1/three-legged
  • Open Food Facts: https://wiki.openfoodfacts.org/API

Changelog

v1.0.1 (2026-02-20)

  • Fixed OAuth2 client - now uses OAuth1 for all operations (food search + diary)
  • Unified authentication: single OAuth1 flow works for both read and write operations
  • Removed broken OAuth2 implementation

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

82.48%
按下载量换算6,887

安全审计

VirusTotal

可疑

ClawScan

可疑

Static analysis

未展示

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills