npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

monarch-money-api

v0.0.5

Published

Unofficial Monarch Money API

Downloads

609

Readme

Unofficial Monarch Money API

Monarch Image This is an unofficial Javascript API for Monarch Money. It is not endorsed by Monarch Money and may break at any time. Use at your own risk.

Installation

npm i monarch-money-api

Configuration

You will need to create a user token, that you will save as an environment variable in order to use the API.

Create a token using the CLI:

1. Create a file named login.js and add the following code:

import { interactiveLogin } from "monarch-money-api";

interactiveLogin();

Save.

2. Run the script and enter your credentials:

Enter this in your teminal and press enter:

node login.js

You will be prompted to enter your email, password, and 2FA code if you have 2FA enabled.

3. Save the token in your .env file:

After you have logged in, you will be given a token. Copy this token and add it to your .env file. (Create a .env file if you don't have one.)

MONARCH_TOKEN=your_token_here

[!TIP] If deploying to Vercel, you can add an environment variable in local and production environments with the vercel cli:

vercel env add token

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)

Vercel Example

You can deploy this to Vercel by creating a new project and adding the token as an environment variable. You can then use the API in your serverless functions.

If you want to use the API in a serverless function, you can create a new file in the api/budget.js directory and add the following code:

import { getBudgets } from "monarch-money-api";

export default async function handler(req, res) {
    try {
        const budgets = await getBudgets();
        console.log("Budgets:", budgets)
        
        res.status(200).json(budgets);
    } catch (error) {
        res.status(500).json({ error: error.message });
    }
}

API Methods

interactiveLogin(useSavedSession = true, saveSession = true)

login(email, password, useSavedSession = true, saveSession = true, mfaSecretKey = null)

multiFactorAuthenticate(email, password, code)

getAccounts()

getAccountTypeOptions()

getRecentAccountBalances(startDate = null)

getAccountSnapshotsByType(startDate, timeframe)

getAggregateSnapshots(startDate = null, endDate = null, accountType = null)

createManualAccount(accountType, accountSubType, isInNetWorth, accountName, accountBalance = 0)

updateAccount(accountId, accountName = null, accountBalance = null, accountType = null,accountSubType = null, includeInNetWorth = null, hideFromSummaryList = null, hideTransactionsFromReports = null)

deleteAccount(accountId)

requestAccountsRefresh(accountIds)

isAccountsRefreshComplete(accountIds = null)

requestAccountsRefreshAndWait(accountIds = null, timeout = 300, delay = 10)

getAccountHoldings(accountId)

getAccountHistory(accountId)

getInstitutions()

getBudgets(startDate = null, endDate = null, useLegacyGoals = false, useV2Goals = true)

getSubscriptionDetails()

getTransactionsSummary()

getTransactions({ limit = 100, offset = 0, startDate = null, endDate = null, search = "",categoryIds = [], accountIds = [], tagIds = [], hasAttachments = null, hasNotes = null, hiddenFromReports = null, isSplit = null, isRecurring = null, importedFromMint = null, syncedFromInstitution = null })

createTransaction({ date, accountId, amount, merchantName, categoryId, notes = "", updateBalance = false })

deleteTransaction(transactionId)

getTransactionCategories()

deleteTransactionCategory(categoryId)

deleteTransactionCategories(categoryIds)

getTransactionCategoryGroups()

createTransactionCategory({ groupId, transactionCategoryName, rolloverStartMonth = new Dat(), icon = "\u2753", rolloverEnabled = false, rolloverType = "monthly" })

createTransactionTag(name, color)

getTransactionTags()

setTransactionTags(transactionId, tagIds)

getTransactionDetails(transactionId, redirectPosted = true)

getTransactionSplits(transactionId)

updateTransactionSplits(transactionId, splitData)

Credits

This API is based on a lot of Monarch Money, a python library to access Monarch data.