An HTTP API for serving up data contained within a Beancount ledger file.
The Beancount API is an HTTP API built on FastAPI and provides programmatic access to a Beancount ledger. It is OpenAPI compliant and provides rich access to the data contained within a ledger.
The quickest way to deploy the API is via a container:
docker run \
-v $(pwd)/testing/static.beancount:/run/beancount/main.beancount \
-p 8080:8080 \
ghcr.io/jmgilman/bapi
It can then be queried:
curl http://localhost:8080/v1/directive
The API provides several configuration options for securing access as well as automatically fetching ledger files from remote sources. See the docs for more in-depth usage and configuration information.
Endpoint | Description |
---|---|
/v1/account | Fetch, list, and realize all accounts in the ledger |
/v1/directive | Fetch all directives by type or generate Beancount syntax for each directive type |
/v1/file | Fetch the entire contents of the ledger file |
/v1/query | Fetch the results of querying the Beancount data using a BQL query |
/v1/realize | Performs a realization against the ledger |