TopRank Skills

Home / Claw Skills / Recherche / fatsecret
Official OpenClaw rules 54%

fatsecret

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.

Stars

0

Installs

0

Status

ACTIVE

Visibility

PUBLIC

安装方式

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 fatsecret 技能。 若已安装,则直接安装 fatsecret 技能。

Overview

Skill Key
f-liva/fatsecret
Author
f-liva
Source Repo
openclaw/skills
Version
-
Source Path
skills/f-liva/fatsecret
Latest Commit SHA
6cd6dd8b4a4f6795a82127774470828a1ef6897a

Extracted Content

SKILL.md excerpt

# 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)

## 🚀 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
```bash
mkdir -p ~/.config/fatsecret
cat > ~/.config/fatsecret/config.json << EOF
{
  "consumer_key": "YOUR_CONSUMER_KEY",
  "consumer_secret": "YOUR_CONSUMER_SECRET"
}
EOF
```

### 3. Install Dependencies
```bash
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
```bash
# Search works immediately
./scripts/fatsecret-cli.sh search "chicken breast"
```

### 4b. For Diary Logging (OAuth1) - One-time user authorization
```bash
# 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...

README excerpt

# FatSecret Skill for OpenClaw

Complete FatSecret nutrition API integration with food search, barcode lookup, recipes, and **diary logging**.

## ✨ Features

- 🔍 **Food Search** - Search FatSecret's extensive database
- 📦 **Barcode Lookup** - Scan product barcodes
- 🍳 **Recipe Search** - Find healthy recipes
- 📝 **Diary Logging** - Log meals to your FatSecret account
- 🤖 **Agent Ready** - Helper functions for OpenClaw agents
- 🇪🇺 **Open Food Facts** - European product database (free, no auth)

## 🔐 Authentication

| Method | Use Case | User Login |
|--------|----------|------------|
| OAuth2 | Read-only (search, barcode) | ❌ No |
| OAuth1 | Full access (+ diary logging) | ✅ Yes (one-time) |

## ⚡ Quick Start

### 1. Install
```bash
clawhub install fatsecret
cd skills/fatsecret
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
```

### 2. Configure
Get credentials from https://platform.fatsecret.com

```bash
mkdir -p ~/.config/fatsecret
cat > ~/.config/fatsecret/config.json << EOF
{
  "consumer_key": "YOUR_KEY",
  "consumer_secret": "YOUR_SECRET"
}
EOF
```

### 3. Use

**Search (works immediately):**
```bash
./scripts/fatsecret-cli.sh search "chicken breast"
```

**Diary logging (requires one-time auth):**
```bash
./scripts/fatsecret-cli.sh auth  # Follow prompts
./scripts/fatsecret-cli.sh quick egg 3 Breakfast
```

## 📋 CLI Commands

```bash
./scripts/fatsecret-cli.sh search "oatmeal"     # Search foods
./scripts/fatsecret-cli.sh barcode 0041270003490 # Barcode lookup
./scripts/fatsecret-cli.sh recipes "low carb"   # Recipe search
./scripts/fatsecret-cli.sh auth                  # OAuth1 setup
./scripts/fatsecret-cli.sh log                   # Interactive diary
./scripts/fatsecret-cli.sh quick egg 3 Breakfast # Quick log
```

## 🤖 Agent Integration

```python
from scripts.fatsecret_agent_helper import (
    get_authentication_flow,
    save_user_credentials,
    complete_authentication_flow
)
from scripts.fatsecret_diary_simp...

Related Claw Skills