using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization.Formatters;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
public long time { get; set; }
public decimal close { get; set; }
public decimal high { get; set; }
public decimal low { get; set; }
public decimal open { get; set; }
public double volumefrom { get; set; }
public double volumeto { get; set; }
public class ConversionType
public string type { get; set; }
public string conversionSymbol { get; set; }
public string Response { get; set; }
public int Type { get; set; }
public bool Aggregated { get; set; }
public List<Datum> Data { get; set; }
public long TimeTo { get; set; }
public long TimeFrom { get; set; }
public bool FirstValueInArray { get; set; }
public ConversionType ConversionType { get; set; }
public static void Test()
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 root = JsonConvert.DeserializeObject<RootObject>(content);
var Time1 = (results[1].time);
var Close1 = (results[1].close);
Console.WriteLine("results[1].time={0}, results[1].close={1}", Time1, Close1);
Console.WriteLine("\nOriginal JSON: ");
Console.WriteLine(JToken.Parse(content));
public static void Main()
Console.WriteLine("Environment version: " + Environment.Version);
Console.WriteLine("Json.NET version: " + typeof(JsonSerializer).Assembly.FullName);
Console.WriteLine("Failed with unhandled exception: ");
public class AssertionFailedException : System.Exception
public AssertionFailedException() : base() { }
public AssertionFailedException(string s) : base(s) { }
public static class Assert
public static void IsTrue(bool value)
public static void IsTrue(bool value, string message)
throw new AssertionFailedException(message ?? "failed");