# florianv/swap

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

Repository: https://github.com/florianv/swap
Canonical: https://ross.abutalabs.com/products/swap
Homepage: https://florianv.github.io/swap/
Language: PHP
License: MIT
License Family: permissive
Topics: php, currency, exchange-rates, currency-exchange-rates, money, currency-exchange, currency-converter, currency-rates, currency-conversion, exchange-rate-api, forex, forex-api, laravel, php-library, symfony, currency-conversion-library, php-currency-conversion
Last push: 2026-06-17T11:07:48+00:00

## Health v2 (maintenance only)
Score: 86/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 88, release rhythm 74, longevity 100
- inputs: {"age_days": 4499, "days_push": 77, "days_rel": 177, "gap_med": 0, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1339, forks 146 (observed 2026-08-28T04:04:25.938962+00:00)

## What it is
Swap is a PHP library for currency conversion and exchange rate retrieval, exposing 30+ rate providers behind a single API. It includes PSR-16 caching, historical rates, and a provider fallback chain, and has been maintained since 2014.

## Use cases
- convert EUR to USD in a PHP application
- get current exchange rates from multiple providers
- fetch historical exchange rates for a date
- build resilient currency conversion with provider fallback
- cache exchange rate lookups in PHP
- integrate exchange rates into a Laravel or Symfony app
- use free ECB or national bank rate sources

## When to choose
- you need exchange rates in PHP from many providers behind one interface
- you want caching and provider fallback built in
- you need historical as well as latest rates
- you want to avoid vendor lock-in to a single rate API

## When to avoid
- you need real-time forex trading tick data
- your stack is not PHP
- you need cryptocurrency-only rate conversion without fiat support

## Facets
- artifact type: library
- maturity: stable
- function: sdk, caching, http-client
- domain: fintech, apis, developer-tools
- platform: php
- tags: currency-conversion, exchange-rates, forex, psr-16, provider-fallback, historical-rates, laravel, symfony

## Member repositories
- florianv/swap (main) score 86

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:25.938962+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:43:54.486151+00:00, confidence not recorded.
  - readme: https://github.com/florianv/swap (fetched 2026-08-28T04:04:25.938962+00:00, sha d64ad02ad5a0)
  - homepage: https://florianv.github.io/swap/ (fetched 2026-08-29T12:02:50.231393+00:00, sha 4569cd80e795)
- Data as of 2026-08-30T08:39:29.467469+00:00.
