A .NET Standard Library for using the Rates Exchange API.
NuGet: Install-Package RatesExchangeApi
The main class is RatesExchangeApiService
. When using it you will need provide your API key after signing up for an account.
An example console app is included. In order to use it replace the [YOUR_API_KEY]
with your own API key from rates exchange api.
using RatesExchangeApi;
using RatesExchangeApi.Models;
...
var client = new RatesExchangeApiService("[YOUR_API_KEY]");
...
...
var result = await client.CheckIfApiIsOnline();
...
...
var rates = await client.GetLatestRates("USD");
...
List<string> isoCurrencies = new List<string> { "USD", "CHF", "GBP", "AUD", "JPY" };
var rates = await client.GetLatestRates("USD", isoCurrencies);
...
...
var rates = await client.ConvertCurrency("USD", "120", "2018-06-01");
...
NUnit is used for some simple integration tests with the actual web service. To run the tests, a valid API key must be added. Replace the [YOUR_API_KEY]
in ApiTests.cs
with your own API key from rates exchange api.
You can see an example usage in the api tests.
Vassilis Voutsas, [email protected]
ECB Currency Converter is released under the MIT license. See LICENSE for more information.