TCMBRatesClient 1.0.1

dotnet add package TCMBRatesClient --version 1.0.1                
NuGet\Install-Package TCMBRatesClient -Version 1.0.1                
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="TCMBRatesClient" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TCMBRatesClient --version 1.0.1                
#r "nuget: TCMBRatesClient, 1.0.1"                
#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 TCMBRatesClient as a Cake Addin
#addin nuget:?package=TCMBRatesClient&version=1.0.1

// Install TCMBRatesClient as a Cake Tool
#tool nuget:?package=TCMBRatesClient&version=1.0.1                

TCMBRatesClient

TCMBRatesClient is a .NET library for fetching exchange rates from the Central Bank of Turkey (TCMB). This package simplifies retrieving hourly exchange rate data as XML from the TCMB's official service.


Features

  • Fetch exchange rate data for specific dates and times.
  • Parse XML responses into strongly-typed models.
  • Easy integration with .NET applications.

Installation

Install the package via NuGet Package Manager:

dotnet add package TCMBRatesClient

Or use the Visual Studio NuGet Package Manager UI to search for TCMBRatesClient.


Usage

Basic Example

Below is an example of fetching exchange rate data for a specific date and time:

using TCMBRatesClient.TCMBClient;

var client = TcmbRates.CreateClient();
var rates = await client.GetRatesAsync(DateTime.Now);

foreach (var rate in rates.ExchangeRates)
{
    Console.WriteLine($"{rate.CurrencyCode}: {rate.BuyRate}");
}

Models

TcmbResponse

The response model contains the following properties:

  • HeaderInfo: Metadata about the response, such as the timestamp.
  • ExchangeRates: A list of ExchangeRate objects.

ExchangeRate

Represents individual exchange rates with:

  • CurrencyCode (e.g., USD, EUR)
  • BuyRate (decimal)

Contribution

Contributions are welcome! If you encounter a bug or have suggestions, please open an issue or submit a pull request on the GitHub repository.


License

This package is licensed under the MIT License. See the LICENSE file for more details.


Contact

For inquiries or support, please contact:

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net9.0

    • No dependencies.

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.0.1 29 11/25/2024
1.0.0 28 11/25/2024