Unofficial Monarch API
Programmatically work with your financial data on MonarchMoney.com
- #projects#Data#Visualization#Automation#Integrations
When Mint shut down, I had to hunt for another site to help manage and visualize my money. I settled on Monarch, but it didnt quite have every feature I was wanting, so this was born.
The Unofficial Monarch Money API
This project might be of interest to those who use Monarch Money for managing their finances. It's the Unofficial Monarch Money API, a JavaScript-based tool designed to offer programmatic access to your Monarch Money data.
What Is It?
The Unofficial Monarch Money API is a JavaScript library that allows users to interact with Monarch Money's data through code. It's important to note that this is an unofficial API, meaning it's not endorsed by Monarch Money and might change if the underlying service changes.
Getting Started
If you're interested in trying it out, installation is straightforward via npm:
npm i monarch-money-api
You'll need to create a user token to authenticate your requests. This involves running a small script to log in and save the token to an environment file. Once set up, you can access various methods to retrieve account information, manage transactions, and more.
Here's a simple usage example:
import { getAccounts, getBudgets } from "monarch-money-api";
const accounts = await getAccounts();
console.log("Accounts:", accounts);
const budgets = await getBudgets();
console.log("Budgets:", budgets);
Potential Use Cases
This API could be useful for developers who want to automate their financial tracking or integrate Monarch Money data into other applications.
For instance, I used it to create a chart widget of my flexible budgets using the Charty app for iOS. By deploying the API on Vercel, I have a hosted version always available. I set up a cron job to periodically refresh my financial data and used iOS shortcuts and the Charty app to build an always-up-to-date chart showing exactly how much is left in our flexible spending categories, sometimes referred to as the 'one number' budget. It's a simple way to monitor your expenses.
Technical Insights
All of the queries used in the API were derived by introspecting the GraphQL queries on the Monarch Money web application. This approach provided the necessary insights to access and manipulate the data programmatically.
Feel free to check out the project on GitHub for more details and instructions on how to get started.