Bitcoin Forum
September 21, 2019, 12:17:17 PM *
News: Latest Bitcoin Core release: 0.18.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Price displaying website like Coinmarketcap  (Read 569 times)
thefalleng2
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

1569068237
Hero Member
*
Offline Offline

Posts: 1569068237

View Profile Personal Message (Offline)

Ignore
1569068237
Reply with quote  #2

1569068237
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
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
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:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!