PHPackages                             rackbeat/php-currency-api - 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. [API Development](/categories/api)
4. /
5. rackbeat/php-currency-api

ActiveLibrary[API Development](/categories/api)

rackbeat/php-currency-api
=========================

Wrapper for multiple currency rate APIs

7331PHP

Since Jun 25Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Rackbeat/php-currency-api)[ Packagist](https://packagist.org/packages/rackbeat/php-currency-api)[ RSS](/packages/rackbeat-php-currency-api/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

API Wrapper for popular currency rate APIs
==========================================

[](#api-wrapper-for-popular-currency-rate-apis)

Dont worry about your favorite service suddenly shutting down or switching plans on you. Switch away easily.

 [![Build Status](https://camo.githubusercontent.com/9cf6a464b58dde8d2454a81c17b5939bea207f383b1a73e7369a49a555be4bab/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f5261636b626561742f7068702d63757272656e63792d6170692e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Rackbeat/php-currency-api)[![Coverage](https://camo.githubusercontent.com/9a584a51889d4c869350e656175eafbdaddcf8a8e39e72d4a01c86b63a11b89a/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f5261636b626561742f7068702d63757272656e63792d6170692e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/github/Rackbeat/php-currency-api)[![Total Downloads](https://camo.githubusercontent.com/455cfdca9e0ddbe6500bcb3b4ec32e03e6a2ec4fbb30d38182eb79232c0ed34c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7261636b626561742f7068702d63757272656e63792d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rackbeat/php-currency-api)[![Latest Stable Version](https://camo.githubusercontent.com/7c439d626081f4b52825db5661dd90549da6ab15b4b98fa89abd2b76524e68fb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7261636b626561742f7068702d63757272656e63792d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rackbeat/php-currency-api)[![License](https://camo.githubusercontent.com/50c7c748e1b0eac0e0bd1de18c6d2082b616948bf9e424d9231e9286ae563345/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7261636b626561742f7068702d63757272656e63792d6170692e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rackbeat/php-currency-api)

Supported APIs
--------------

[](#supported-apis)

- [FixerIO](https://fixer.io) = fixerio
- [CurrencyLayer](https://currencylayer.com) coming soon = currencylayer
- [Open Exchange Rates](https://openexchangerates.org) coming soon = open\_exchange\_rates
- [json rates](http://jsonrates.com) coming soon = json\_rates
- [Currency Converter API](https://www.currencyconverterapi.com) coming soon = currency\_converter\_api

Installation
------------

[](#installation)

You just require using composer and you're good to go!

```
composer require rackbeat/php-currency-api
```

If you're using Laravel, a service provider and facade is included to provide configuration of driver etc.

Usage
-----

[](#usage)

### Initialize instance

[](#initialize-instance)

```
$api = Rackbeat\Currency\API::make('fixerio'); // driver from supported drivers.
```

### Set base currency (default = USD)

[](#set-base-currency-default--usd)

```
$api->setBase(Rackbeat\Currency\Symbol::USD);
```

### Set symbols to return (default = all/\[\])

[](#set-symbols-to-return-default--all)

```
$api->setSymbols([ Rackbeat\Currency\Symbol::DKK, Rackbeat\Currency\Symbol::EUR, Rackbeat\Currency\Symbol::USD ]);
```

*Please note, you are not required to use `Rackbeat\Currency\Symbol` to specify symbols. It's simply a convenience helper.*

### Get latest rates

[](#get-latest-rates)

```
$api->get(); // Get latest rates for selected symbols, using set base currency
$api->get('DKK');  // Get latest rates for selected symbols, using DKK as base currency
```

### Convert amount from one currency to another

[](#convert-amount-from-one-currency-to-another)

```
$api->convert($fromCurrency = 'DKK', $toCurrency = 'EUR', 10.00); // Convert 10 DKK to EUR
```

### Get rate on specific date

[](#get-rate-on-specific-date)

```
$api->historical($date = '2018-01-01'); // Get currency rate for base on 1st of January 2018
$api->historical($date = '2018-01-01', 'GBP'); // Get currency rate for GBP on 1st of January 2018
```

Laravel
-------

[](#laravel)

... todo

Requirements
------------

[](#requirements)

- PHP &gt;= 7.1
- Possibly a paid plan for your desired API. Check their pricing.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/fd953630eb9784e977637a0fe53be91b9dd4b0262a5b5b1fa9277e0c2806b65c?d=identicon)[lasserafn](/maintainers/lasserafn)

---

Top Contributors

[![LasseRafn](https://avatars.githubusercontent.com/u/2689341?v=4)](https://github.com/LasseRafn "LasseRafn (3 commits)")

### Embed Badge

![Health badge](/badges/rackbeat-php-currency-api/health.svg)

```
[![Health](https://phpackages.com/badges/rackbeat-php-currency-api/health.svg)](https://phpackages.com/packages/rackbeat-php-currency-api)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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