Analisando dados Json da API Cryptocompare em C #
Estou carregando dados dehttps://min-api.cryptocompare.com/data/histominute?fsym=BTC&tsym=ETH&limit=30&aggregate=1&e=CCCAGG
Este é o retorno:
{"Response":"Success","Type":100,"Aggregated":false,"Data":[{"time":1504979760,"high":14.26,"low":14.26,"open":14.26,"volumefrom":4.8,"volumeto":68.49,"close":14.26},{"time":1504979820,"high":14.26,"low":14.27,"open":14.26,"volumefrom":2.57,"volumeto":36.77,"close":14.27},{"time":1504979880,"high":14.26,"low":14.27,"open":14.27,"volumefrom":7.41,"volumeto":105.66,"close":14.26},{"time":1504979940,"high":14.26,"low":14.26,"open":14.26,"volumefrom":3.69,"volumeto":52.61,"close":14.26},{"time":1504980000,"high":14.26,"low":14.27,"open":14.26,"volumefrom":11.23,"volumeto":160.79,"close":14.27},{"time":1504980060,"high":14.27,"low":14.28,"open":14.27,"volumefrom":7.29,"volumeto":104.76,"close":14.27},{"time":1504980120,"high":14.27,"low":14.27,"open":14.27,"volumefrom":4.75,"volumeto":67.76,"close":14.27},{"time":1504980180,"high":14.25,"low":14.28,"open":14.27,"volumefrom":8.25,"volumeto":117.58,"close":14.26},{"time":1504980240,"high":14.26,"low":14.27,"open":14.26,"volumefrom":12.54,"volumeto":178.73,"close":14.26},{"time":1504980300,"high":14.26,"low":14.26,"open":14.26,"volumefrom":7.65,"volumeto":109.08,"close":14.26},{"time":1504980360,"high":14.26,"low":14.26,"open":14.26,"volumefrom":6.88,"volumeto":98.26,"close":14.26},{"time":1504980420,"high":14.25,"low":14.26,"open":14.26,"volumefrom":9.28,"volumeto":132.44,"close":14.25},{"time":1504980480,"high":14.25,"low":14.26,"open":14.25,"volumefrom":80.94,"volumeto":1148.05,"close":14.26},{"time":1504980540,"high":14.22,"low":14.26,"open":14.26,"volumefrom":15.4,"volumeto":219.62,"close":14.26},{"time":1504980600,"high":14.24,"low":14.26,"open":14.26,"volumefrom":7.68,"volumeto":109.25,"close":14.24},{"time":1504980660,"high":14.22,"low":14.25,"open":14.24,"volumefrom":11.51,"volumeto":163.89,"close":14.23},{"time":1504980720,"high":14.23,"low":14.24,"open":14.23,"volumefrom":10.4,"volumeto":147.78,"close":14.24},{"time":1504980780,"high":14.23,"low":14.24,"open":14.24,"volumefrom":2.26,"volumeto":32.23,"close":14.24},{"time":1504980840,"high":14.23,"low":14.24,"open":14.24,"volumefrom":11.45,"volumeto":162.77,"close":14.24},{"time":1504980900,"high":14.23,"low":14.25,"open":14.24,"volumefrom":5.08,"volumeto":72.42,"close":14.24},{"time":1504980960,"high":14.24,"low":14.25,"open":14.24,"volumefrom":7.28,"volumeto":103.57,"close":14.24},{"time":1504981020,"high":14.24,"low":14.25,"open":14.24,"volumefrom":2.22,"volumeto":31.73,"close":14.25},{"time":1504981080,"high":14.25,"low":14.26,"open":14.25,"volumefrom":19.34,"volumeto":275.78,"close":14.26},{"time":1504981140,"high":14.26,"low":14.27,"open":14.26,"volumefrom":13.05,"volumeto":186.2,"close":14.27},{"time":1504981200,"high":14.27,"low":14.28,"open":14.27,"volumefrom":4.95,"volumeto":70.65,"close":14.27},{"time":1504981260,"high":14.26,"low":14.27,"open":14.27,"volumefrom":3.1,"volumeto":44.26,"close":14.27},{"time":1504981320,"high":14.26,"low":14.27,"open":14.27,"volumefrom":8.56,"volumeto":122.21,"close":14.27},{"time":1504981380,"high":14.27,"low":14.27,"open":14.27,"volumefrom":10.8,"volumeto":154.01,"close":14.27},{"time":1504981440,"high":14.27,"low":14.27,"open":14.27,"volumefrom":4.18,"volumeto":59.67,"close":14.27},{"time":1504981500,"high":14.27,"low":14.27,"open":14.27,"volumefrom":0.638,"volumeto":9.11,"close":14.27},{"time":1504981560,"high":14.27,"low":14.27,"open":14.27,"volumefrom":0,"volumeto":0,"close":14.27}],"TimeTo":1504981560,"TimeFrom":1504979760,"FirstValueInArray":true,"ConversionType":{"type":"invert","conversionSymbol":""}}
Eu gostaria de analisar os dados em c #. Principalmente fazendo algo com cada uma das entradas da lista de 'dados' (hora, alta, baixa, ...) Alguma sugestão?
EDITAR:
Eu tenho esse pacote json instalado. Este é o código.
string url_kraken = @"https://min-api.cryptocompare.com/data/histominute?fsym=ETH&tsym=EUR&limit=2000&aggregate=15&e=Kraken&extraParams=yeahnoworries";
var client_kraken = new WebClient();
var content_kraken = client_kraken.DownloadString(url_kraken);
var results_kraken = JsonConvert.DeserializeObject<List<CoinMarketCap_API_JSON>>(content_kraken);