API reference / Quittio \ Country \ DE \ Dunning
BundesbankBaseRates
final readonly class in quittio/country-de
Quittio\Country\DE\Dunning\BundesbankBaseRates · Source
Fetches the base rate according to section 247 BGB from the statistics API of the Deutsche Bundesbank (time series BBIN1.M.DE.BBK.BBKBAS2.EUR.ME, formerly SU0115). The series has a value per month; the rate changes on 1 January and 1 July, so the values of January and July are the table entries. A new rate appears once the Bundesbank has published the value of that month.
Constants#
| Constant | Value | Description |
|---|---|---|
URL | 'https://api.statistiken.bundesbank.de/rest/data/BBIN1/M.DE.BBK.BBKBAS2.EUR.ME?format=csv&lang=de&startPeriod=%s' |
Methods#
| Method | Description |
|---|---|
->__construct() | |
->fetch() | |
::parse() | Reads the January and July values of the CSV download ("2026-07;1,52;…"). |
__construct()#
public function __construct(
(Closure(string $url, int $timeout): string)|null $http = null,
int $timeout = 15,
)| Parameter | Type | Description |
|---|---|---|
$http | (Closure(string $url, int $timeout): string)|null = null | returns the response body, throws on failure |
$timeout | int = 15 |
fetch()#
public function fetch(string $since = '2002-01'): array<string, string>| Parameter | Type | Description |
|---|---|---|
$since | string = '2002-01' | first month (YYYY-MM) |
- Returns
array<string, string>– ISO date => rate in percent, e.g. ['2026-07-01' => '1.52']
parse()#
public static function parse(string $csv): array<string, string>Reads the January and July values of the CSV download ("2026-07;1,52;…").
| Parameter | Type | Description |
|---|---|---|
$csv | string |
- Returns
array<string, string>