eelkevdbos/openexchangerates-php API wrapper written in PHP

dev-master 2015-02-10 12:27 UTC

This package is not auto-updated.

Last update: 2023-09-30 11:26:07 UTC


Build Status Scrutinizer Code Quality Code Coverage API Wrapper in PHP


composer require eelkevdbos/openexchangerates-php

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 plan
$exchange->timeSeries('2015-01-01', '2015-01-02');
$exchange->convert('12', 'USD', 'EUR');

//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

Simple caching

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


This project is not affiliated in any way with 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.