|Ratings||Unique User Downloads||Download Rankings|
|Not yet rated by the users||Total: 20||All time: 10,434 This week: 223|
|naira-exchange-rates 1.0||Custom (specified...||5||PHP 5, Web services, Finances|
This package is specific mainly for applications used in Nigeria .
This package can get the conversion rate for Naira to other currencies.
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..
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.
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 http://nairaexchangerate.herokuapp.com/.
Basic usage:<br />
Fetch the latest exchange rates
$naira = new NairaExchangeRates $rates = $naira->setType('cbn')->fetch();
Historical Data:<br /> Get historical rates for any day since 1999:
$naira = new NairaExchangeRates $rates = $naira->setType('cbn')->addDateFrom('2019-11-26')->fetch();
Fetch Specific Rate:<br /> 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();
The following API reference lists the publicly-available methods for the
addDateFrom( string $from ):<br />
Set the date from which to retrieve historic rates.
$from should be a string containing an ISO 8601 date.
setType( string $to ):<br />
Set The Exchange Rate Type You Want To Retrieve, we have the following types
cbn Central Bank Of Nigeria Rate
bdc Burueu The Change Rate
bank Bank Rate
moneygram MoneyGram Rate
westernunion Western Union Rate
addDateTo( string $type ):<br />
Set the end date for the retrieval of historic rates.
$to should be a string containing an ISO 8601 date.
setBaseCurrency( string $code ):<br />
Set the base currency you want to retrieve.
$code should be passed an ISO 4217 code (e.g.
$code must be one of the supported currency codes.
Send off the request to the API and return either a Json,
The library supports the following currencies USD, GBP, EUR, JPY, XAF, CNY, QAR, ZAR, SEK:
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
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.
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!
Thanks!<br> Edward Paul.
The MIT License (MIT). Please see License File for more information.
|.idea (5 files)|
|src (2 files, 2 directories)|
|tests (1 file)|
|Version Control||Unique User Downloads||Download Rankings|