C# is a general-purpose, multi-paradigm programming language. C# encompasses static typing, strong typing, lexically scoped, imperative, declarative, functional, generic, object-oriented, and component-oriented programming disciplines. This tutorial is how to get live forex rate using C# programming language.
REPLACE_ME
with your API key.base
value to a currency or remove this query param.currencies
value to a list of values or remove this query param. Below is an example usage for foreign exchange conversion API in use.For 2 and 3, you can find this documented at Offical Documentation
var options = new RestClientOptions("https://api.forexrateapi.com/v1/latest?api_key=REPLACE_ME&base=USD¤cies=EUR,JPY,CAD")
RestClient client = new RestClient(options);
RestRequest request = new RestRequest("", Method.Get);
RestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
var client = new RestClient("https://api.forexrateapi.com/v1/latest?api_key=REPLACE_ME&base=USD¤cies=EUR,JPY,CAD");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);