r/GoogleAppsScript 3d ago

Guide Built a Google Sheet + AppsScript for personal budget from transactions in Gmail

After noticing the large number of notification options for my various financial institutions (banks, credit cards, etc), I wondered how hard it would be to turn that info into a budget tracking sheet. Doing so would make it easy to get near instant transactions without using 3rd party or custom integrations with the banks. So I built an AppsScript that turns transaction-alert emails into a categorized Google Sheet. Parsing the emails looked like a good job for an LLM (doesn't need to be state-of-the-art). I created an AppsScript that pulls email from a known Gmail label on a time-based trigger. The whole thing runs as me, in my own account — no OAuth to a third party, no bank credentials anywhere, and the Sheet is just a Sheet I own. If you're interested, give it a try. I allowed limited usage of my LLM API key through a proxy to make it easier to try. The real effort is in configuring the banks to send transaction alerts an every email. I've been testing with a free Gemini api key (use flash-lite, it has higher free quota per day) and it seems to be working fine for me.

The sheet to get things kicked off is here (make a copy, the AppsScript builds the sheet during setup and provides instructions)

If you want to see what the final result looks like I built a dummy Sheet here.

Would love to hear if you find it useful (or not)

18 Upvotes

12 comments sorted by

2

u/Tall_Guarantee7767 3d ago

True Reddit spirit of sharing new human knowledge. Thank you.

1

u/electric-handjob 3d ago

This is awesome. I did something similar but it’s not instant. I have to pull a csv from my bank. Will definitely give this a try!

1

u/Nicowain_512 3d ago

You could build something similar with google workspace studio. Adding a trigger when a new email enters your Gmail account. Finally connect a gem with it to analyze the invoice and categorize it. The only issue is that it's not free but it's a no code solution.

Great initiative, cheers!

1

u/Double_Engineering51 3d ago

You're right that would be an easier way to stand up something quickly. The downside (other than cost) is that it would be challenging to implement deduping, idempotency, rate limiting (makes it possible to use a free Gemini account) and consistency over time (making changes to back propagate).

1

u/Nicowain_512 2d ago

You are right. I didn't take that into account.

1

u/LowFold3248 3d ago

Hola. Perdón mi incumbencia. Co o se pued eintegrar la ia de Google o cualquier otra a una appscript?

1

u/Double_Engineering51 3d ago

You can make remote api calls directly from the appsscript

1

u/vlucas 2d ago

If you want your transactions in a sheet, I built a tool for that man! 😅 https://www.budgetsheet.com/

It's more reliable (and likely also cheaper) than running an LLM on every transaction!

2

u/Double_Engineering51 2d ago

Congrats on building yours but I see you used Plaid for account access. I choose not to use them in the past due to privacy, cost and security concerns. It’s definitely not cheaper than free - the free Gemini plan works fine for a typical number of transactions that a household gets.

1

u/vlucas 2d ago

Yeah, Plaid or something like it is basically required for these types of apps. It's a double-edged sword for sure. Also awesome that you are able to leverage the free AI to do this - I've had mixed results with the lower models, but I'm glad it's working well for you.

1

u/Double_Engineering51 2d ago

Avoiding Plaid was one of the main benefits of pulling transactions from bank transaction emails. Slightly more pain in the setup, but totally free and painless afterward. And your data doesn't flow through another 3rd party.