2017 © Pedro Peláez
 

library openexchangerates-php

OpenExchangeRates.org API wrapper written in PHP

image

eelkevdbos/openexchangerates-php

OpenExchangeRates.org API wrapper written in PHP

  • Tuesday, February 10, 2015
  • by eelkevdbos
  • Repository
  • 2 Watchers
  • 6 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

openexchangerates-php

Build Status Scrutinizer Code Quality Code Coverage, (*1)

OpenExchangeRates.org API Wrapper in PHP, (*2)

Installation

composer require eelkevdbos/openexchangerates-php, (*3)

Basic Usage

use EvdB\OpenExchangeRates\OpenExchangeRates;
use GuzzleHttp\Client;

//construct request client
$client = new Client(['base_url' => OpenExchangeRates::getBaseUrl(true)]);

//construct openexchangerates instance
$exchange = new OpenExchangeRates(['app_id' => 'THIS_IS_YOUR_APP_ID'], $client);

//available methods below, some methods require the purchase of a specific openexchangerates.org plan
$exchange->latest();
$exchange->historical('2015-01-01');
$exchange->timeSeries('2015-01-01', '2015-01-02');
$exchange->convert('12', 'USD', 'EUR');
$exchange->currencies();

//all methods above can also be called with a jsonp callback
$exchange->jsonp('latest', [], 'myCallbackName');
$exchange->jsonp('timeSeries', ['2015-01-01', '2015-01-02'], 'myTimeseriesCallback');

All methods return the json data structure as noted in the API docs provided by OpenExchangeRates.org., (*4)

Simple caching

Guzzle provides us with a cache subscriber for the request client. For more information, please read the cache-subscriber docs., (*5)

Disclaimer

This project is not affiliated in any way with OpenExchangeRates.org. It is intended to provide a useful service and comes with no warranty or any kind. The author is not responsible for any damages or problems incurred during usage of the API. Use at your own risk., (*6)

The Versions

10/02 2015

dev-master

9999999-dev

OpenExchangeRates.org API wrapper written in PHP

  Sources   Download

MIT

The Requires

 

The Development Requires

currency currency conversion exchangerate