This is a REST API client for the .NET plataform that gives you information about the dollar quotation for all business days for both withdraw and purchase.
Package | Version | Downloads | Workflow |
---|---|---|---|
Bacen.Dollar.Api.Client | |||
Bacen.Dollar.Api.Client.DependencyInjection |
- DailyDollarQuotationAsync: Gets the dollar quotation for a specific date;
var dollarQuotation = await client.DailyDollarQuotationAsync(
new DateTime(2023, 3, 17)
);
- PeriodicDollarQuotationAsync: Gets the dollar quotation for an specific date interval.
var dollarQuotation = await client.PeriodicDollarQuotationAsync(
new DateTime(2023, 3, 1),
new DateTime(2023, 3, 17)
);
This Api integration is ver simple, there is no authentication/authorization requirements, you can use it with almost no configurations.
You can instanciate this client in three different ways:
- Using default configs: This uses the default baseUrl, timeout and Throw on any error flag.
var client = new BacenDollarClient();
or by dependency injection:
services.AddBacenDollarApiClient();
- Only configurating the API base url:
var client = new BacenDollarClient(baseUrl);
or by dependency injection:
services.AddBacenDollarApiClient(baseUrl);
- And setup manually all configurations with your preferences:
var configs = new BacenDollarClientConfiguration
{
BaseUrl = baseUrl,
MaxTimeout = 10000,
ThrowOnAnyError = false
};
var client = new BacenDollarClient(configs);
or by dependency injection:
var configs = new BacenDollarClientConfiguration
{
BaseUrl = baseUrl,
MaxTimeout = 10000,
ThrowOnAnyError = false
};
services.AddBacenDollarApiClient(configs);