Bitcoin Forum
May 27, 2024, 10:04:27 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Price displaying website like Coinmarketcap  (Read 604 times)
thefalleng2 (OP)
Full Member
***
Offline Offline

Activity: 195
Merit: 100



View Profile
December 19, 2015, 01:28:37 AM
 #1

I am looking to make a website to show the price of different altcoins like Coinmarketcap. I looked around and it seems to be all about modifying the api to set it up according to my needs.

I am wondering if there is any tutorial to learn how to fetch coins prices from sources. Also is there any easier way to do this? I am looking forward to everyone's replies Smiley

tarsua
Sr. Member
****
Offline Offline

Activity: 266
Merit: 250


View Profile
December 19, 2015, 01:32:59 AM
 #2

yes there is an easier way to do it, use iframes, it isnt pretty but it gets the job done
thefalleng2 (OP)
Full Member
***
Offline Offline

Activity: 195
Merit: 100



View Profile
December 19, 2015, 01:50:51 AM
 #3

yes there is an easier way to do it, use iframes, it isnt pretty but it gets the job done

Thanks for that info. It's not precisely what I am looking for but something quick.

music8mycomputer
Newbie
*
Offline Offline

Activity: 51
Merit: 0


View Profile WWW
December 19, 2015, 02:20:39 AM
 #4

It's all about the endpoint, for example: https://api.coinbase.com/v1/prices/spot_rate?currency=USD

It spits out json encoded data and you have to decode it.


Code:
<?php
$raw_coinbase_price_now 
file_get_contents('https://api.coinbase.com/v1/prices/spot_rate?currency=USD');

$json json_decode($raw_coinbase_price_now);
$coinbase_price $json->amount;
$coinbase number_format($coinbase_price2);
echo $coinbase;
?>

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!