Spending By Category
ynab_spending_by_categoryRead-only
Totals spending per category over a date range, biggest spend first. Splits are counted through their subtransactions, and transfers between your own accounts are excluded.
Instructions
Totals spending per category over a date range, biggest spend first. Splits are counted through their subtransactions, and transfers between your own accounts are excluded. Totals are gross outflows: refunds and other inflows aren't netted, so they can differ from a category's activity in YNAB. With monthly: true, each category also gets a month-by-month series, its mean over full months, and how its last full month compares with the earlier ones.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Only return the top N categories by spend | |
| months | No | With monthly: true, how many calendar months to cover, ending with the month of untilDate or the current month (default 6). sinceDate overrides it. Ignored without monthly. | |
| planId | No | The plan ID (optional, defaults to YNAB_PLAN_ID; budgetId is a deprecated alias) | |
| monthly | No | true adds the top-level months list and, on each category, monthly_totals (spend per month, aligned with months), average_monthly (mean over the full months) and change_pct (the last full month against the mean of the earlier full months). Months only partly in the range, or not over yet, are listed but left out of both figures. The range starts at sinceDate when given; otherwise it covers the number of calendar months set by months (default 6, at most 24), ending with untilDate or today. With many categories, pair it with limit. | |
| budgetId | No | Deprecated alias of planId (still accepted) | |
| sinceDate | No | Start of the range, inclusive (ISO format: 2024-01-01). Defaults to 30 days ago. | |
| untilDate | No | End of the range, inclusive (ISO format: 2024-01-31). Defaults to no end date, or to today with monthly: true. |