Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
maurizuki authored Nov 14, 2023
1 parent 0c4517a commit 7f192ec
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
# ECB.Data.ExchangeRates

https://data.ecb.europa.eu/help/api/overview
[![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/maurizuki/ECB.Data.ExchangeRates/build.yml)](https://github.com/maurizuki/ECB.Data.ExchangeRates/actions/workflows/build.yml)
[![issues](https://img.shields.io/github/issues/maurizuki/ECB.Data.ExchangeRates)](https://github.com/maurizuki/ECB.Data.ExchangeRates/issues)
[![Nuget](https://img.shields.io/nuget/v/ECB.Data.ExchangeRates)](https://www.nuget.org/packages/ECB.Data.ExchangeRates)
[![Nuget](https://img.shields.io/nuget/dt/ECB.Data.ExchangeRates)](https://www.nuget.org/packages/ECB.Data.ExchangeRates)

Provides access to the EXR Dataflow (currency exchange rates) of [ECB Data Portal](https://data.ecb.europa.eu) web services.

## Getting started

To add ECB.Data.ExchangeRates to your project, you can use the following NuGet Package Manager command:

```PowerShell
Install-Package ECB.Data.ExchangeRates
```

More options are available on the [ECB.Data.ExchangeRates page](https://www.nuget.org/packages/ECB.Data.ExchangeRates) of the NuGet Gallery website.

The console application ECB.Data.ExchangeRates.ConsoleApp (ECBEXR.exe) is intended as an example on how to use the web services client in a real scenario.

## Remarks

The class ExchangeRatesClient is derived from [HttpClient](https://docs.microsoft.com/dotnet/api/system.net.http.httpclient) that is intended to be instantiated once and re-used throughout the life of an application. Instantiating an ExchangeRatesClient class for every request will exhaust the number of sockets available under heavy loads. This will result in SocketException errors. Below is an example using ExchangeRatesClient correctly.

```C#
public class GoodController : ApiController
{
private static readonly ExchangeRatesClient ExchangeRatesClient;

static GoodController()
{
ExchangeRatesClient = new ExchangeRatesClient();
}
}
```

## Documentation

* [ECB.Data.ExchangeRates API reference](https://github.com/maurizuki/ECB.Data.ExchangeRates/blob/main/docs/ECB.Data.ExchangeRates.md)
* [Official ECB Data Portal web services documentation](https://data.ecb.europa.eu/help/api)

0 comments on commit 7f192ec

Please sign in to comment.