Add Coinbase ETH spot price example

This commit is contained in:
Zach Borboa
2017-04-30 13:29:12 -07:00
parent a97721c8ea
commit b754ebf065
2 changed files with 14 additions and 2 deletions
@@ -5,8 +5,8 @@ use \Curl\Curl;
$curl = new Curl();
$curl->setHeader('CB-VERSION', '2016-01-01');
$curl->get('https://api.coinbase.com/v2/prices/spot');
$curl->get('https://api.coinbase.com/v2/prices/BTC-USD/spot');
echo
'The current price of bitcoin at Coinbase is ' .
'The current price of BTC at Coinbase is ' .
'$' . $curl->response->data->amount . ' ' . $curl->response->data->currency . '.' . "\n";
+12
View File
@@ -0,0 +1,12 @@
<?php
require __DIR__ . '/vendor/autoload.php';
use \Curl\Curl;
$curl = new Curl();
$curl->setHeader('CB-VERSION', '2016-01-01');
$curl->get('https://api.coinbase.com/v2/prices/ETH-USD/spot');
echo
'The current price of ETH at Coinbase is ' .
'$' . $curl->response->data->amount . ' ' . $curl->response->data->currency . '.' . "\n";