PHP code example of cointokio / coinpaprika-api-client
1. Go to this page and download the library: Download cointokio/coinpaprika-api-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
cointokio / coinpaprika-api-client example snippets
$client = new Cointokio\CoinPaprika\Client();
/*
* Get the latest ticker for Bitcoin, with prices in USD and EUR.
*
* Note that the $client->tickers() method returns an instance of the
* \Cointokio\CoinPaprika\Tickers class. This allows us to use the Tickers
* class methods more easily via method chaining, eg.:
*
* $client->tickers()->get_list()
* $client->tickers()->get( 'btc-bitcoin', array( 'quotes' => 'USD,EUR' ) )
*
* @see https://docs.coinpaprika.com/api-reference/tickers/get-ticker-for-a-specific-coin
* @see https://en.wikipedia.org/wiki/Method_chaining
*/
$response = $client->tickers()->get(
'btc-bitcoin',
array( 'quotes' => 'USD,EUR' )
);
foreach ( array_chunk( $fiats, 3 ) as $chunk ) {
$response = $client->tickers()->get( 'btc-bitcoin', array(
'quotes' => implode( ',', $chunk ),
) );
// Aggregate per-chunk responses into your own structure.
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.