Who give initial value to Bitcoin? I know how the process of changing BTC price ​​occur, but I curious as to what gave the  initial value to BTC and whether the price of another cryptocurrency refers to the BTC?

How would I replicate this process using an API or any algorithm?
฿ price comes from whichever API you use. I prefer Coindesk because it does a weighted average, but Blockchain.info is another good option, as is Bitstamp or Coindesk. 

From there you can use Bittrex API or Cryptsy or Poloniex.

There's also specialist API like gem.io or blockcypher.com