C# Example Code

To access our API in C# you can do this in a number of ways.


The simplest way is to use our NuGet package. This contains functions for all common exchange rate API lookups and does not need any complicated REST calls.

The package name is "ExchangerateLab.Net" and can be installed using the package manager console or via the package browser

    Install-Package Exchangeratelab.Net

Once your package is installed:

    using ExchangerateLab.Net;

    static void Main(string[] args)
        ExchangeRateResponse e = ExchangeRateLabHelper.GetRates("YOURAPIKEY");

Restsharp Example

If you do not want to use the nuget package we recommend restsharp for making standard REST requests. Your requests should always include the API key in the request.

            var client = new RestClient("http://api.exchangeratelab.com/");
            var request = new RestRequest("api/current", Method.GET);
            request.AddParameter("apikey", apikey);
            IRestResponse response = client.Execute(request);
            var content = response.Content; // raw content as string
ExchangeRateLab © 2013 - 2015