Skip to main content
The Analytics API provides endpoints for generating financial reports, spending analysis, and dashboard summaries.

getDashboardSummary

Get a comprehensive dashboard summary including cash flow and overview statistics.
await client.analytics.getDashboardSummary()

Parameters

No parameters required. Automatically uses the last 6 months for cash flow analysis.

Response

cashFlowSummary
object
Cash flow report for the last 6 months
overviewSummary
object
Overview statistics including income, expenses, savings, and investments
See getCashFlowReport and the Overview Summary section below for detailed response structures.

getCashFlowReport

Generate a cash flow report for a specific time range.
await client.analytics.getCashFlowReport({
  range: "last_6_months"
})

Parameters

range
enum
required
Time range for the report:
  • this_month: Current month
  • last_3_months: Last 3 months
  • last_6_months: Last 6 months
  • ytd: Year to date
  • 1_year: Last 12 months
  • all: All time

Response

baseCurrency
string
Base currency code for the report
convertedCurrencies
string[]
Array of currency codes that were converted to base currency
currencyExchangeAttribution
object
Attribution for currency exchange rate provider
  • text: Attribution text
  • url: Attribution URL
summary
object
Summary statistics for the period
Summary object includes:
summary.income
string
Total income for the period
summary.expense
string
Total expenses for the period
summary.transfer
string
Total transfers for the period
summary.surplus
string
Net surplus (income - expenses)
summary.monthlyAverageIncome
string
Average monthly income
summary.monthlyAverageExpense
string
Average monthly expenses
summary.monthlyAverageSurplus
string
Average monthly surplus
data
array
Array of cash flow data points by period
Each data point includes:
period
string
Period identifier (e.g., “2024-03”, “2024-Q1”)
income
string
Income for the period
expenses
string
Expenses for the period
transfers
string
Transfers for the period
surplus
string
Surplus for the period
convertedCurrencies
string[]
Currencies converted in this period
meta
object
Metadata about the report
Metadata includes:
meta.range
string
The range parameter used
meta.startDate
Date
Report start date
meta.endDate
Date
Report end date
meta.granularity
enum
Data granularity: day, week, month, or quarter

getCategorySpend

Get spending breakdown by category for a date range.
await client.analytics.getCategorySpend({
  from: new Date("2024-01-01"),
  to: new Date("2024-03-31"),
  limit: 10
})

Parameters

from
Date
required
Start date for the analysis
to
Date
required
End date for the analysis
limit
number
required
Maximum number of categories to return (minimum: 1)

Response

baseCurrency
string
Base currency code
convertedCurrencies
string[]
Array of converted currency codes
currencyExchangeAttribution
object
Currency exchange attribution information
data
array
Array of category spending data
Each category data object includes:
categoryId
string
Category ID
categoryName
string
Category name
categoryIcon
string
Category icon
categoryType
string
Category type (EXPENSE)
parentCategoryId
string | null
Parent category ID if applicable
parentCategoryName
string | null
Parent category name
parentCategoryIcon
string | null
Parent category icon
total
object
Total spending for this category
Total object includes:
total.baseCurrency
string
Total in base currency
total.byCurrency
array
Array of amounts by original currency
Each currency amount includes:
  • currency: Currency code
  • amount: Original amount
  • convertedAmount: Amount converted to base currency

getCategoryIncome

Get income breakdown by category for a date range.
await client.analytics.getCategoryIncome({
  from: new Date("2024-01-01"),
  to: new Date("2024-03-31"),
  limit: 10
})

Parameters

Same as getCategorySpend.

Response

Same structure as getCategorySpend, but for income categories (type: INCOME).

Overview Summary

The overview summary (part of getDashboardSummary) includes the following cash flow types:
  • INCOME: Total income
  • EXPENSE: Total expenses
  • SAVINGS: Savings transactions
  • INVESTMENT: Investment transactions
For each cash flow type, the following periods are included:
ytd
object
Year-to-date totals
thisMonth
object
Current month totals
lastMonth
object
Last month totals
sixMonthAvg
object
6-month average
Each period object includes:
  • baseCurrency: Amount in base currency
  • byCurrency: Array of amounts by currency with original and converted values

TypeScript Types

type CashFlowReportRange = 
  | "this_month"
  | "last_3_months"
  | "last_6_months"
  | "ytd"
  | "1_year"
  | "all"

type CashFlowReportGranularity = "day" | "week" | "month" | "quarter"

type CashFlowReport = {
  baseCurrency: CurrencyCode
  convertedCurrencies: CurrencyCode[]
  currencyExchangeAttribution?: {
    text: string
    url: string
  }
  summary: {
    income: Intl.StringNumericLiteral
    expense: Intl.StringNumericLiteral
    transfer: Intl.StringNumericLiteral
    surplus: Intl.StringNumericLiteral
    monthlyAverageIncome: Intl.StringNumericLiteral
    monthlyAverageExpense: Intl.StringNumericLiteral
    monthlyAverageSurplus: Intl.StringNumericLiteral
  }
  data: CashFlowReportData[]
  meta: {
    range: CashFlowReportRange
    startDate: Date
    endDate: Date
    granularity: CashFlowReportGranularity
  }
}

type CategoryReport = {
  baseCurrency: CurrencyCode
  convertedCurrencies: CurrencyCode[]
  currencyExchangeAttribution?: {
    text: string
    url: string
  }
  data: CategoryReportData[]
}

Build docs developers (and LLMs) love