PHPackages                             awmedia/swap - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. awmedia/swap

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

awmedia/swap
============

Exchange rates library for PHP

3.1.0(9y ago)0191MITPHPPHP ^5.5 || ^7.0

Since May 12Pushed 9y ago1 watchersCompare

[ Source](https://github.com/awmedia/swap)[ Packagist](https://packagist.org/packages/awmedia/swap)[ RSS](/packages/awmedia-swap/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (5)Versions (22)Used By (0)

[![](https://github.com/florianv/swap/raw/master/doc/logo.png)](https://github.com/florianv/swap/blob/master/doc/logo.png)

> Currency exchange rates library for PHP

[![Build status](https://camo.githubusercontent.com/a67b13d612939b229c57bcf71178a543c473517408afc4c7b58ca28e9c3a82d4/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f666c6f7269616e762f737761702e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/florianv/swap)[![Total Downloads](https://camo.githubusercontent.com/2cb2c020e35039d0a628d7fda792e56dae45c5e762d01ebcd3ce4412706e0641/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f666c6f7269616e762f737761702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/florianv/swap)[![Scrutinizer](https://camo.githubusercontent.com/b208ad777b89e4408ba323148074aab2a418a5e586c515f066a1f500f328a1e8/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f666c6f7269616e762f737761702e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/florianv/swap)[![Version](https://camo.githubusercontent.com/cba7b599a887890e9306165e8924f64a54722670d7d6c13daf63bda96279d615/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f666c6f7269616e762f737761702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/florianv/swap)

**Swap** allows you to retrieve currency exchange rates from various services such as [Fixer](http://fixer.io) or [Yahoo](https://finance.yahoo.com/) and optionally cache the results. It is integrated to other libraries like [`moneyphp/money`](https://github.com/moneyphp/money) and provides a [Symfony Bundle](https://github.com/florianv/FlorianvSwapBundle) and a [Laravel Package](https://github.com/florianv/laravel-swap).

QuickStart
----------

[](#quickstart)

```
$ composer require florianv/swap php-http/message php-http/guzzle6-adapter
```

```
use Swap\Builder;

// Build Swap with Fixer.io
$swap = (new Builder())
    ->add('fixer')
    ->build();

// Get the latest EUR/USD rate
$rate = $swap->latest('EUR/USD');

// 1.129
$rate->getValue();

// 2016-08-26
$rate->getDate()->format('Y-m-d');

// Get the EUR/USD rate 15 days ago
$rate = $swap->historical('EUR/USD', (new \DateTime())->modify('-15 days'));
```

Documentation
-------------

[](#documentation)

The complete documentation can be found [here](https://github.com/florianv/swap/blob/master/doc/readme.md).

Services
--------

[](#services)

Here is the list of the currently implemented services.

ServiceBase CurrencyQuote CurrencyHistorical[Fixer](http://fixer.io)\*\*Yes[European Central Bank](http://www.ecb.europa.eu/home/html/index.en.html)EUR\*Yes[Google](http://www.google.com/finance)\*\*No[Open Exchange Rates](https://openexchangerates.org)USD (free), \* (paid)\*Yes[Xignite](https://www.xignite.com)\*\*Yes[Yahoo](https://finance.yahoo.com)\*\*No[WebserviceX](http://www.webservicex.net/ws/default.aspx)\*\*No[National Bank of Romania](http://www.bnr.ro)RON\*No[Central Bank of the Republic of Turkey](http://www.tcmb.gov.tr)\*TRYNo[Central Bank of the Czech Republic](http://www.cnb.cz)\*CZKNo[Russian Central Bank](http://http://www.cbr.ru)\*RUBYes[currencylayer](https://currencylayer.com)USD (free), \* (paid)\*YesIntegrations
------------

[](#integrations)

- A Symfony Bundle [FlorianvSwapBundle](https://github.com/florianv/FlorianvSwapBundle)
- A Laravel Package [florianv/laravel-swap](https://github.com/florianv/laravel-swap)

Credits
-------

[](#credits)

- [Florian Voutzinos](https://github.com/florianv)
- [All Contributors](https://github.com/florianv/swap/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](https://github.com/florianv/swap/blob/master/LICENSE) for more information.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 79.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~52 days

Total

21

Last Release

3383d ago

Major Versions

1.x-dev → v2.0.02015-01-15

2.x-dev → v3.0.02016-09-18

PHP version history (4 changes)v1.0.0PHP &gt;=5.3.3

v2.0.0PHP &gt;=5.4.0

v3.0.0PHP ^5.5|^7.0

3.0.2PHP ^5.5 || ^7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8768675?v=4)[Jerry Sietsma](/maintainers/awmedia)[@awmedia](https://github.com/awmedia)

---

Top Contributors

[![florianv](https://avatars.githubusercontent.com/u/1586668?v=4)](https://github.com/florianv "florianv (139 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (20 commits)")[![ahubers](https://avatars.githubusercontent.com/u/7432558?v=4)](https://github.com/ahubers "ahubers (4 commits)")[![awmedia](https://avatars.githubusercontent.com/u/8768675?v=4)](https://github.com/awmedia "awmedia (3 commits)")[![tyx](https://avatars.githubusercontent.com/u/245494?v=4)](https://github.com/tyx "tyx (2 commits)")[![ugurerkan](https://avatars.githubusercontent.com/u/473959?v=4)](https://github.com/ugurerkan "ugurerkan (2 commits)")[![vinkla](https://avatars.githubusercontent.com/u/499192?v=4)](https://github.com/vinkla "vinkla (2 commits)")[![pborreli](https://avatars.githubusercontent.com/u/77759?v=4)](https://github.com/pborreli "pborreli (1 commits)")[![necenzurat](https://avatars.githubusercontent.com/u/145449?v=4)](https://github.com/necenzurat "necenzurat (1 commits)")[![avataru](https://avatars.githubusercontent.com/u/209354?v=4)](https://github.com/avataru "avataru (1 commits)")

---

Tags

moneycurrencyconversionRateexchange rates

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/awmedia-swap/health.svg)

```
[![Health](https://phpackages.com/badges/awmedia-swap/health.svg)](https://phpackages.com/packages/awmedia-swap)
```

###  Alternatives

[florianv/swap

PHP currency conversion library for retrieving exchange rates from 30+ providers, with caching and fallback.

1.3k6.8M23](/packages/florianv-swap)[brick/money

Money and currency library

1.9k40.4M145](/packages/brick-money)[ujjwal/currency-converter

Currency Converter Class with features of caching and identifying currency from country Code

49228.8k](/packages/ujjwal-currency-converter)[florianv/swap-bundle

Drop-in Symfony bundle for currency conversion: configurable services, multi-provider exchange rates with fallback and caching.

63425.7k1](/packages/florianv-swap-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
