BenjaminBiber.PSM-Api
0.0.1
dotnet add package BenjaminBiber.PSM-Api --version 0.0.1
NuGet\Install-Package BenjaminBiber.PSM-Api -Version 0.0.1
<PackageReference Include="BenjaminBiber.PSM-Api" Version="0.0.1" />
<PackageVersion Include="BenjaminBiber.PSM-Api" Version="0.0.1" />
<PackageReference Include="BenjaminBiber.PSM-Api" />
paket add BenjaminBiber.PSM-Api --version 0.0.1
#r "nuget: BenjaminBiber.PSM-Api, 0.0.1"
#:package BenjaminBiber.PSM-Api@0.0.1
#addin nuget:?package=BenjaminBiber.PSM-Api&version=0.0.1
#tool nuget:?package=BenjaminBiber.PSM-Api&version=0.0.1
BenjaminBiber.PSM-Api
A .NET client for the BVL PSM ORDS API plus small export helpers. It wraps the official endpoints, adds paging, and provides a convenience aggregation for "Mittel" data.
Install
dotnet add package BenjaminBiber.PSM-Api
Quick start
Register the HTTP client and options:
using BenjaminBiber.PSM_Api;
using BenjaminBiber.PSM_Api.Data.Options;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddPsmApiClients(options =>
{
options.BaseUrl = "https://psm-api.bvl.bund.de/ords/psm/api-v1/";
options.PageSize = 1000;
options.LanguageCode = "DE";
});
Or bind from configuration:
{
"PsmApi": {
"BaseUrl": "https://psm-api.bvl.bund.de/ords/psm/api-v1/",
"PageSize": 1000,
"LanguageCode": "DE"
}
}
builder.Services.AddPsmApiClients(options =>
builder.Configuration.GetSection("PsmApi").Bind(options));
Usage
Raw API access
Inject IPsmApiClient and call any endpoint. Many endpoints return JsonElement because the schema can vary.
using BenjaminBiber.PSM_Api.Data.Clients;
public sealed class MyService(IPsmApiClient client)
{
public Task<IReadOnlyList<MittelDto>> LoadAllMittelAsync(CancellationToken ct)
=> client.GetAllMittelAsync(ct);
}
Aggregated "Mittel" data
The aggregation loads Mittel, Wirkstoffe, and AWG data and merges it into a single model.
var data = await client.GetAggregatedMittelAsync(progress: null, cancellationToken);
CSV export helpers
The package ships simple helpers for CSV export. Register them manually:
using BenjaminBiber.PSM_Api.Data.Services;
builder.Services.AddSingleton<ExportColumnRegistry>();
builder.Services.AddSingleton<CsvBuilder>();
builder.Services.AddScoped<IPsmExportService, PsmExportService>();
Then build CSV output:
var csv = await exportService.BuildCsvAsync(columnIds, cancellationToken);
Options
PsmApiOptions:
BaseUrl(default:https://psm-api.bvl.bund.de/ords/psm/api-v1/)PageSize(default:1000)LanguageCode(default:DE) used forDeKodeAsync
Notes
- The client uses
HttpClientFactorywith namePsmApi. - All calls are async and accept
CancellationToken. - The ORDS API is public and does not require auth.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- Microsoft.Extensions.Caching.Memory (>= 9.0.0)
- Microsoft.Extensions.Http (>= 9.0.0)
- Microsoft.Extensions.Options (>= 9.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.