Analytics: Get daily averages
get_daily_averages Get daily average income, spending, and net for a date range.
Computes the averages server-side, handling partial months and
year-to-date ranges correctly, and provides a monthly breakdown.
Phase 114 — the start date is **clamped to the user's first
transaction date** when that's later than what was requested.
Without this, a user with two months of activity who asks for
the YTD average sees the daily averages roughly halved (divided
by ~120 days when only ~60 had activity). The response carries
``clamped_to_first_activity`` (bool) and ``requested_start_date``.
When ``clamped_to_first_activity`` is True, the averages cover
only the days since the first transaction (e.g. 55 days of data),
not the full requested range.
Args:
start_date: YYYY-MM-DD (defaults to Jan 1 of current year)
end_date: YYYY-MM-DD (defaults to today)
Returns:
Daily averages with monthly breakdown showing income, expenses,
and net for each month in the range, plus the two clamping
metadata fields.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end_date | No | ||
| start_date | No |