2017 © Pedro Peláez
 

library open-exchange-rater

A PHP client for the Open Exchange Rates API

image

harrygr/open-exchange-rater

A PHP client for the Open Exchange Rates API

  • Monday, October 5, 2015
  • by harrygr
  • Repository
  • 1 Watchers
  • 2 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Build Status Latest Stable Version License, (*1)

Open Exchange Rater Client

This is a simple client to consume the [openexchangerate.org][1] REST API., (*2)

Installation

Using composer:, (*3)

composer require harrygr/open-exchange-rater

Or clone the package into your app and include the Client class., (*4)

Usage

Instantiate the client, passing in your app id:, (*5)

$client = new \OpenExchangeRater\Client($app_id);

You can now query the API like so:, (*6)

Get an array of all available currencies:

$client->currencies();

Get an array of the latest FX rates

$client->latest();

Get an array of historical rates

$client->historical(\DateTime $date);

Get a rate between 2 currencies

If a date is passed it will get the rate on that date. If not it will get the latest rate, (*7)

$client->rate($currency, $base, DateTime $date);

Convert a value from one currency to another

If a date is passed it will convert using the rate on that date. If not it will convert using the latest rate, (*8)

$client->convert($value, $from, $to, DateTime $date);

The Versions

05/10 2015

dev-master

9999999-dev

A PHP client for the Open Exchange Rates API

  Sources   Download

MIT

The Development Requires

by Avatar harrygr

05/10 2015

v0.1.1

0.1.1.0

A PHP client for the Open Exchange Rates API

  Sources   Download

MIT

The Development Requires

by Avatar harrygr

02/10 2015

v0.1.0

0.1.0.0

A PHP client for the Open Exchange Rates API

  Sources   Download

MIT

The Development Requires

by Avatar harrygr