# bundesapi/marktstammdaten-api architecture

> Architecture diagram of the GitHub repository bundesapi/marktstammdaten-api, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bundesapi/marktstammdaten-api
- Repository: https://github.com/bundesapi/marktstammdaten-api

## Overview

This repository documents the Marktstammdatenregister (MaStR) public API and provides a generated Python client. The principal workflow is that a client requests public electricity-generation records, optionally using paging, sorting, and filter syntax; the client sends the request to MaStR and returns typed response data. A separate filter API exposes filter-column metadata for electricity and gas generation and consumption. The graph covers the sampled client runtime and documented API capabilities; unsampled endpoint internals are not inferred.

Main entry points: [`python-client/deutschland/marktstammdaten/api_client.py`](https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/api_client.py) (Request Client), [`python-client/deutschland/marktstammdaten/model_utils.py`](https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/model_utils.py) (Model Utilities), [`python-client/deutschland/marktstammdaten/api/daten_api.py`](https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/api/daten_api.py) (Generation Data API), [`python-client/deutschland/marktstammdaten/api/filter_api.py`](https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/api/filter_api.py) (Filter Metadata API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["MaStR API"]
  node_data_api["Generation Data API<br/>[daten_api.py]"]
  node_filter_api["Filter Metadata API<br/>[filter_api.py]"]
end

subgraph group_runtime["Python Client Runtime"]
  node_api_client["Request Client<br/>[api_client.py]"]
  node_configuration["Client Configuration<br/>[configuration.py]"]
  node_rest["HTTP Transport<br/>[rest.py]"]
  node_exceptions["Client Exceptions<br/>[exceptions.py]"]
end

subgraph group_models["API Models"]
  node_response["Generation Response"]
  node_entry["Generation Entry<br/>[entry.py]"]
  node_filter_model["Filter Definition<br/>[filter.py]"]
  node_filter_item["Filter List Item"]
  node_model_utils["Model Utilities<br/>[model_utils.py]"]
end

node_consumer(("Client User"))
node_mastr{{"MaStR Service"}}

node_consumer -->|"requests records"| node_data_api
node_consumer -->|"requests filter metadata"| node_filter_api
node_data_api -->|"dispatches request"| node_api_client
node_filter_api -->|"dispatches request"| node_api_client
node_api_client -->|"uses settings"| node_configuration
node_api_client -->|"sends HTTP"| node_rest
node_rest -.->|"calls API"| node_mastr
node_api_client -->|"raises errors"| node_exceptions
node_data_api -->|"parses response as"| node_response
node_response -->|"contains entries"| node_entry
node_filter_api -->|"uses model"| node_filter_model
node_filter_model -->|"uses list items"| node_filter_item
node_response -->|"uses utilities"| node_model_utils
node_entry -->|"uses utilities"| node_model_utils
node_filter_model -->|"uses utilities"| node_model_utils
node_filter_item -->|"uses utilities"| node_model_utils
node_model_utils -->|"raises errors"| node_exceptions

click node_data_api "https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/api/daten_api.py"
click node_filter_api "https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/api/filter_api.py"
click node_api_client "https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/api_client.py"
click node_configuration "https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/configuration.py"
click node_rest "https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/rest.py"
click node_exceptions "https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/exceptions.py"
click node_response "https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/model/einheit_einheit_json_get_erweiterte_oeffentliche_einheit_stromerzeugung_get200_response.py"
click node_entry "https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/model/entry.py"
click node_filter_model "https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/model/filter.py"
click node_filter_item "https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/model/filter_list_object_inner.py"
click node_model_utils "https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/model_utils.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_data_api,node_filter_api,node_consumer toneBlue
class node_api_client,node_configuration,node_rest,node_exceptions toneAmber
class node_response,node_entry,node_filter_model,node_filter_item,node_model_utils toneMint
class node_mastr toneIndigo
```

## Components

### MaStR API

- [Generation Data API](https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/api/daten_api.py): `python-client/deutschland/marktstammdaten/api/daten_api.py`
- [Filter Metadata API](https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/api/filter_api.py): `python-client/deutschland/marktstammdaten/api/filter_api.py`

### Python Client Runtime

- [Request Client](https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/api_client.py): `python-client/deutschland/marktstammdaten/api_client.py`
- [Client Configuration](https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/configuration.py): `python-client/deutschland/marktstammdaten/configuration.py`
- [HTTP Transport](https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/rest.py): `python-client/deutschland/marktstammdaten/rest.py`
- [Client Exceptions](https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/exceptions.py): `python-client/deutschland/marktstammdaten/exceptions.py`

### API Models

- [Generation Response](https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/model/einheit_einheit_json_get_erweiterte_oeffentliche_einheit_stromerzeugung_get200_response.py): `python-client/deutschland/marktstammdaten/model/einheit_einheit_json_get_erweiterte_oeffentliche_einheit_stromerzeugung_get200_response.py`
- [Generation Entry](https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/model/entry.py): `python-client/deutschland/marktstammdaten/model/entry.py`
- [Filter Definition](https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/model/filter.py): `python-client/deutschland/marktstammdaten/model/filter.py`
- [Filter List Item](https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/model/filter_list_object_inner.py): `python-client/deutschland/marktstammdaten/model/filter_list_object_inner.py`
- [Model Utilities](https://github.com/bundesapi/marktstammdaten-api/blob/main/python-client/deutschland/marktstammdaten/model_utils.py): `python-client/deutschland/marktstammdaten/model_utils.py`

### Other components

- **Client User**
- **MaStR Service**

## Connections

- Client User → Generation Data API: requests records (evidence: `README.md`)
- Client User → Filter Metadata API: requests filter metadata (evidence: `README.md`)
- Generation Data API → Request Client: dispatches request (evidence: `python-client/deutschland/marktstammdaten/api/daten_api.py`)
- Filter Metadata API → Request Client: dispatches request (evidence: `python-client/deutschland/marktstammdaten/api/filter_api.py`)
- Request Client → Client Configuration: uses settings (evidence: `python-client/deutschland/marktstammdaten/api_client.py`)
- Request Client → HTTP Transport: sends HTTP (evidence: `python-client/deutschland/marktstammdaten/api_client.py`)
- HTTP Transport → MaStR Service: calls API (evidence: `README.md`)
- Request Client → Client Exceptions: raises errors (evidence: `python-client/deutschland/marktstammdaten/api_client.py`)
- Generation Data API → Generation Response: parses response as (evidence: `python-client/deutschland/marktstammdaten/api/daten_api.py`)
- Generation Response → Generation Entry: contains entries (evidence: `python-client/deutschland/marktstammdaten/model/einheit_einheit_json_get_erweiterte_oeffentliche_einheit_stromerzeugung_get200_response.py`)
- Filter Metadata API → Filter Definition: uses model (evidence: `python-client/deutschland/marktstammdaten/api/filter_api.py`)
- Filter Definition → Filter List Item: uses list items (evidence: `python-client/deutschland/marktstammdaten/model/filter.py`)
- Generation Response → Model Utilities: uses utilities (evidence: `python-client/deutschland/marktstammdaten/model/einheit_einheit_json_get_erweiterte_oeffentliche_einheit_stromerzeugung_get200_response.py`)
- Generation Entry → Model Utilities: uses utilities (evidence: `python-client/deutschland/marktstammdaten/model/entry.py`)
- Filter Definition → Model Utilities: uses utilities (evidence: `python-client/deutschland/marktstammdaten/model/filter.py`)
- Filter List Item → Model Utilities: uses utilities (evidence: `python-client/deutschland/marktstammdaten/model/filter_list_object_inner.py`)
- Model Utilities → Client Exceptions: raises errors (evidence: `python-client/deutschland/marktstammdaten/model_utils.py`)
