All Projects → florianv → Swap

florianv / Swap

Licence: mit
💱 Currency exchange rates library

Projects that are alternatives of or similar to Swap

Android Money
Simple money and currency converter library for android.
Stars: ✭ 66 (-94.48%)
Mutual labels:  currency, currency-converter, money
currency-converter
💰 Easily convert between 32 currencies
Stars: ✭ 16 (-98.66%)
Mutual labels:  money, currency, currency-converter
react-local-currency
💵 💴Shows the price of your services in the customer's currency 💶 💷
Stars: ✭ 21 (-98.24%)
Mutual labels:  money, currency, currency-converter
Money
PHP implementation of Fowler's Money pattern.
Stars: ✭ 3,868 (+223.68%)
Mutual labels:  currency, currency-converter, money
Laravel Money
Currency formatting and conversion package for Laravel
Stars: ✭ 261 (-78.16%)
Mutual labels:  currency, currency-converter, money
Money
A money and currency library for PHP
Stars: ✭ 855 (-28.45%)
Mutual labels:  currency, currency-converter, money
Laravel Cconverter
A simple currency converter plugin for Laravel 5. Currency providers: The European Central Bank, OpenExchange, CurrencyLayer and fixer.io
Stars: ✭ 39 (-96.74%)
Mutual labels:  currency, currency-converter
Jsr354 Api
JSR 354 - Money and Currency API
Stars: ✭ 262 (-78.08%)
Mutual labels:  currency, money
Php Forex Quotes
PHP Library for fetching realtime forex quotes.
Stars: ✭ 61 (-94.9%)
Mutual labels:  currency, currency-converter
Vue Numeric
Input field component to display a formatted currency value based on Vue.js
Stars: ✭ 341 (-71.46%)
Mutual labels:  currency, money
currency-api
Free Currency Exchange Rates API with 150+ Currencies & No Rate Limits
Stars: ✭ 507 (-57.57%)
Mutual labels:  currency, currency-converter
Laravel Swap
💵 Currency exchange rates for Laravel and Lumen
Stars: ✭ 296 (-75.23%)
Mutual labels:  currency, currency-converter
Coinonline
A Cryptocurrency/Blockchain wallet app based on React Native
Stars: ✭ 59 (-95.06%)
Mutual labels:  currency, currency-converter
swift-currency
Type-safety and algorithms for working with money in Swift.
Stars: ✭ 88 (-92.64%)
Mutual labels:  money, currency
Dinero.js
Create, calculate, and format money in JavaScript and TypeScript.
Stars: ✭ 5,286 (+342.34%)
Mutual labels:  currency, money
Cashify
💸 Lightweight currency conversion library, successor of money.js
Stars: ✭ 329 (-72.47%)
Mutual labels:  currency, money
FinanceKit
FinanceKit is a Framework for iOS and Mac to build apps working with financial data, like money, currencies, stocks, portfolio, transactions and other concepts.
Stars: ✭ 15 (-98.74%)
Mutual labels:  money, currency
Forex Python
Foreign exchange rates, Bitcoin price index and currency conversion using ratesapi.io
Stars: ✭ 378 (-68.37%)
Mutual labels:  currency, currency-converter
Money
A precise, type-safe representation of a monetary amount in a given currency
Stars: ✭ 817 (-31.63%)
Mutual labels:  currency, money
Go Money
Go implementation of Fowler's Money pattern
Stars: ✭ 887 (-25.77%)
Mutual labels:  currency, money

Swap

Build status Total Downloads Scrutinizer Version

Swap allows you to retrieve currency exchange rates from various services such as Fixer or currencylayer and optionally cache the results. It is integrated to other libraries like moneyphp/money and provides a Symfony Bundle and a Laravel Package.

QuickStart

$ composer require php-http/curl-client nyholm/psr7 php-http/message florianv/swap
use Swap\Builder;

// Build Swap
$swap = (new Builder())

    // Use the Fixer.io service as first level provider
    ->add('fixer', ['access_key' => 'your-access-key'])
     
    // Use the currencylayer.com service as first fallback
    ->add('currency_layer', ['access_key' => 'secret', 'enterprise' => false])
     
->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'));

We recommend to use the services that support our project, providing a free plan up to 1,000 requests per day.

Documentation

The documentation for the current branch can be found here.

Sponsors 😍

We are proudly supported by the following exchange rate providers offering free plans up to 1,000 requests per day:

Fixer

Fixer is a simple and lightweight API for foreign exchange rates that supports up to 170 world currencies. They provide real-time rates and historical data, however, EUR is the only available base currency on the free plan.

currencylayer

Currencylayer provides reliable exchange rates and currency conversions for your business up to 168 world currencies. They provide real-time rates and historical data, however, USD is the only available base currency on the free plan.

Services

Here is the list of the currently implemented services:

Service Base Currency Quote Currency Historical
Fixer EUR (free, no SSL), * (paid) * Yes
currencylayer USD (free), * (paid) * Yes
coinlayer * Crypto (Limited standard currencies) * Crypto (Limited standard currencies) Yes
European Central Bank EUR * Yes
National Bank of Romania RON * Yes
Central Bank of the Republic of Turkey * TRY Yes
Central Bank of the Czech Republic * CZK Yes
Central Bank of Russia * RUB Yes
Bulgarian National Bank * BGN Yes
WebserviceX * * No
1Forge * (free but limited or paid) * (free but limited or paid) No
Cryptonator * Crypto (Limited standard currencies) * Crypto (Limited standard currencies) No
CurrencyDataFeed * (free but limited or paid) * (free but limited or paid) No
Open Exchange Rates USD (free), * (paid) * Yes
Xignite * * Yes
Currency Converter API * * Yes (free but limited or paid)
xChangeApi.com * * Yes
Array * * Yes

Additionally, you can add your own services as long as they implement the ExchangeRateService interface.

Integrations

Credits

License

The MIT License (MIT). Please see LICENSE for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].