Swap is a PHP library designed to retrieve and manage currency exchange rates from multiple providers through a unified and extensible interface. It acts as an abstraction layer over various exchange rate APIs such as Fixer, currencylayer, and European Central Bank data sources, allowing developers to switch providers or combine them without changing application logic. The library supports both real-time and historical exchange rates, making it suitable for financial applications that require accurate and time-sensitive data. One of its key strengths is its ability to define fallback providers, ensuring reliability even if a primary data source fails. Swap also includes optional caching mechanisms to reduce API calls and improve performance in production environments. It integrates seamlessly with frameworks like Symfony and Laravel, making it easy to incorporate into existing PHP applications.
Features
- Unified interface for multiple exchange rate providers
- Support for real-time and historical currency data
- Fallback provider system for reliability
- Optional caching to improve performance
- Integration with Symfony and Laravel ecosystems
- Extensible architecture for adding custom providers