Cryptocurrency : Get Current Bitcoin Price using PHP API

According to Wikipedia, Bitcoin is a cryptocurrency, a form of electronic cash. Cryptocurrency is basically a digital currency in which encryption techniques are used to regulate the generation of units of currency and verify the transfer of funds, operating independently of a central bank.

A cryptocurrency is a digital or virtual currency designed to work as a medium of exchange. It uses cryptography to secure and verify transactions as well as to control the creation of new units of a particular currency. Essentially, cryptocurrencies are limited entries in a database that no one can change unless specific conditions are fulfilled.

The concept was born out of the need for secure communication in the Second World War. It has evolved in the digital era with elements of mathematical theory and computer science to become a way to secure communications, information and money online.


According to Wikipedia, Bitcoin is a cryptocurrency, a form of electronic cash. Bitcoin uses peer-to-peer technology to operate with no central authority or banks; managing transactions and the issuing of coins is carried out collectively by the network. KIt is open-source; its design is public, nobody owns or controls Bitcoin and everyone can take part.

Fig. Number of bitcoin transactions per month (logarithmic scale)

PHP Script to get Current Bitcoin Rates in various currencies

  $url = "";
  $json = json_decode(file_get_contents($url));
  $dollar = $btc = 0;
  foreach($json as $obj){
    echo '1 bitcoin = $'. $obj->rate .' '. $obj->name .' ('. $obj->code .')<br>';


Recommended For You

About the Author: Ritesh Ghimire

Ritesh is a Computer Engineer, Web Developer and an active cricket follower.