Command-line tool and TypeScript library

mastr

A dependency-light TypeScript client + CLI for the Marktstammdatenregister (MaStR) — the Bundesnetzagentur’s register of the German electricity & gas market: ~9 million generation and consumption units (solar, wind, storage, CHP, …). Wraps the public “erweiterte öffentliche Einheitensuche”. A bund.dev API.

Version 0.0.5 npm GitHub API reference

Install

Needs Node.js 20 or newer. Installs the mastr command:

npm i -g @maschinenlesbar.org/marktstammdatenregister-cli

Access

No account, no API key, no configuration — install and query.

Quick start

mastr stromerzeugung --total                       # how many electricity-generation units? → 9063887
mastr stromerzeugung --filter "Energieträger~eq~'2495'" --total   # …how many are solar? → 6267133
mastr stromerzeugung --sort "Bruttoleistung-desc" --page-size 20 --iso-dates
mastr gaserzeugung --page 1 --page-size 50
mastr filters stromerzeugung                        # the filterable columns + dropdown codes

Commands

All commands, arguments and options →

Claude Code skills

The mastr plugin teaches Claude to use mastr. Install it from the maschinenlesbar.org marketplace:

/plugin marketplace add maschinenlesbar-org/plugins
/plugin install mastr@maschinenlesbar

TypeScript library

@maschinenlesbar.org/marktstammdatenregister-cli is also a typed API client you can import in your own code, with no runtime HTTP dependencies.

The tool, not the data

The data comes from the provider behind the API, under its own terms — see DATA_LICENSE.md. The code is dual-licensed AGPL-3.0-or-later or commercial — see LICENSING.md.