Python script and Shortcut to view the amount invested

Hi all

Just made a small python script that lets you check the amount that has been invested in Monzo so far.

I’ve seen lots of people saying the site is behind, so if you run this it will quickly tell you how much has been invested.

To run, you’ll need to have Beautiful Soup and URLlib.

I also made a Shortcut that runs in the Shortcuts app:

Hope you find it useful!



Just curious… the endpoint returns JSON for me… how does this BeautifulSoup thing even parse it?

I’m pretty new to Python and it was the only way I knew how to scrape a site. I tried to use Requests but couldn’t figure it out.

Thanks! :slightly_smiling_face:

1 Like

Also I don’t really know what category this should be in, so apologies if it is in the wrong one!

Or an alternative in JavaScript. Just press F12 in Chrome to open up Developer Tools, go to the Console and paste this in and then press Return!

(await (await fetch("")).json()).invested_amount

Or the fatter (and friendly) version of the above:

let url = ""

let response = await fetch(url)

let data = await response.json()

1 Like

I have no experience in JavaScript. Wanted to try using the API in Python as I haven’t every done something like it before. :slight_smile:

1 Like

Given that the endpoint provides JSON, something like this might be easier:

data = requests.get("").json()

where data is a dictionary with the same keys/values as the JSON.


I’ll try it out now - thanks!

1 Like

Wow, thats a lot neater! I’m going to implement it and update the script.

1 Like

Can’t seem to get it to work. Having issues splitting it for the investment variable.

Also just made a Shortcut! Shortcuts

Ultimately, you could tidy up some of the casting/string manipulation, but keeping it close to your original version:

1 Like

Thank you! Looks a lot cleaner. Thanks for your help :slightly_smiling_face:

Is it ok if I update the repo, or do you want to make a pull request?



I’ve no problem with you updating your repo with it.


Neat! I was going to make something like this but hitting refresh was lower effort :sweat_smile:

1 Like

Glad you like it!

I made it as I hadn’t used Python in a while and wanted to try out using an API. Was a fun little project!


Cool! I am trying to fetch information from my account using python and requests, but I am getting errors when attempt to authenticate. Have you tried it before? Could you help me please? Cheers!

Hello, I haven’t used that part of the api so wouldn’t know. Sorry!

I tried Tommy5dollar’s recipe and got this as an answer… 199999955400

I guess those are Venezuelan Bolivars or somesuch? :grinning:

Divide it by 10,000 and you get £19,999,995.54, just a tad below the £20m because +1 share would put it over £20m :wink: