Download the PHP package ceytek-labs/tcmb-services-lite without Composer
On this page you can find all versions of the php package ceytek-labs/tcmb-services-lite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ceytek-labs/tcmb-services-lite
More information about ceytek-labs/tcmb-services-lite
Files in ceytek-labs/tcmb-services-lite
Package tcmb-services-lite
Short Description A lightweight library for retrieving exchange rates and other data from TCMB's APIs.
License MIT
Homepage https://github.com/ceytek-labs/tcmb-services-lite
Informations about the package tcmb-services-lite
🇹🇷 Türkçe sürüm için buraya tıklayın
TCMB Services Lite
The TCMB (Central Bank of the Republic of Turkey) Services Lite is designed to help you easily utilize various data and APIs provided by the TCMB. Currently, it offers the feature of fetching exchange rates, but it can be expanded in the future to include other APIs from the TCMB.
Disclaimer: This package is not an official product of Central Bank of the Republic of Türkiye (Türkiye Cumhuriyet Merkez Bankası). The developers accept no responsibility for any issues, discrepancies, or damages that may arise from its use.
Requirements
- PHP 8.1 or higher
Installation
You can add this package to your projects using Composer:
Services
- TCMB Exchange Rates
- Display Raw XML Result from the API
- Display Raw JSON Result from the API
- Formatting Exchange Rates
- Getting All Exchange Rates
- Getting a Specific Currency
- Accessing Currency Information
- Displaying All Data in Object Format
- Displaying All Data in Array Format
- Supported Currencies
TCMB Exchange Rates
The TCMB Exchange Rates retrieves daily exchange rates from the Central Bank of Turkey, providing easy access to various currency information.
Example Usage
Here are a few examples of how you can use the TCMB Exchange Rates class in your PHP projects
⬆ Back to services
TCMB Exchange Rates: Display Raw XML Result from the API
⬆ Back to services
TCMB Exchange Rates: Display Raw JSON Result from the API
⬆ Back to services
TCMB Exchange Rates: Formatting Exchange Rates
You can receive data from the API in either object or array format. CamelCase is used in object format, and snake_case is used in array format.
⬆ Back to services
TCMB Exchange Rates: Getting All Exchange Rates
⬆ Back to services
TCMB Exchange Rates: Getting a Specific Currency
You can use the currency()
method to get data for a specific currency.
⬆ Back to services
TCMB Exchange Rates: Accessing Currency Information
You can access detailed information of a specific currency:
⬆ Back to services
TCMB Exchange Rates: Displaying All Data in Object Format
Sample output:
⬆ Back to services
TCMB Exchange Rates: Displaying All Data in Array Format
Sample output:
⬆ Back to services
TCMB Exchange Rates: Supported Currencies
The package supports the following currencies:
- 🇺🇸 USD: United States Dollar
- 🇦🇺 AUD: Australian Dollar
- 🇩🇰 DKK: Danish Krone
- 🇪🇺 EUR: Euro
- 🇬🇧 GBP: British Pound
- 🇨🇭 CHF: Swiss Franc
- 🇸🇪 SEK: Swedish Krona
- 🇨🇦 CAD: Canadian Dollar
- 🇰🇼 KWD: Kuwaiti Dinar
- 🇳🇴 NOK: Norwegian Krone
- 🇸🇦 SAR: Saudi Riyal
- 🇯🇵 JPY: Japanese Yen
- 🇧🇬 BGN: Bulgarian Lev
- 🇷🇴 RON: Romanian Leu
- 🇷🇺 RUB: Russian Ruble
- 🇮🇷 IRR: Iranian Rial
- 🇨🇳 CNY: Chinese Yuan
- 🇵🇰 PKR: Pakistani Rupee
- 🇶🇦 QAR: Qatari Riyal
- 🇰🇷 KRW: South Korean Won
- 🇦🇿 AZN: Azerbaijani Manat
- 🇦🇪 AED: United Arab Emirates Dirham
Debugging
- If the response from the API is invalid or an error occurs, an
Exception
will be thrown. - If the XML format is invalid, you will receive the following error:
Invalid XML format. Please check TcmbExchangeRates::make()->getResponse()
Future Plans
This package can be expanded to include other data and services provided by the TCMB, such as:
- Interest Rates: Fetching interest rates published by the TCMB.
- Inflation Data: Access to current inflation data.
- Other Financial Data: Integrating other statistics and reports provided by the TCMB.
Contributing
If you'd like to contribute, please send a pull request or report an issue.
License
This project is licensed under the MIT License.