ynab-apiYNAB (You Need A Budget) comprehensive budget management with automated tracking, goal monitoring, spending analysis, and daily budget check reports. Ready-t...
Install via ClawdBot CLI:
clawdbot install f-liva/ynab-apiComplete YNAB budget automation toolkit with best practices, automated monitoring, and ready-to-use helper scripts.
This skill provides best practices for managing YNAB budgets via API, including transaction categorization, data consistency, and automated workflows.
https://app.ynab.com/abc123... β abc123...)Create config file at ~/.config/ynab/config.json:
{
"api_key": "YOUR_YNAB_TOKEN_HERE",
"budget_id": "YOUR_BUDGET_ID_HERE"
}
Or set environment variables:
export YNAB_API_KEY="your_token"
export YNAB_BUDGET_ID="your_budget_id"
π ONE-COMMAND SETUP:
/home/node/clawd/skills/ynab-api/scripts/setup-automation.sh
This interactive script creates all recommended cron jobs:
Preview changes first:
/home/node/clawd/skills/ynab-api/scripts/setup-automation.sh --dry-run
Manual setup (alternative):
If you prefer to create cron jobs manually:
openclaw cron add --name "Daily Budget Check" \
--schedule "15 7 * * *" \
--session isolated \
--model gemini-flash \
--delivery announce \
--task "Run YNAB daily budget check and send via WhatsApp"
Run a quick test:
/home/node/clawd/skills/ynab-api/scripts/goals-progress.sh
If you see your budget goals, you're all set! π
Never create transactions without a category. Uncategorized transactions break budget tracking.
When adding a transaction, categorize it at creation timeβdon't defer.
When you encounter an unfamiliar merchant/payee:
Why: This preserves categorization consistency and reduces user interruptions.
Example:
# Search for past transactions by payee
curl -s "https://api.ynab.com/v1/budgets/$BUDGET_ID/transactions" \
-H "Authorization: Bearer $API_KEY" | \
jq '.data.transactions[] | select(.payee_name | contains("MERCHANT_NAME"))'
Before creating a new transaction:
Why: Avoids duplicates from imported bank transactions.
YNAB API uses milliunits for all amounts:
10000 (positive for income)-10000 (negative for expenses)Always divide by 1000 when displaying, multiply by 1000 when submitting.
When calculating monthly spending:
amount < 0 (actual expenses)Note: Exclusion rules depend on your budget goals. Configure your specific exclusions in a local config or notes file.
Transactions with category "Split" contain subtransactions.
Never show "Split" as a category in reportsβalways expand to subcategories:
# For each split transaction
if [ "$category_name" = "Split" ]; then
for subtx in subtransactions; do
echo "$subtx.category_name: $subtx.amount"
done
fi
β οΈ IMPORTANT: To create a real transfer that YNAB recognizes as linked transactions between accounts, you MUST use the account's transfer_payee_id, NOT a payee name.
Each account has a special field transfer_payee_id - this is the payee ID that represents transfers TO that account.
β CORRECT - Real Transfer:
# Transfer from Account A to Account B
# Get Account B's transfer_payee_id first, then:
curl -X POST "$YNAB_API/budgets/$BUDGET_ID/transactions" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"transaction\": {
\"account_id\": \"ACCOUNT_A_ID\",
\"date\": \"2026-02-21\",
\"amount\": -50000,
\"payee_id\": \"ACCOUNT_B_TRANSFER_PAYEE_ID\",
\"approved\": true
}
}"
β WRONG - NOT a Real Transfer:
# Using payee_name creates a regular transaction, NOT a transfer
"payee_name": "Transfer: To Account B" # YNAB won't link this
Get all accounts with their transfer_payee_id:
curl "$YNAB_API/budgets/$BUDGET_ID/accounts" \
-H "Authorization: Bearer $API_KEY" | \
jq -r '.data.accounts[] | "\(.name): \(.transfer_payee_id)"'
Store these IDs in your personal config (TOOLS.md or local config file) for quick reference.
When you use transfer_payee_id:
| Transfer (payee_id = transfer_payee_id) | Regular Transaction (payee_name) |
|----------------------------------------|----------------------------------|
| Two linked transactions created | Single transaction |
| Automatically categorized as Transfer | Needs category |
| No budget impact | Affects budget |
| Both sides auto-reconcile | Manual reconciliation |
Store account IDs in config (example structure):
{
"accounts": {
"primary_checking": "UUID-HERE",
"savings": "UUID-HERE",
"cash": "UUID-HERE"
},
"default_account": "primary_checking"
}
Never hardcode account IDs in scriptsβuse config references.
YNAB_API="https://api.ynab.com/v1"
curl -X POST "$YNAB_API/budgets/$BUDGET_ID/transactions" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"transaction\": {
\"account_id\": \"$ACCOUNT_ID\",
\"date\": \"2026-02-21\",
\"amount\": -10000,
\"payee_name\": \"Coffee Shop\",
\"category_id\": \"$CATEGORY_ID\",
\"memo\": \"Morning coffee\",
\"approved\": true
}
}"
# Step 1: Get destination account's transfer_payee_id
DEST_ACCOUNT_NAME="Savings"
TRANSFER_PAYEE_ID=$(curl -s "$YNAB_API/budgets/$BUDGET_ID/accounts" \
-H "Authorization: Bearer $API_KEY" | \
jq -r ".data.accounts[] | select(.name == \"$DEST_ACCOUNT_NAME\") | .transfer_payee_id")
# Step 2: Create transfer transaction
curl -X POST "$YNAB_API/budgets/$BUDGET_ID/transactions" \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d "{
\"transaction\": {
\"account_id\": \"$SOURCE_ACCOUNT_ID\",
\"date\": \"2026-02-21\",
\"amount\": -50000,
\"payee_id\": \"$TRANSFER_PAYEE_ID\",
\"memo\": \"Monthly savings transfer\",
\"approved\": true
}
}"
# YNAB will automatically create the matching transaction in the destination account
Important: Only create ONE transaction - YNAB creates the matching side automatically.
# Get transactions since date
curl "$YNAB_API/budgets/$BUDGET_ID/transactions?since_date=2026-02-01" \
-H "Authorization: Bearer $API_KEY"
# Filter by payee (client-side with jq)
... | jq '.data.transactions[] | select(.payee_name | contains("Coffee"))'
curl "$YNAB_API/budgets/$BUDGET_ID/categories" \
-H "Authorization: Bearer $API_KEY" | \
jq '.data.category_groups[].categories[] | {id, name}'
To calculate monthly spending:
amount < 0 (expenses only)Tip: Consider separating small recurring expenses from large one-time purchases for better budget analysis.
All scripts are in /skills/ynab-api/scripts/ and ready to use.
setup-automation.sh [--dry-run]β START HERE - One-command automation setup.
./setup-automation.sh # Interactive setup
./setup-automation.sh --dry-run # Preview changes
Creates all recommended cron jobs:
What it does:
This is the recommended way to get started!
goals-progress.sh [month]Shows visual progress bars for all category goals.
./goals-progress.sh # Current month
./goals-progress.sh 2026-01 # Specific month
Example output:
π PROGRESSI OBIETTIVI - 2026-02-01
Palestra ποΈβοΈ:
ββββββββββ 8% (β¬22/β¬270) π’
Salute βοΈ:
ββββββββββ 43% (β¬261/β¬500) π‘
Mangiare Fuori π:
ββββββββββ 119% (β¬178/β¬150) π΄
scheduled-upcoming.sh [days]Lists upcoming scheduled transactions.
./scheduled-upcoming.sh # Next 7 days
./scheduled-upcoming.sh 30 # Next 30 days
Example output:
π
TRANSAZIONI PROGRAMMATE - Prossimi 7 giorni
2026-03-01 πΈ Lisa Valent: β¬-42.18 - Spotify
2026-03-02 πΈ Andrea Schiffo: β¬-84.36 - Spotify lui e moglie
---
TOTALE: β¬-126.54
month-comparison.sh [month1] [month2]Compares spending between two months.
./month-comparison.sh # Current vs last month
./month-comparison.sh 2026-02 2026-01 # Specific months
Example output:
π CONFRONTO SPESE
2026-02-01 vs 2026-01-01
Casa π : β¬1,241 (era β¬450) β οΈ +176%
Mangiare Fuori π: β¬178 (era β¬120) βοΈ +48%
Palestra ποΈβοΈ: β¬100 (era β¬100) = 0%
---
TOTALE 2026-02: β¬5,298
TOTALE 2026-01: β¬3,450
Differenza: +β¬1,848 (+53.6%)
transfer.sh SOURCE_ACCOUNT DEST_ACCOUNT AMOUNT DATE [MEMO]Creates a proper linked transfer between accounts.
./transfer.sh abc-123 "Savings" 100.50 2026-02-21 "Monthly savings"
Important: Uses transfer_payee_id for real transfers recognized by YNAB.
daily-budget-check.shComprehensive morning budget report (designed for cron).
./daily-budget-check.sh
Example output:
βοΈ BUDGET CHECK MATTUTINO
π° Age of Money: 141 giorni β
π
Prossime uscite (7gg)
β’ Domani: Lisa Valent β¬42.18
β οΈ Alert Budget Superato
β’ Mangiare Fuori π: β¬178 / β¬150 (+β¬28)
π― Obiettivi in ritardo
β’ Palestra ποΈβοΈ: 8% (β¬22/β¬270)
This script is perfect for automated cron jobs to get daily budget insights.
For personal preferences (merchant mappings, category exclusions, default accounts):
Option 1: Add to your workspace TOOLS.md:
## YNAB Personal Config
- Default account: [account_id]
- Exclude from budget: Category1, Category2
- Merchant mappings: Store β Category
Option 2: Create local config file (e.g., ~/.config/ynab/rules.json):
{
"exclude_categories": ["Taxes", "Transfers"],
"merchant_map": {
"Coffee Shop": "category_id_here"
}
}
The skill will check transaction history for consistencyβyour personal preferences stay private.
YNAB_API_KEY in environment or secure config (~/.config/ynab/config.json with 600 permissions)Official YNAB API docs: https://api.ynab.com
Rate limit: ~200 requests per hour per IP.
Get a comprehensive budget overview every morning at 7:15 AM:
openclaw cron add --name "Daily Budget Check" \
--schedule "15 7 * * *" \
--session isolated \
--model gemini-flash \
--delivery announce \
--task "Run YNAB daily budget check and send via WhatsApp"
Every Monday morning, compare last week with previous week:
openclaw cron add --name "Weekly Spending Review" \
--schedule "0 8 * * 1" \
--session isolated \
--model gemini-flash \
--delivery announce \
--task "Compare current month vs last month YNAB spending"
Mid-month reminder (15th) to check goal progress:
openclaw cron add --name "Mid-Month Goal Check" \
--schedule "0 9 15 * *" \
--session isolated \
--model gemini-flash \
--delivery announce \
--task "Show YNAB goals progress for current month"
Get notified 2 days before scheduled payments:
openclaw cron add --name "Upcoming Bills Alert" \
--schedule "0 10 * * *" \
--session isolated \
--model gemini-flash \
--delivery announce \
--task "Show YNAB scheduled transactions for next 2 days"
600config.json to version control.gitignore: config/ynab.json, .config/ynab/401 Unauthorized: API key invalid or expired
404 Not Found: Budget ID or transaction ID doesn't exist
/budgets endpoint429 Too Many Requests: Rate limit exceeded (~200 requests/hour)
Transfer not linking: Using payee_name instead of transfer_payee_id
Common mistakes:
After installation:
goals-progress.shHappy budgeting! π°
Generated Mar 1, 2026
A financial advisor uses the skill to automate daily budget summaries and goal tracking for clients, sending personalized WhatsApp alerts about overspending and upcoming bills. This reduces manual reporting time and provides clients with real-time insights into their financial health, enhancing engagement and accountability.
A small business owner integrates the skill to monitor company budgets, track spending trends month-over-month, and receive alerts for scheduled vendor payments. Automated daily checks help prevent cash flow issues by highlighting overspending in operational categories like supplies or marketing.
A freelancer employs the skill to categorize income and expenses automatically, using smart categorization to learn from transaction history. It aids in setting aside funds for taxes and tracking discretionary spending, with weekly reviews to adjust budgets based on variable income streams.
A household uses the skill to sync multiple members' spending via YNAB, with automated alerts for shared bills and goal progress tracking for savings targets like vacations. Daily summaries via Telegram keep everyone informed and aligned on financial priorities without manual updates.
A non-profit organization utilizes the skill to track grant allocations and spending against budgeted categories, with automated reports on goal progress and overspending alerts. This ensures compliance with funding requirements and simplifies financial reporting to donors.
Offer monthly subscriptions where clients receive automated YNAB reports and personalized insights via the skill's alerts. Revenue comes from tiered plans based on features like daily checks or advanced analysis, leveraging the skill to reduce manual labor and scale services.
License the skill to banks or fintech apps as an embedded budgeting feature, using its API automation for customer spending analysis and alerts. Revenue is generated through licensing fees or revenue-sharing agreements based on user engagement and upsells to premium financial products.
Develop a free app that uses the skill for basic budget tracking, with premium upgrades for advanced features like automated goal monitoring and detailed trend analysis. Monetize through in-app purchases or ads, using the skill to enhance user retention with proactive financial insights.
π¬ Integration Tip
Ensure environment variables YNAB_API_KEY and YNAB_BUDGET_ID are securely set before automation; use the provided setup script for cron jobs to avoid manual configuration errors.
Query Copilot Money personal finance data (accounts, transactions, net worth, holdings, asset allocation) and refresh bank connections. Use when the user asks about finances, account balances, recent transactions, net worth, investment allocation, or wants to sync/refresh bank data.
Stripe API integration with managed OAuth. Manage customers, subscriptions, invoices, products, prices, and payments. Use this skill when users want to process payments, manage billing, or handle subscriptions with Stripe. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway). Requires network access and valid Maton API key.
QuickBooks API integration with managed OAuth. Manage customers, invoices, payments, bills, and run financial reports. Use this skill when users want to interact with QuickBooks accounting data. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).
Advanced financial calculator with future value tables, present value, discount calculations, markup pricing, and compound interest. Use when calculating investment growth, pricing strategies, loan values, discounts, or comparing financial scenarios across different rates and time periods. Includes both CLI and interactive web UI.
Track expenses via natural language, get spending summaries, set budgets
Query and manage personal finances via the official Actual Budget Node.js API. Use for budget queries, transaction imports/exports, account management, categorization, rules, schedules, and bank sync with self-hosted Actual Budget instances.