PHPackages                             aasanakey/fixerphp - 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. aasanakey/fixerphp

ActiveLibrary

aasanakey/fixerphp
==================

A package for foreign exchange rates and currency conversion based on the API provided by apilayer fixer api

0.0.1(2y ago)032MITPHPPHP ^8.0

Since Jan 3Pushed 2y ago1 watchersCompare

[ Source](https://github.com/aasanakey/fixerphp)[ Packagist](https://packagist.org/packages/aasanakey/fixerphp)[ RSS](/packages/aasanakey-fixerphp/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

Fixer
=====

[](#fixer)

[![Latest Stable Version](https://camo.githubusercontent.com/796da3ce2b038154af40e0b24519daba0cbef0fa350b84b759c2bf388f8fb479/687474703a2f2f706f7365722e707567782e6f72672f616173616e616b65792f66697865727068702f76)](https://packagist.org/packages/aasanakey/fixerphp) [![Total Downloads](https://camo.githubusercontent.com/723048b17dd9e95efcb10be20dc513e2613e4ffd7969107271b3b572069a069e/687474703a2f2f706f7365722e707567782e6f72672f616173616e616b65792f66697865727068702f646f776e6c6f616473)](https://packagist.org/packages/aasanakey/fixerphp) [![Latest Unstable Version](https://camo.githubusercontent.com/5d0e67dcae565eb83adfe661221e42416cffc97d2f3f1699c9f8ae4bc464b9ff/687474703a2f2f706f7365722e707567782e6f72672f616173616e616b65792f66697865727068702f762f756e737461626c65)](https://packagist.org/packages/aasanakey/fixerphp) [![License](https://camo.githubusercontent.com/5b1d73ce5730c807e2663c94802bbd3536a2adbebeb56b76ede8551151750477/687474703a2f2f706f7365722e707567782e6f72672f616173616e616b65792f66697865727068702f6c6963656e7365)](https://packagist.org/packages/aasanakey/fixerphp) [![PHP Version Require](https://camo.githubusercontent.com/083fd48e88da0d25cd86e9530177d7a9a9a3fd01a98375fcc6e22402333ff35c/687474703a2f2f706f7365722e707567782e6f72672f616173616e616b65792f66697865727068702f726571756972652f706870)](https://packagist.org/packages/aasanakey/fixerphp)

Fixer is a simple PHP library for current and historical currency exchange rates based on the Apilayer's Fixer API [APILayer (Fixer Api)](https://apilayer.com/marketplace/fixer-api "APILayer marketplace")

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

[](#requirements)

- PHP &gt;= 8.0
- guzzlehttp &gt;= 7.8

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

[](#installation)

```
composer require aasanakey/fixerphp

```

Usage
-----

[](#usage)

**Package requires an api key**

### 1. Currency Conversion

[](#1-currency-conversion)

To convert from one currency to another you may chain the methods:

```
require 'vendor/autoload.php';

use Aasanakey\Fixer\Fixer;

Fixer::key('your api key')
        ->convert()
        ->from('USD')
        ->to('EUR')
        ->get();
```

This will return the converted amount or `null` on failure.

The amount to be converted is default to `1`, you may specify the amount:

```
use Aasanakey\Fixer\Fixer;

Fixer::key('your api key')
        ->convert()
        ->from('USD')
        ->to('EUR')
        ->amount(50)
        ->get();
```

#### Available Methods

[](#available-methods)

- Convert currency using historical exchange rates `YYYY-MM-DD`:

```
use Aasanakey\Fixer\Fixer;

Fixer::key('your api key')
        ->convert()
        ->from('USD')
        ->to('EUR')
        ->date('2019-08-01')
        ->get();
```

- Round the converted amount to decimal places:

```
use Aasanakey\Fixer\Fixer;

Fixer::key('your api key')
        ->convert()
        ->from('USD')
        ->to('EUR')
        ->round(2)
        ->get();
```

### 2. Latest Rates

[](#2-latest-rates)

To get latest rates you may chain the methods:

```
use Aasanakey\Fixer\Fixer;

Fixer::key('your api key')
        ->rates()
        ->latest()
        ->get();

 /*
 [
  "base": "USD",
  "date": "2022-04-14",
  "rates": [
    "EUR": 0.813399,
    "GBP": 0.72007,
    "JPY": 107.346001
  ],
  "success": true,
  "timestamp": 1519296206
]
*/
```

This will return an `array` of all available currencies or `null` on failure.

#### Available Methods

[](#available-methods-1)

- Just like currency conversion you may chain any of the available methods:

```
use Aasanakey\Fixer\Fixer;

Fixer::key('your api key')
        ->rates()
        ->latest()
        ->symbols(['USD', 'EUR', 'EGP']) //An array of currency codes to limit output currencies
        ->base('GBP') //Changing base currency (default: EUR). Enter the three-letter currency code of your preferred base currency.
        ->get();
```

### 3. Historical Rates

[](#3-historical-rates)

Historical rates are available for most currencies all the way back to the year of 1999.

```
use Aasanakey\Fixer\Fixer;

Fixer::key('your api key')
        ->rates()
        ->historical('2013-12-24') //`YYYY-MM-DD` Required date parameter to get the rates for
        ->get();

/**
 [
  "base": "GBP",
  "date": "2013-12-24",
  "historical": true,
  "rates": {
    "CAD": 1.739516,
    "EUR": 1.196476,
    "USD": 1.636492
  },
  "success": true,
  "timestamp": 1387929599
 ]
 */

Fixer::key('your api key')
        ->rates()
        ->historical('2013-12-24')
        ->symbols(['USD', 'EUR', 'EGP']) //An array of currency codes to limit output currencies
        ->base('GBP')
        ->get();

/**
[
  "base": "GBP",
  "date": "2013-12-24",
  "historical": true,
  "rates": {
    "CAD": 1.739516,
    "EUR": 1.196476,
    "USD": 1.636492
  },
  "success": true,
  "timestamp": 1387929599
]
*/
```

Same as latest rates you may chain any of the available methods:

```
use Aasanakey\Fixer\Fixer;

Fixer::key('your api key')
        ->rates()
        ->historical('2020-01-01')
        ->symbols(['USD', 'EUR', 'CZK'])
        ->base('GBP')
        ->get();
```

### 4. Timeseries Rates

[](#4-timeseries-rates)

Timeseries are for daily historical rates between two dates of your choice, with a maximum time frame of 365 days. This will return an `array` or `null` on failure.

```
use Aasanakey\Fixer\Fixer;

Fixer::key('your api key')
        ->rates()
        ->timeSeries('2021-05-01', '2021-05-02') //`YYYY-MM-DD` Required dates range parameters
        ->get();

/**
[
  "base": "EUR",
  "end_date": "2012-05-03",
  "rates": {
    "2012-05-01": {
      "AUD": 1.278047,
      "CAD": 1.302303,
      "USD": 1.322891
    },
    "2012-05-02": {
      "AUD": 1.274202,
      "CAD": 1.299083,
      "USD": 1.315066
    },
    "2012-05-03": {
      "AUD": 1.280135,
      "CAD": 1.296868,
      "USD": 1.314491
    }
  },
  "start_date": "2012-05-01",
  "success": true,
  "timeseries": true
]
 */
```

### 5. Fluctuations

[](#5-fluctuations)

Retrieve information about how currencies fluctuate on a day-to-day basis, with a maximum time frame of 365 days. This will return an `array` or `null` on failure.

```
use Aasanakey\Fixer\Fixer;

Fixer::key('your api key')
        ->rates()
        ->fluctuations('2021-03-29', '2021-04-15') //`YYYY-MM-DD` Required dates range parameters
        ->symbols(['USD','JPY']) //[optional] An array of currency codes to limit output currencies
        ->base('EUR') //[optional] Changing base currency (default: EUR). Enter the three-letter currency code of your preferred base currency.
        ->get();

/**
 [
  "base": "EUR",
  "end_date": "2018-02-26",
  "fluctuation": true,
  "rates": {
    "JPY": {
      "change": 0.0635,
      "change_pct": 0.0483,
      "end_rate": 131.651142,
      "start_rate": 131.587611
    },
    "USD": {
      "change": 0.0038,
      "change_pct": 0.3078,
      "end_rate": 1.232735,
      "start_rate": 1.228952
    }
  },
  "start_date": "2018-02-25",
  "success": true
 ]
 */
```

License
-------

[](#license)

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

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

866d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/19ac717b0fe478fe37799fdc0119d9d9c03c56bcdb5b3bd7975508b2785d27d8?d=identicon)[aasanakey](/maintainers/aasanakey)

---

Top Contributors

[![aasanakey](https://avatars.githubusercontent.com/u/43689197?v=4)](https://github.com/aasanakey "aasanakey (7 commits)")

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/aasanakey-fixerphp/health.svg)

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

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k21](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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