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-ts

v0.2.0

Published

Unofficial Monarch Money API

Readme

Monarch Money TypeScript API & CLI

npm version CI License: MIT

An unofficial TypeScript client for the Monarch Money API with comprehensive Zod-validated types.

Disclaimer: This library is not affiliated with or endorsed by Monarch Money. It interacts with Monarch's internal GraphQL API, which may change without notice.

Installation

npm install monarch-money-ts
# or
pnpm add monarch-money-ts

CLI

The package also installs a monarch-money executable for scriptable access to the same APIs:

npx monarch-money-ts --help
monarch-money accounts list
monarch-money transactions list '{"limit":10}'
monarch-money schemas get input.transactions.list

The CLI uses JSON input and JSON output, supports stateful token caching with monarch-money auth login, and exposes named JSON Schemas for command inputs and outputs. See CLI.md for the full CLI guide.

Quick Start

import { FixedTokenAuthProvider, MonarchGraphQLClient, getAccounts } from 'monarch-money-ts';

const auth = new FixedTokenAuthProvider('your-monarch-token');
const client = new MonarchGraphQLClient();

const accounts = await getAccounts(auth, client);
console.log(accounts);

Authentication

The library provides two authentication strategies:

Fixed token — use a token extracted from an active browser session:

import { FixedTokenAuthProvider } from 'monarch-money-ts';

const auth = new FixedTokenAuthProvider(process.env.MONARCH_TOKEN);

Email/password — logs in via Monarch's auth endpoint, with optional TOTP support:

import { EmailPasswordAuthProvider } from 'monarch-money-ts';

const auth = new EmailPasswordAuthProvider({
  email: process.env.MONARCH_EMAIL,
  password: process.env.MONARCH_PASSWORD,
  totpKey: process.env.MONARCH_OTP_KEY, // optional
});

Both implement the AuthProvider interface and can be passed to any API function.

API Coverage

All API functions follow the same pattern: apiFunction(auth, client, options?). Every response is validated at runtime with Zod schemas.

This library covers a subset of Monarch Money's GraphQL API. The table below shows what's implemented and what's not yet available. Coverage is compared against the known API surface from the Python monarchmoney library.

| Domain | Operation | Status | Function | | ---------------- | ----------------------------------- | ------ | ------------------------------------------------ | | Accounts | List accounts | Done | getAccounts | | | Get account type options | -- | | | | Get recent account balances | -- | | | | Get account snapshots by type | -- | | | | Get aggregate snapshots (net worth) | -- | | | | Create manual account | -- | | | | Update account | -- | | | | Delete account | -- | | | | Refresh accounts (sync) | -- | | | | Get account history | -- | | | Transactions | List transactions | Done | getTransactions | | | Get transaction details | Done | getTransaction | | | Update transaction | Done | updateTransaction | | | Create transaction | -- | | | | Delete transaction | -- | | | | Get transaction splits | -- | | | | Update transaction splits | -- | | | | Get transactions summary | -- | | | Categories | List categories & groups | Done | getBudgetCategories, getBudgetCategoryGroups | | | Get category detail | Done | getBudgetCategory | | | Create category | -- | | | | Delete category | -- | | | Tags | List tags | -- | | | | Create tag | -- | | | | Set transaction tags | -- | | | Budgets | Get budget report | Done | getBudgetReport | | | Get budget status | Done | getBudgetStatus | | | Get budget settings | Done | getBudgetSettings | | | Set budget amount | -- | | | Portfolio | Get portfolio holdings | Done | getPortfolio | | Rules | List transaction rules | Done | getTransactionRules | | | Preview transaction rule | Done | previewTransactionRule | | | Create / update / delete rules | -- | | | Cash Flow | Get cash flow breakdown | -- | | | | Get cash flow summary | -- | | | Recurring | Get recurring transactions | -- | | | Institutions | List institutions | -- | | | Subscription | Get subscription details | -- | |

Contributions to expand coverage are welcome! See CONTRIBUTING.md for the traffic-driven workflow used to add new APIs.

Type System

The library exports Zod schemas and inferred TypeScript types for API responses and reusable API inputs:

import {
  type Account,
  AccountSchema,
  AccountFiltersInputSchema,
  type Transaction,
  TransactionSchema,
  GetTransactionsOptionsSchema,
} from 'monarch-money-ts';

How This Library Is Built

This library uses an AI-assisted agent workflow. Instead of reverse-engineering APIs manually, real traffic logs are captured from Monarch Money using a browser extension and analyzed with the traffic analyzer tool. An AI assistant then builds and validates the API schemas and client code from the observed requests and responses.

Every API module has a corresponding integration test that runs against the live Monarch GraphQL endpoint, so the Zod schemas are continuously validated against real responses. If Monarch changes their API shape, the strict schemas will fail on parse and surface the drift immediately.

Contributing

See CONTRIBUTING.md for development setup, testing, and contribution guidelines.

License

MIT