PHP code example of musheabdulhakim / coingecko

1. Go to this page and download the library: Download musheabdulhakim/coingecko 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/ */

    

musheabdulhakim / coingecko example snippets


$coingecko = \MusheAbdulHakim\CoinGecko\CoinGecko::client('your-api-key');

//or 

$coingecko = \MusheAbdulHakim\CoinGecko\CoinGecko::client('your-api-key','https://api.coingecko.com/api', 'v3');

$coingecko = \MusheAbdulHakim\CoinGecko\CoinGecko::client('your-api-key');
$ping = $coingecko->ping();

$pingTest = $ping->ping();

//or

$coingecko->pingServer();



'COINGECKO_API_VERSION' => 'v3',

'COINGECKO_BASE_URI' => 'https://api.coingecko.com/api',

'COINGECKO_API_KEY' => 'xxxxxxxxxxxxxxxxxxxxxx',


$ping = $coingecko->ping();