PHPackages                             infinitypaul/naira-exchange-rates - 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. infinitypaul/naira-exchange-rates

ActiveLibrary[API Development](/categories/api)

infinitypaul/naira-exchange-rates
=================================

Foreign exchange rates API Against The Naira

0.0.2(6y ago)174473[1 issues](https://github.com/infinitypaul/naira-exchange-rates/issues)1MITPHPPHP &gt;= 5.6.0CI failing

Since Mar 14Pushed 6y ago3 watchersCompare

[ Source](https://github.com/infinitypaul/naira-exchange-rates)[ Packagist](https://packagist.org/packages/infinitypaul/naira-exchange-rates)[ Docs](https://github.com/infinitypaul/naira-exchange-rates)[ RSS](/packages/infinitypaul-naira-exchange-rates/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (1)

Naira ExchangeRatesAPI - Naira Currency Exchange Rates API SDK
==============================================================

[](#naira-exchangeratesapi---naira-currency-exchange-rates-api-sdk)

[![Latest Version on Packagist](https://camo.githubusercontent.com/23ef7650059287c0672654845df5a91dd6237f3df53172b032a54fe17f4db21e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696e66696e6974797061756c2f6e616972612d65786368616e67652d72617465732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/infinitypaul/naira-exchange-rates)[![Build Status](https://camo.githubusercontent.com/b73f97196e7a49dae6697c299754f847b3332dbd33f39cfdadc8007cf490bc7f/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f696e66696e6974797061756c2f6e616972612d65786368616e67652d72617465732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/infinitypaul/naira-exchange-rates)[![Quality Score](https://camo.githubusercontent.com/97434fb40e7230e212b374136a17e1c6cf2f54967f380160e11dd791a3120c5b/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f696e66696e6974797061756c2f6e616972612d65786368616e67652d72617465732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/infinitypaul/naira-exchange-rates)[![Total Downloads](https://camo.githubusercontent.com/0d3e2e44ff9e389fd2ac50d52c2694324334407a8d1e0f2265ac3120cc5e35d4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696e66696e6974797061756c2f6e616972612d65786368616e67652d72617465732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/infinitypaul/naira-exchange-rates)

Free Naira Exchange Rates API, which provides past or recent exchange rate lookups. It features a number of useful functions and can be installed easily using Composer..

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

[](#installation)

You can install the package via composer:

```
composer require infinitypaul/naira-exchange-rates
```

Alternatively, you can download all files from the src/ directory and include them in your project. Important note: if you're manually installing the SDK, you must also install Guzzle Client.

Usage
-----

[](#usage)

The Naira Currency Exchange API does require API keys or authentication in order to access and interrogate its API, Register and get your token on .

**Basic usage:**

Fetch the latest exchange rates

```
$naira = new NairaExchangeRates
$rates  = $naira->setType('cbn')->fetch();
```

**Historical Data:**
Get historical rates for any day since 1999:

```
$naira = new NairaExchangeRates
$rates  = $naira->setType('cbn')->addDateFrom('2019-11-26')->fetch();
```

**Fetch Specific Rate:**
If you do not want all current rates, it's possible to specify only the currencies you want

```
$naira = new NairaExchangeRates
$rates  = $naira->setType('cbn')->setBaseCurrency('usd')->fetch();
```

### 4. API Reference:

[](#4-api-reference)

The following API reference lists the publicly-available methods for the

#### `NairaExchangeRatesAPI` Reference:

[](#nairaexchangeratesapi-reference)

`addDateFrom( string $from )`:
Set the date from which to retrieve historic rates. `$from` should be a string containing an ISO 8601 date.

`setType( string $to )`:
Set The Exchange Rate Type You Want To Retrieve, we have the following types

1. `cbn` Central Bank Of Nigeria Rate
2. `bdc` Burueu The Change Rate
3. `bank` Bank Rate
4. `moneygram` MoneyGram Rate
5. `westernunion` Western Union Rate

`addDateTo( string $type )`:
Set the end date for the retrieval of historic rates. `$to` should be a string containing an ISO 8601 date.

`setBaseCurrency( string $code )`:
Set the base currency you want to retrieve. `$code` should be passed an ISO 4217 code (e.g. `EUR`).
`$code` must be one of the [supported currency codes](#5-supported-currencies).

`fetch()`:
Send off the request to the API and return either a Json,

### 5. Supported Currencies:

[](#5-supported-currencies)

The library supports the following currencies USD, GBP, EUR, JPY, XAF, CNY, QAR, ZAR, SEK:

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Bug &amp; Features

[](#bug--features)

If you have spotted any bugs, or would like to request additional features from the library, please file an issue via the Issue Tracker on the project's Github page: [https://github.com/infinitypaul/naira-exchange-rates/issues](https://github.com/infinitypaul/naira-exchange-rate/issues).

Credits
-------

[](#credits)

- [Paul Edward](https://github.com/infinitypaul)
- [Olutoye Owojaye](https://github.com/teeto4517)
- [All Contributors](../../contributors)

How can I thank you?
--------------------

[](#how-can-i-thank-you)

Why not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or HackerNews? Spread the word!

Don't forget to [follow me on twitter](https://twitter.com/infinitypaul)!

Thanks!
Edward Paul.

License
-------

[](#license)

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

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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 ~0 days

Total

2

Last Release

2250d ago

PHP version history (2 changes)0.0.1PHP ^7.1

0.0.2PHP &gt;= 5.6.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15332137?v=4)[Paul Edward](/maintainers/infinitypaul)[@infinitypaul](https://github.com/infinitypaul)

---

Top Contributors

[![infinitypaul](https://avatars.githubusercontent.com/u/15332137?v=4)](https://github.com/infinitypaul "infinitypaul (12 commits)")[![teeto4517](https://avatars.githubusercontent.com/u/48827624?v=4)](https://github.com/teeto4517 "teeto4517 (3 commits)")

---

Tags

cbncurrency-exchange-ratesexchange-ratesnairanigeriacurrency-converterexchange rateforexinfinitypaulnairanaira-exchange-rates

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/infinitypaul-naira-exchange-rates/health.svg)

```
[![Health](https://phpackages.com/badges/infinitypaul-naira-exchange-rates/health.svg)](https://phpackages.com/packages/infinitypaul-naira-exchange-rates)
```

###  Alternatives

[ashallendesign/laravel-exchange-rates

A wrapper package for interacting with the exchangeratesapi.io API.

485677.8k](/packages/ashallendesign-laravel-exchange-rates)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[oneforge/forexquotes

Library to fetch and parse realtime Forex quotes and convert currencies

7212.5k](/packages/oneforge-forexquotes)[otherguy/php-currency-api

A PHP API Wrapper to offer a unified programming interface for popular Currency Rate APIs.

2526.2k](/packages/otherguy-php-currency-api)

PHPackages © 2026

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