Skip to content

Instantly share code, notes, and snippets.

@metaspartan
Created February 17, 2021 16:39
Show Gist options
  • Save metaspartan/32b11ebd4b54d18f5778dc33b59ae872 to your computer and use it in GitHub Desktop.
Save metaspartan/32b11ebd4b54d18f5778dc33b59ae872 to your computer and use it in GitHub Desktop.
denarius.io prices
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script>
fetch('https://api.coingecko.com/api/v3/coins/denarius?tickers=true&market_data=true&community_data=true&developer_data=true&sparkline=false')
.then((response) => {
return response.text();
})
.then((myContent) => {
var market = JSON.parse(myContent);
var info = market["market_data"]["current_price"]["usd"];
document.getElementById('dprice').innerHTML = info.toFixed(2);
});
</script>
<script>
fetch('https://api.coingecko.com/api/v3/coins/denarius?tickers=true&market_data=true&community_data=true&developer_data=true&sparkline=false')
.then((response) => {
return response.text();
})
.then((myContent) => {
var market = JSON.parse(myContent);
var info = market["market_data"]["market_cap"]["usd"];
document.getElementById('dmc').innerHTML = "$"+info;
});
</script>
<script>
fetch('https://api.coingecko.com/api/v3/coins/denarius?tickers=true&market_data=true&community_data=true&developer_data=true&sparkline=false')
.then((response) => {
return response.text();
})
.then((myContent) => {
var market = JSON.parse(myContent);
var info = market["market_data"]["circulating_supply"];
document.getElementById('dcount').innerHTML = info;
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment