Skip to main content
GET
/
api
/
v1
/
expense-insights
Expense Insights
curl --request GET \
  --url https://api.example.com/api/v1/expense-insights
{
  "year": 2025,
  "prevYear": 2024,
  "totalCurrent": 450000,
  "totalPrevious": 380000,
  "totalChangePct": 18.4,
  "totalDirection": "up",
  "hasPreviousYear": true,
  "monthly": [
    {
      "month": 1,
      "name": "January",
      "current": 120000,
      "previous": 95000,
      "changePct": 26.3,
      "direction": "up"
    }
  ],
  "quarterly": [
    {
      "quarter": 1,
      "current": 350000,
      "previous": 290000,
      "changePct": 20.7,
      "direction": "up"
    }
  ],
  "categories": [
    {
      "category": "travel",
      "label": "Travel",
      "current": 180000,
      "previous": 120000,
      "changePct": 50.0,
      "direction": "up",
      "flagged": true
    }
  ],
  "categoryMonthly": {}
}
Returns year-over-year expense analysis comparing the given year with the previous year. Includes monthly trends, quarterly rollups, and category comparisons.

Query Parameters

year
string
default:"current year"
Tax year (YYYY format).

Response

{
  "year": 2025,
  "prevYear": 2024,
  "totalCurrent": 450000,
  "totalPrevious": 380000,
  "totalChangePct": 18.4,
  "totalDirection": "up",
  "hasPreviousYear": true,
  "monthly": [
    {
      "month": 1,
      "name": "January",
      "current": 120000,
      "previous": 95000,
      "changePct": 26.3,
      "direction": "up"
    }
  ],
  "quarterly": [
    {
      "quarter": 1,
      "current": 350000,
      "previous": 290000,
      "changePct": 20.7,
      "direction": "up"
    }
  ],
  "categories": [
    {
      "category": "travel",
      "label": "Travel",
      "current": 180000,
      "previous": 120000,
      "changePct": 50.0,
      "direction": "up",
      "flagged": true
    }
  ],
  "categoryMonthly": {}
}
hasPreviousYear
boolean
Whether previous year data exists. When false, change badges and comparison lines are omitted in the UI.
categories[].flagged
boolean
true when the category has a 10%+ increase year-over-year. Displayed as a warning in the UI.