helloserve.ExchangeRatesApi 1.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package helloserve.ExchangeRatesApi --version 1.3.0                
NuGet\Install-Package helloserve.ExchangeRatesApi -Version 1.3.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="helloserve.ExchangeRatesApi" Version="1.3.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add helloserve.ExchangeRatesApi --version 1.3.0                
#r "nuget: helloserve.ExchangeRatesApi, 1.3.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install helloserve.ExchangeRatesApi as a Cake Addin
#addin nuget:?package=helloserve.ExchangeRatesApi&version=1.3.0

// Install helloserve.ExchangeRatesApi as a Cake Tool
#tool nuget:?package=helloserve.ExchangeRatesApi&version=1.3.0                

helloserve.ExchangeRatesApi

This is a .NET Standard 2.0 client for the https://exchangeratesapi.io/ service. Available on Nuget.

Usage

Add it:

services.AddExchangeRatesApiClient(config => 
{
    config.ApiKey = "<key from your config or user secrets>";
});

Inject it:

public MyClass(IExchangeRatesApiClient exchangeRatesClient)
{

}

Call it:

double usdEurRate = exchangeRatesClient.GetLatestRates().Rates["EUR"];

Remarks

The IExchangeRatesApiClient interface provides methods and overloads to cover all the possible RESTfull route and query string combinations supported by the Exchange Rates API service. It is important to note that, when retreiving rates for a date on which no rates were reported, you will be given the closest rate published before that date. For example, if you request rates for 2017-12-17, you will instead get rates dated in the response to 2017-12-15. Additionally, when retreiving rates for a date range, the result will not includes entries for dates on which no rates were reported.

API Key

Version 1.1 adds support for the new access_key query parameter. The service (exchangeratesapi.io) recently expanded to a multi-tier pricing structure, which requires you to register for an API key.

Errors

The service recently changed to a success flag response model (instead of HTTP error codes), and so there is now an ExchangeRateApiException thrown when this flag is false. The ErrorCode property is enumerated according to their documentation, but it should be noted that not all errors have a code, and will be reported as unknown.

Limitations

Their subscription tier limitations are reported through the error reponses, but broadly for the free tier (which I suspect is what most people are interested in):

  • no HTTPS support, so configure the API URL accordingly.
  • doesn't support specifying a base currency, everything is reported in EUR.
  • doesn't support the /timeseries endpoint, e.g. the GetRatesForDateRangeAsync method group.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.3.1 88 10/9/2024
1.3.0 98 7/10/2024
1.2.0 448 4/12/2021
1.1.0 364 4/8/2021
1.0.0 465 7/6/2020