STEP 1: Use this function to get realtime market price of faucethub coins , use this function in your config.php or function.php files.

function getValueOfFCoin($coinname)
  {
    if($coinname == 'BTC')
    {
      $coinnumber = 1;
    }
    else if($coinname == 'LTC')
    {
      $coinnumber = 2;
    }
    else if($coinname == 'DOGE')
    {
      $coinnumber = 74;
    }
    else if($coinname == 'ZEC')
    {
      $coinnumber = 1437;
    }
    else if($coinname == 'BTX')
    {
      $coinnumber = 1654;
    }
    else if($coinname == 'DASH')
    {
      $coinnumber = 131;
    }
    else if($coinname == 'ETH')
    {
      $coinnumber = 1027;
    }
    else if($coinname == 'PPC')
    {
      $coinnumber = 5;
    }
    else if($coinname == 'BLK')
    {
      $coinnumber = 170;
    }
    else if($coinname == 'POT')
    {
      $coinnumber = 122;
    }
    else if($coinname == 'XPM')
    {
      $coinnumber = 42;
    }
    else if($coinname == 'BCH')
    {
      $coinnumber = 1831;
    }
    else if($coinname == 'XMR')
    {
      $coinnumber = 328;
    }	
    else if($coinname == 'DGB')
    {
      $coinnumber = 109;
    }		
    $extract = file_get_contents('https://api.coinmarketcap.com/v2/ticker/'.$coinnumber.'/?convert=BTC');
    $coinarray = json_decode($extract,true);
    $coinarray = $coinarray['data']['quotes'];
    $coinvalueinbtc = $coinarray['BTC']['price'];
    $coinvalueinusd = $coinarray['USD']['price'];
    $returnvalue = $coinvalueinbtc.'+'.$coinvalueinusd;
    return $returnvalue;
  }

 

STEP 2 : Then use this code where you want your price to be used.

#GETVALUE OF DOGE FROM COINMARKET#

$dogevalue = getValueOfFCoin('DOGE');
$dogevalue = explode('+',$dogevalue);
$dogevalueinbtc = $dogevalue[0];
$dogevalueinusd = $dogevalue[1];

echo 'DOGE value in BTC :'.$dogevalueinbtc.' & DOGE value in USD :'.$dogevalueinusd;