[GH-ISSUE #2189] [Feature] API call for getting account balance #15097

Closed
opened 2026-04-14 17:57:34 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @MirariFang on GitHub (Jan 7, 2024).
Original GitHub issue: https://github.com/actualbudget/actual/issues/2189

Verified feature request does not already exist?

  • I have searched and found no existing issue

💻

  • Would you like to implement this feature?

Pitch: what problem are you trying to solve?

Hi there, I'm trying to implement my own tools to interact with the Actual, but I didn't find any API calls that could simply give me the total balance of an account. Although I probably could just get all transactions with a super early starting date and sum them up, it's a little bit more tedious than getting the value in one go.
Just curious, is this intentional by design? Why the Account object can't simply include a "balance" field? Or am I missing anything?
Thanks.

Describe your ideal solution to this problem

Add balance field to Account, which has the current balance value of that account.

Teaching and learning

No response

Originally created by @MirariFang on GitHub (Jan 7, 2024). Original GitHub issue: https://github.com/actualbudget/actual/issues/2189 ### Verified feature request does not already exist? - [X] I have searched and found no existing issue ### 💻 - [ ] Would you like to implement this feature? ### Pitch: what problem are you trying to solve? Hi there, I'm trying to implement my own tools to interact with the Actual, but I didn't find any API calls that could simply give me the total balance of an account. Although I probably could just get all transactions with a super early starting date and sum them up, it's a little bit more tedious than getting the value in one go. Just curious, is this intentional by design? Why the `Account` object can't simply include a "balance" field? Or am I missing anything? Thanks. ### Describe your ideal solution to this problem Add `balance` field to `Account`, which has the current balance value of that account. ### Teaching and learning _No response_
GiteaMirror added the feature label 2026-04-14 17:57:34 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 7, 2024):

Thanks for sharing your idea!

This repository uses lodash style issue management for enhancements. That means enhancement issues are automatically closed. This doesn’t mean we don’t accept feature requests, though! We will consider implementing ones that receive many upvotes, and we welcome contributions for any feature requests marked as needing votes (just post a comment first so we can help you make a successful contribution).

The enhancement backlog can be found here: https://github.com/actualbudget/actual/issues?q=label%3A%22needs+votes%22+sort%3Areactions-%2B1-desc+

Don’t forget to upvote the top comment with 👍!

<!-- gh-comment-id:1879913689 --> @github-actions[bot] commented on GitHub (Jan 7, 2024): :sparkles: Thanks for sharing your idea! :sparkles: This repository uses lodash style issue management for enhancements. That means enhancement issues are automatically closed. This doesn’t mean we don’t accept feature requests, though! We will consider implementing ones that receive many upvotes, and we welcome contributions for any feature requests marked as needing votes (just post a comment first so we can help you make a successful contribution). The enhancement backlog can be found here: https://github.com/actualbudget/actual/issues?q=label%3A%22needs+votes%22+sort%3Areactions-%2B1-desc+ Don’t forget to upvote the top comment with 👍! <!-- feature-auto-close-comment -->
Author
Owner

@turt2live commented on GitHub (Apr 7, 2024):

In the meantime, developers can use the ActualQL feature:

// Get balances for all accounts as of a certain date
const balancesAllAccounts = (await runQuery(q('transactions')
    .filter({ date: { $lte: '2024-03-31' } })
    .groupBy('account.id')
    .select(['account.id', 'account.name', {balance: {$sum: "$amount"}}])
)).data;

// Get balance for a single account as of a certain date
const balanceMyAccount = (await runQuery(q('transactions')
    .filter({
        date: { $lte: '2024-03-31' },
        'account.id': 'YOUR-ACCOUNT-UUID-HERE',
    })
    .select(['account.id', 'account.name', {balance: {$sum: "$amount"}}])
)).data;

If you need the current balance as of 'today', either put that date into the filter or remove that condition entirely.

<!-- gh-comment-id:2041646614 --> @turt2live commented on GitHub (Apr 7, 2024): In the meantime, developers can use the [ActualQL](https://actualbudget.org/docs/api/actual-ql/) feature: ```js // Get balances for all accounts as of a certain date const balancesAllAccounts = (await runQuery(q('transactions') .filter({ date: { $lte: '2024-03-31' } }) .groupBy('account.id') .select(['account.id', 'account.name', {balance: {$sum: "$amount"}}]) )).data; // Get balance for a single account as of a certain date const balanceMyAccount = (await runQuery(q('transactions') .filter({ date: { $lte: '2024-03-31' }, 'account.id': 'YOUR-ACCOUNT-UUID-HERE', }) .select(['account.id', 'account.name', {balance: {$sum: "$amount"}}]) )).data; ``` If you need the current balance as of 'today', either put that date into the filter or remove that condition entirely.
Author
Owner

@github-actions[bot] commented on GitHub (Jul 10, 2024):

🎉 This feature has been implemented in #2930 and will be released in the next version. Thanks for sharing your idea! 🎉

<!-- gh-comment-id:2221436721 --> @github-actions[bot] commented on GitHub (Jul 10, 2024): :tada: This feature has been implemented in #2930 and will be released in the next version. Thanks for sharing your idea! :tada: <!-- feature-implemented-comment -->
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#15097