Skip to main content
The official SDKs work with the same public API this section describes. They have methods for accounts, transactions, categories, budgets, recurring payments, analytics, custom sources, events and the change feed. They retry by themselves after a network failure or a temporary error, and check webhook signatures for you. The code is open: degroshi-js and degroshi-python.

Install

The current versions are 1.0.0-beta.10 for JavaScript and 1.0.0b10 for Python (19 November 2026). What changed in each version is in the repository’s CHANGELOG. The JavaScript SDK has no dependencies and runs on Node 20+, Bun, Deno and edge runtimes. The Python SDK needs Python 3.11+. While 1.0 is in beta, pip installs it only with --pre. The JavaScript package is an ES module, but from 1.0.0-beta.1 on Node 20.19+ and 22.12+ you can also load it with const { Degroshi } = require("degroshi").

The first request

Create a key under “Settings” › “For developers” and pass it to the client. Without one, the client reads the DEGROSHI_API_KEY environment variable. Keep the key on a server: in a browser, anyone can see it. Everything about keys: API keys.
If the key works in several spaces, pass the space too: new Degroshi({ apiKey, spaceId }) or Degroshi(api_key, space_id=...). See Spaces.

Keeping a copy

changes.iterate() reads the change feed, GET /v1/changes: everything that changed since your cursor, deletions included, in the order the changes were saved. Without a cursor it starts with every object. The SDK reads every page itself; after the loop, save feed.cursor and pass it next time:
changes.iterate() returns a ChangeFeed, and on AsyncDegroshi an AsyncChangeFeed for async for. A cursor that can’t continue (the space’s access changed, or 180 days passed) throws a DegroshiError with status 410 and code CHANGES_RESYNC_REQUIRED: read everything again without a cursor and replace the copy. How the feed works, and a Google Sheets recipe: Keeping a copy.

Good to know

  • Amounts. The JavaScript SDK returns amounts as strings, as the API sends them ("642.30"), and the Python SDK as Decimal, so no cent is lost to rounding.
  • Safe retries. Requests that create transactions or write to custom sources send an Idempotency-Key, so a retry after a dropped connection doesn’t record the transaction twice. See Safe retries.
  • A retried delete. When the answer to a delete is lost (a dropped connection, a timeout, a 5xx), the SDK retries it. If the retry no longer finds the row (404), the delete counts as done, because the first try made it: the SDK returns a 204 with X-Degroshi-Retried-Delete: true (RETRIED_DELETE_HEADER). A 404 on the first try still throws NotFoundError.
  • Types. Every method returns its own response type, so your editor knows the fields. In Python that holds for Degroshi and AsyncDegroshi alike, and the request and response models are in degroshi.models. Python writes take a model or a plain dict in the API’s JSON shape.
Errors, paged lists, webhooks and versions are in each repository’s README. Report a bug in an SDK or ask for something in the repository’s issues on GitHub.

What’s next

degroshi-js

The JavaScript and TypeScript SDK on GitHub.

degroshi-python

The Python SDK on GitHub.

API keys

Create a key, pick its access and its space.

Errors

Error codes and what to do about them.