Succinct way to pull down live balance programmatically?

Hello!

I’m looking into a way to programmatically pull down my Monzo current account balance. I’ve had a read through the API docs, and I’ve been able to manually make requests to get the data I need, but I understand that the access tokens periodically expire. The ideal end state is to be be able to access my Monzo balance with a Tasker trigger. I’ve got a Raspberry Pi that’s exposed an endpoint on my network that my android devices can interact with fine, I’m just struggling with a way to hard code the authentication and leave it alone on a cron job instead of manually having to faff about with emails, apps, and OAuth shenanigans. I had a brief look around a handful of Python wrappers but to no avail.

For what it’s worth, I’ve currently not got Monzo Plus/Premium, but I am exporting my transactions to a Google Sheet using this IFTTT applet : Log my card purchases to a spreadsheet - IFTTT . From what I can tell, this does not post any deposits into the account, only withdrawals and expenditures, so it doesn’t work great when trying to pull balance info. It only lists money going out of the account, not money going in.

I’ve had an interesting read through a few other threads on a similar wavelength, notably this one (IFTTT + Google Sheets + Monzo = Then what? - #170 by Scrappy04), but it seemed a lot more manual/spreadsheet heavy with fancy spreadsheet editing and manipulating stuff into graphs. I literally just want a little script on my Pi to pull down a number and expose it. Any ideas or resources I’ve overlooked would be ace, thanks very much!

Hi. Welcome. Lots of ifs coming, but bare with…

IF you just want current balance and IF you join Plus/Premium, then there’s nothing fancy involved to get something this simple.

=SUM(H:H)

That will give you the balance of your current account. If you have pots, then it get a little more complex, but not a lot.

Main Balance =SUM(H:H)
Bills Bills Bills Pot =SUMIFS(H:H,E:E,“Bills Bills Bills Pot”)
Etc etc

Not sure what you’d want to do after this and whether that helps or not.

If you were to use the api. Once the initial tokens have been swapped and the permissions given in the app you can take care of refreshing the tokens without human interaction.

Bit of a self plug but take a look at

And the associated docs at

https://monzo-api.readthedocs.io/en/latest/

Even if not interested in using the python package there are a couple of pages about setting up the token etc

1 Like