I'm trying to parse this json array: https://min-api.cryptocompare.com/data/histominute?fsym=BTC&tsym=USD&limit=60&aggregate=3&e=Kraken
Idea is read some values for each timestamp(not all needed). How I could data of 1st time-stamp, close, high, low, open?
I've tried several methods I used for simple json stings but this seem to be challenge for me and can't get data read any ways I've tried.
First I made separate class file like this:
namespace HistoryData
{
class DataQuery
{
public string Data { get; set; }
public string Time { get; set; }
public string Close { get; set; }
public string High { get; set; }
public string Low { get; set; }
public string Open { get; set; }
public string Volumefrom { get; set; }
public string Volumeto { get; set; }
}
}
Then parse:
const string url = @"https://min-api.cryptocompare.com/data/histominute?
fsym=BTC&tsym=USD&limit=30&aggregate=3&e=Kraken";
var client = new WebClient();
var content = client.DownloadString(url);
var results = JsonConvert.DeserializeObject<List<DataQuery>>(content);
var Time1 = (results[1].Time);
var Close1 = (results[1].Close);
NOT WORKING