• 11-01-2021, 15:12:36
    #1
    Güncel BTC fiyatını PHP ile çekmek istiyorum. Yardımcı olabilir misiniz?
  • 11-01-2021, 15:13:39
    #2
    API kullanabilirsiniz.
  • 11-01-2021, 15:21:58
    #3
    <?php
    // Paribu
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'https://www.paribu.com/ticker');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    $output = json_decode(curl_exec($ch));
    curl_close($ch);
    
    echo number_format($output->BTC_TL->last, 2, ',', '.');
    
    // BTCTURK
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'https://api.btcturk.com/api/v2/ticker'); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
    curl_setopt($ch, CURLOPT_HEADER, false); 
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); 
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
    $output = json_decode(curl_exec($ch));
    
    $rows = array();
    foreach ($output->data as $row) {
       $rows[$row->pair] = $row;
    }
    
    curl_close($ch);
    
    echo number_format($rows['BTCTRY']->last, 2, ',', '.');
  • 11-01-2021, 15:27:43
    #4
    G3da adlı üyeden alıntı: mesajı görüntüle
    <?php
    // Paribu
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'https://www.paribu.com/ticker');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    $output = json_decode(curl_exec($ch));
    curl_close($ch);
    
    echo number_format($output->BTC_TL->last, 2, ',', '.');
    
    // BTCTURK
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'https://api.btcturk.com/api/v2/ticker');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_HEADER, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    $output = json_decode(curl_exec($ch));
    
    $rows = array();
    foreach ($output->data as $row) {
       $rows[$row->pair] = $row;
    }
    
    curl_close($ch);
    
    echo number_format($rows['BTCTRY']->last, 2, ',', '.');
    Çok teşekkür ederim