PHPackages                             fadion/fixerio - 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. fadion/fixerio

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

fadion/fixerio
==============

Wrapper for Fixer.io

2.0.0(8y ago)49337.7k↑32.7%18[5 issues](https://github.com/fadion/Fixerio/issues)[4 PRs](https://github.com/fadion/Fixerio/pulls)MITPHPPHP &gt;=5.4.0

Since Nov 18Pushed 2y ago4 watchersCompare

[ Source](https://github.com/fadion/Fixerio)[ Packagist](https://packagist.org/packages/fadion/fixerio)[ RSS](/packages/fadion-fixerio/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (6)Used By (0)

Thin wrapper for Fixer.io
=========================

[](#thin-wrapper-for-fixerio)

A thin wrapper for [Fixer.io](http://www.fixer.io), a service for foreign exchange rates and currency conversion. It provides a few methods to easily construct the url, makes the api call and gives back the response.

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

[](#installation)

- Add the package to your composer.json file and run `composer update`:

```
{
    "require": {
        "fadion/fixerio": "~1.0"
    }
}
```

Laravel users can use the Facade for even easier access.

- Add `Fadion\Fixerio\ExchangeServiceProvider::class` to your `config/app.php` file, inside the `providers` array.
- Add a new alias: `'Exchange' => Fadion\Fixerio\Facades\Exchange::class` to your `config/app.php` file, inside the `aliases` array.

Usage
-----

[](#usage)

Let's get the rates of EUR and GBP with USD as the base currency:

```
use Fadion\Fixerio\Exchange;
use Fadion\Fixerio\Currency;

$exchange = new Exchange();
$exchange->key("YOUR_ACCESS_KEY");
$exchange->base(Currency::USD);
$exchange->symbols(Currency::EUR, Currency::GBP);

$rates = $exchange->get();
```

By default, the base currency is `EUR`, so if that's your base, there's no need to set it. The symbols can be omitted too, as Fixer will return all the supported currencies.

A simplified example without the base and currency:

```
$rates = (new Exchange())->key("YOUR_ACCESS_KEY")->get();
```

The `historical` option will return currency rates for every day since the date you've specified. The base currency and symbols can be omitted here to, but let's see a full example:

```
$exchange = new Exchange();
$exchange->key("YOUR_ACCESS_KEY");
$exchange->historical('2012-12-12');
$exchange->base(Currency::AUD);
$exchange->symbols(Currency::USD, Currency::EUR, Currency::GBP);

$rates = $exchange->get();
```

Finally, you may have noticed the use of the `Currency` class with currencies as constants. It's just a convenience to prevent errors from typos, but they're completely optional.

This:

```
$exchange->base(Currency::AUD);
$exchange->symbols(Currency::USD, Currency::EUR, Currency::GBP);
```

is equivalent to:

```
$exchange->base('AUD');
$exchange->symbols('USD', 'EUR', 'GBP');
```

Use whatever method fills your needs.

Response
--------

[](#response)

The response is a simple array with currencies as keys and ratios as values. For a request like the following:

```
$rates = (new Exchange())->key("YOUR_ACCESS_KEY")->symbols(Currency::USD, Currency::GBP)->get();
```

the response will be an array:

```
array('GBP' => 0.7009, 'USD' => 1.0666)
```

which you can access with the keys as strings or using the currency constants:

```
print $rates['EUR'];
print $rates[Currency::GBP];
```

There is an option to handle the response as an object:

```
$rates = (new Exchange())->key("YOUR_ACCESS_KEY")->symbols(Currency::USD, Currency::GBP)->getAsObject();

print $rates->USD;
print $rates->GBP;
```

The last option is to return the response as a `Result` class. This allows access to the full set of properties returned from the feed.

```
$result = (new Exchange())->key("YOUR_ACCESS_KEY")->symbols(Currency::USD, Currency::GBP)->getResult();

$date = $result->getDate(); // The date the data is from
$rates = $result->getRates(); // Array of rates as above
$usd = $result->getRate(Currency::USD); // Will return null if there was no value
```

Error Handling
--------------

[](#error-handling)

To handle errors, the package provides 2 exceptions. `ConnectionException` when http requests go wrong and `ResponseException` when the returned response from the api is not as expected. An example with exception handling:

```
use Fadion\Fixerio\Exchange;
use Fadion\Fixerio\Exceptions\ConnectionException;
use Fadion\Fixerio\Exceptions\ResponseException;

try {
    $exchange = new Exchange();
    $exchange->key("YOUR_ACCESS_KEY");
    $rates = $exchange->get();
}
catch (ConnectionException $e) {
    // handle
}
catch (ResponseException $e) {
    // handle
}
```

Laravel Usage
-------------

[](#laravel-usage)

Nothing changes for Laravel apart from the Facade. It's just a convenience for a tad shorter way of using the package:

```
use Exchange;
use Fadion\Fixerio\Currency;

$rates = Exchange::base(Currency::USD)->get();
```

To use this Facade, you should set your access key in your `config/services.php` file:

```
'fixer'=>[
    'key'=>env("FIXER_ACCESS_KEY"),
]
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity48

Moderate usage in the ecosystem

Community19

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 71% 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 ~217 days

Total

5

Last Release

2966d ago

Major Versions

1.2.0 → 2.0.02018-04-04

### Community

Maintainers

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

---

Top Contributors

[![fadion](https://avatars.githubusercontent.com/u/374519?v=4)](https://github.com/fadion "fadion (22 commits)")[![remyvhw](https://avatars.githubusercontent.com/u/558281?v=4)](https://github.com/remyvhw "remyvhw (5 commits)")[![djmarland](https://avatars.githubusercontent.com/u/105991?v=4)](https://github.com/djmarland "djmarland (2 commits)")[![arisen](https://avatars.githubusercontent.com/u/92039359?v=4)](https://github.com/arisen "arisen (1 commits)")[![wstaples](https://avatars.githubusercontent.com/u/3649913?v=4)](https://github.com/wstaples "wstaples (1 commits)")

---

Tags

currency-converterfixerioforeign-exchange-rateslaravellaravelfixerexchange

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fadion-fixerio/health.svg)

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

###  Alternatives

[gehrisandro/tailwind-merge-laravel

TailwindMerge for Laravel merges multiple Tailwind CSS classes by automatically resolving conflicts between them

341682.2k18](/packages/gehrisandro-tailwind-merge-laravel)[backpack/basset

Dead-simple way to load CSS or JS assets only once per page, when using Laravel 10+.

202832.4k6](/packages/backpack-basset)[stechstudio/laravel-php-cs-fixer

Easily format your Laravel Code with this Configuration file and accompanying artisan command.

146718.6k2](/packages/stechstudio-laravel-php-cs-fixer)[worksome/exchange

Check Exchange Rates for any currency in Laravel.

123544.7k](/packages/worksome-exchange)[firefly-iii/data-importer

Firefly III Data Import Tool.

7545.8k](/packages/firefly-iii-data-importer)[bensampo/laravel-embed

Painless responsive embeds for videos, slideshows and more.

142146.8k](/packages/bensampo-laravel-embed)

PHPackages © 2026

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