Skip to content
PHP client for the jsonrates.com API
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/Jsonrates
tests
.gitignore
.travis.yml
CHANGELOG.md
README.md
composer.json
phpunit.xml.dist

README.md

jsonrates - Currency exchange rates API

Latest Stable Version Build Status

The jsonrates API provides reliable, fast and free exchange rates and currency conversion for 168 currencies. All exchange rates are updated every 10 minutes and were collected from several providers. jsonrates is perfect for developers who need a free and simple service for getting exchange rates instead of paying hundreds of dollar for the most providers.

Functions
  • Exchange Rates
  • Currency Conversion
  • Historical Data
  • Locale Transformation

Website: jsonrates.com

Installation

Via composer

Install the latest version with composer require jsonrates/api-client

require 'vendor/autoload.php';
$jsonrates = new \Jsonrates\Client('YOUR-API-KEY');
Manually

Download and extract the latest release to /your/libs/jsonrates/

require_once '/your/libs/jsonrates/php-client/src/Jsonrates/Client.php';
$jsonrates = new \Jsonrates\Client('YOUR-API-KEY');

Usage

Example: Get an exchange rate for two currencies
$result = $jsonrates
  ->from('USD')
  ->to('EUR')
  ->get();
Example: Convert an USD amount to all other available currencies
$result = $jsonrates
  ->base('USD')
  ->amount(2.99)
  ->convert();
Example: Get a timeseries of rates for two currencies
$result = $jsonrates
  ->from('XBT')
  ->to('USD')
  ->dateStart('2014-11-02')
  ->dateEnd('2014-11-05')
  ->historical();
Example: Get an exchange rate for the currencies of two locales
$result = $jsonrates
  ->from('en_GB')
  ->to('de_DE')
  ->locale();

API Documentation

See: jsonrates.com/docs

You can’t perform that action at this time.