PHP Classes

Coin Layer PHP Cryptocurrency Exchange Rates API: Get the exchange rates for crypto currencies

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 187 All time: 8,628 This week: 455Up
Version License PHP version Categories
coinlayer 1.0.0GNU General Publi...5PHP 5, Web services, Finances
Description 

Author

This class can get the exchange rates for crypto currencies.

It can send HTTP requests to the Coin Layer API to retrieve the value of a given amount converted from one base currency to a given crypto currency supported by this API like for instance Bitcoin.

The class supports retrieving the converted amount at a given past historical date.

Innovation Award
PHP Programming Innovation award nominee
August 2018
Number 7
Crypto-currencies are very popular nowadays. There are many of those currencies and their exchange rates vary a lot every day.

This class provides a solution to get the exchange rates of many crypto-currencies today or at a given date in the past.

Manuel Lemos
Picture of Dave Smith
  Performance   Level  
Name: Dave Smith is available for providing paid consulting. Contact Dave Smith .
Classes: 51 packages by
Country: United States United States
Age: 59
All time rank: 608 in United States United States
Week rank: 20 Up2 in United States United States Up
Innovation award
Innovation award
Nominee: 32x

Winner: 7x

Example

<?php
//instantiate the class
include('coinlayer.class.php');
$coin = new coinLayer();

$coin->setEndPoint('live');

//$fixer->setParam('base','USD');
$coin->setParam('symbols','BTC, TRUMP, 611');
//$coin->setParam('start_date','2018-04-01');
//$coin->setParam('end_date','2018-04-05');
//$coin->setParam('from','BTC');
//$coin->setParam('to','USD');
//$coin->setParam('amount','10');

$coin->getResponse();

echo
'<pre>';
var_dump($coin->response);
echo
'<pre>';
die;

//$newVal = $fixer->convertTo(100,'USD');

//echo 'Test: '.$newVal;

?>


  Files folder image Files (3)  
File Role Description
Plain text file coinlayer.class.php Class Main Class
Accessible without login Plain text file license.txt Lic. License
Accessible without login Plain text file testing.php Example Example Source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:187
This week:0
All time:8,628
This week:455Up