Create a spreadsheet that automatically updates your bank account balance

Cover image for webscraping bank account balances


I've been writing a fair bit about web scraping on the blog lately and one of the things I've been able to achieve with web scraping is creating a spreadsheet that automatically updates your bank account balances using pocketbook.

I love spreadsheets and I've built a really cool finance spreadsheet that tracks everything including how my stocks are performing, what my net worth is, the current balance is of my bank accounts, and more.

Conventionally you would have to log into your bank account to check your balance and then pluck those numbers into your spreadsheet, however by leveraging the power of web scraping I've been able to develop my own API to pull those figures from pocketbook.

Pocketbook is a finance app that you can link to your bank accounts with a read-only token and pocketbook will automatically update your balances in the app, they also have a website which is where I'm scraping these figures from.

Initially I created the script in Azure functions however I discovered that I can basically operate all of my functions on the Google Cloud platform for free, whereas Microsoft Azure wanted to charge for a required storage dependency to use thier serverless function service, and I wasn't going to be using it enough to justify paying them money.

With a simple importdata function, my bank account balances are loaded into Google Sheets
With a simple importdata function, my bank account balances are loaded into Google Sheets.


How to webscrape your bank account balances

  1. Firstly, check if your bank account is supported by pocketbook at Pocketbook - Which banks do we currently support
  2. Signup for an account with Pocketbook and link your bank accounts
  3. Head over to my GitHub repository where you can grab my source code, the NodeJS folder is for Google Cloud Functions and the C# folder is for Microsoft Azure Functions, take your pick! github.com/lukegackle
  4. Navigate to cloud.google.com to create a new function and deploy the code, just change your username and password in the code and whalaaa, you have your own bank balance API
  5. If you haven't used Google Cloud Functions before I have a number of articles on this, check out Web scraping with request-promise as a good starter run through.

Automatically load your bank account balances into your spreadsheet

  1. Now that you have created and deployed your own API, you just need to import the data into your spreadsheet.
  2. Copy the unique trigger url to your Google Cloud function
  3. In your spreadsheet, simply type =importdata ("YOURURL")
  4. After a few seconds, you should have your data!
  5. Leave a comment letting me know how cool this is 😎



Icons made by Pixel perfect from www.flaticon.com

Was this helpful?

Yes No


Comments