Skip to content

TheLe0/bacen-dollar-api-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bacen Dolar .NET Rest API Client

Test CI

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.

Packages

Package Version Downloads Workflow
Bacen.Dollar.Api.Client NuGet Version NuGet Downloads Deploy
Bacen.Dollar.Api.Client.DependencyInjection NuGet Version NuGet Downloads Deploy

Endpoints

  1. DailyDollarQuotationAsync: Gets the dollar quotation for a specific date;
var dollarQuotation = await client.DailyDollarQuotationAsync(
    new DateTime(2023, 3, 17)
);
  1. 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)
);

Configuration

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:

  1. 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();
  1. Only configurating the API base url:
var client = new BacenDollarClient(baseUrl);

or by dependency injection:

services.AddBacenDollarApiClient(baseUrl);
  1. 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);

About

.NET Client of the BACEN Dolar's REST API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages