TCMB API CLIENT
This Dart package provides a simple and efficient way to interact with the Central Bank of the Republic of Türkiye (TCMB) API. It allows you to fetch exchange rates and other related data.
Demo
Features
- Fetch exchange rate for current date
- Fetch exchange rates for a specific date
- Fetch a single rate for a specific currency and date
- Easy to use with a clean and simple API
Getting Started
To use this package, add tcmb_api_client
as a dependency in your pubspec.yaml file.
dependencies:
tcmb_api_client: ^0.0.1
Usage
Here's a simple example of using TcmbApiClient
to fetch exchange rates:
import 'package:tcmb_api_client/tcmb_api_client.dart';
Future<List<Currency>> fetchRates() async {
try {
return await _apiClient.getRates();
} catch (e) {
debugPrint('Error fetching rates: $e');
rethrow;
}
}
Future<Currency?> fetchUsdRate() async {
try {
return await _apiClient.getSingleRate(CurrencyCode.USD);
} catch (e) {
debugPrint('Error fetching rate: $e');
rethrow;
}
}
Testing and Coverage
This package includes a comprehensive suite of unit tests, which ensures the reliability and correctness of the package's functionality.
(Cov report added as an image just for now, will connect to a service later)
Disclaimer
Please note that this package is not affiliated with, officially connected to, or endorsed by the Central Bank of the Republic of Türkiye (TCMB). The package is developed and maintained independently. The official TCMB website can be found at https://www.tcmb.gov.tr. The name TCMB as well as related names, marks, emblems and images are registered trademarks of their respective owners.
Libraries
- tcmb_api_client
- A dart client for TCMB(Central Bank of the Republic of Türkiye) rate of exchanges API:
https://www.tcmb.gov.tr/kurlar/{date}.xml
, examples of date:today
,202404/22042024
. TCMB is the acronym used in Turkish for our central bank, that's why it used inTcmbAPiClient
class name (for convenience purposes)