Skip to content

payssion/php-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

PHP client for the jsonrates.com API

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages