Data Analysis | AI & MCP | Kick Docs

[See what's new in the

Kick Changelog](/content/changelog/index.html)

For the complete documentation index, see llms.txt. This page is also available as Markdown.

Top expense categories for a quarter

To see where spend concentrated last quarter, pull transactions and group negative amounts by category.

The Script

#!/bin/bash
# top-expense-categories.sh

WORKSPACE_ID="<workspace-id>"
SINCE="2026-01-01"
UNTIL="2026-03-31"

echo "Top expense categories: $SINCE to $UNTIL"
echo ""

kick --workspace "$WORKSPACE_ID" transactions find \
  --since "$SINCE" \
  --until "$UNTIL" \
  --fields amount,category \
  --output json | \
jq -r '\
  [.[] | select(.amount < 0)] |\
  group_by(.category) |\
  map({\
    category: (.[0].category // "Uncategorized"),\
    total: (map(.amount) | add),\
    count: length\
  }) |\
  sort_by(.total) |\
  .[] |\
  "\(.category): $\(.total | fabs) (\(.count) transactions)"\
'

How to Customize

What It Outputs

Cloud Infrastructure: $12500.00 (36 transactions)
Payroll: $75000.00 (3 transactions)

Cash flow statement by month

To analyze operating, investing, and financing totals by month, use the cash flow statement report instead of rolling up raw transactions.

The Script

#!/bin/bash
# cash-flow-by-month.sh

WORKSPACE_ID="<workspace-id>"
ENTITY_ID=123
START_DATE="2026-01-01"
END_DATE="2026-03-31"

ledger_id=$(kick --workspace "$WORKSPACE_ID" accounting ledgers get --entity-id "$ENTITY_ID" --output json | jq -r '.ledgers[0].id')

kick --workspace "$WORKSPACE_ID" reports cash-flow-statement \
  --entity "$ENTITY_ID" \
  --ledger-id "$ledger_id" \
  --start-date "$START_DATE" \
  --end-date "$END_DATE" \
  --cycle month \
  --output json | jq .

How to Customize

What It Outputs

PreviousReconciliation and Cleanup NextIntegration Scripts

Last updated 10 days ago

Was this helpful?