energy-api
The BDEW API-Webdienste Strom — the REST/JSON channel beside EDIFACT/AS4 — as
typed clients and matching Axum routers: MaLo-Ident, § 14a Steuern
(controlMeasures), the iMS Universalbestellprozess and the Verzeichnisdienst.
It implements the specifications at version 1.0.0 and the Regelungen zum
Übertragungsweg für API-Webdienste 1.2; makod mounts the routers on its
:8090 port. Process state and the decision what to answer stay with the
caller.
Example
use DirectoryServiceClient;
use Url;
let base = parse?;
let client = new_insecure?;
// The provider's EMT.API signature key, obtained from the issuing Sub-CA: the
// record is returned only when its JWS verifies against it.
let record = client
.get_record
.await?;
println!;
What it covers
| API | Parties | Purpose |
|---|---|---|
controlMeasures |
NB/LF ↔ MSB | Steuerbefehle (§ 14a EnWG) |
maloIdent |
LF ↔ NB | Marktlokations-Identifikation |
wimOrder |
NB ↔ MSB | iMS Universalbestellprozess, PIDs 11021–11023 |
directory |
all | Verzeichnisdienst — endpoint discovery by the provider's MP-ID |
server— onerouter(state)per API (control_measures,malo_ident,wim_order,directory::server).client— the MaLo-Ident callbacks;directory— the Verzeichnisdienst client, every record verified (directory::verify_record).- Content signing (TR-03116-3, RFC 8785 canonical JSON; RzÜ API-Webdienste 1.2 Kap. 3.3) and JWS verification are always compiled: a request is signed exactly when the client has a signing key.
- Identifiers are the validated
rubo4e::identifierstypes (MaloId,MeloId,NeloId,SrId,TrId,MarktpartnerIdasMarketPartnerId), soDeserializerefuses a wrong check digit at the API boundary.
BNetzA Mitteilung Nr. 58 keeps the channel at MaLo-Ident and Steuern — „Die
UTILTS bleibt damit erhalten". The 2.0.0 tag of EDI-Energy/api-electricity
(locationBundle, calculationFormula) is binding nowhere and not implemented.
Features
| Feature | Enables |
|---|---|
client |
MaLo-Ident and directory HTTP clients (reqwest + rustls) |
server |
Axum router factories |
websocket |
Verzeichnisdienst subscriptions (tokio-tungstenite); a pushed record that does not verify arrives as an Err |
None is on by default: cargo add energy-api --features client,server.
Sources
- EDI-Energy
api-electricityandapi-directory-service, version 1.0.0 - Regelungen zum Übertragungsweg für API-Webdienste 1.2
- BNetzA Mitteilung Nr. 58 (01.10.2026)
Architecture: API-Webdienste · API: https://docs.rs/energy-api
License: MIT OR Apache-2.0