A PHP library for retrieving currency exchange rates from multiple services with caching and framework integrations.
Swap is a PHP library that provides a unified interface to fetch currency exchange rates from over 20 external services, including Fixer, currencylayer, and exchangeratesapi. It simplifies integrating real-time and historical exchange rate data into PHP applications with built-in caching and fallback support. The library acts as an abstraction layer, allowing developers to switch between providers without changing application code.
PHP developers building applications that require currency conversion, such as e-commerce platforms, financial tools, or international payment systems. It is particularly useful for those using Symfony or Laravel frameworks, as it offers dedicated integrations.
Developers choose Swap for its multi-service support with automatic fallback, which ensures reliability if a primary service fails. Its extensible design and built-in caching reduce API calls and allow for custom service integrations, making it a flexible and maintainable solution for exchange rate data.
PHP currency conversion library for retrieving exchange rates from 30 providers, with caching and fallback. Maintained since 2014.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports over 20 exchange rate services including Fixer, ECB, and Open Exchange Rates, ensuring wide currency coverage and redundancy for diverse needs.
Allows configuration of multiple providers with automatic fallback, minimizing downtime if a primary service fails, as shown in the QuickStart example with layered providers.
Enables retrieval of exchange rates for specific past dates via the historical() method, useful for financial reporting and compliance without switching services.
Includes dedicated bundles for Symfony and Laravel, simplifying integration in popular PHP frameworks and reducing boilerplate code.
Built-in caching reduces API calls, improving response times and lowering costs associated with rate limits, as highlighted in the documentation.
Requires installing multiple Composer packages like php-http/curl-client just for basic setup, which can complicate deployment and increase project footprint.
Most providers need API keys with free tiers limited to around 100 requests per month, insufficient for high-traffic applications and requiring paid upgrades.
Providers vary in support for historical data and available currencies, as seen in the services table, leading to potential gaps and the need for careful provider selection.