I was just trying to display certain data from this url on my website. Therefor I wanted to fetch the data - especially the value which is connected to the "30d"-key (in "EUR").
My approach:
<!DOCTYPE html>
<html lang="en">
<head>
<title>BTC</title>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
</head>
<body>
<div class="mypanel"></div>
<script>
$.getJSON('https://api.bitcoincharts.com/v1/weighted_prices.json', function(data) {
var text = `Date: ${data.EUR.30d}`
$(".mypanel").html(text);
});
</script>
</body>
</html>
I thought that this would extract the value of the "30d"-key in "EUR" and display it on my website, when I insert the code to the webiste.
Unfortunately it does not display the value and I do not know yet how to update the code periodically.