public ActionResult Index() { string data = ApiCall.DoIt("https://api.cryptoapis.io/v1/exchanges?limit=500"); var serialized = JsonConvert.DeserializeObject <ExchangeIndexClass.ExchangeIndex>(data); return(View(serialized)); }
// GET api/cryptodetails/id public IHttpActionResult GetCryptoDetail(string id) { string data = ApiCall.DoIt("https://api.cryptoapis.io/v1/assets/" + id); var serialized = JsonConvert.DeserializeObject <DetailClass.CryptoDetail>(data); var get = serialized.Payload; return(Ok( $"<h4 class='crypto-name-modal'><img style='padding-right:6px;' src='data:image/svg+xml;base64,{get.Logo.ImageData}'>{get.Name}</h4><table class='table table-borderless'><tbody><tr><th scope ='row'>Price</th><td>$ {get.Price}</td></tr><tr><th scope='row'>Market Cap</th><td>{get.MarketCap}</td></tr><tr><th scope'row'>Supply</th><td>{get.Supply}</td></tr><tr><th scope ='row'>Volume</th><td>{get.Volume}</td></tr><tr><th scope ='row'>24hr Change</th><td class={(get.Change > 0 ? "green" : "red")}>{get.Change} %</td></tr><tr><th scope ='row'>1hr Change</th><td class={(get.Change1Hour > 0 ? "green" : "red")}>{get.Change1Hour} %</td></tr><tr><th scope ='row'>1week Change</th><td class={(get.Change1Week > 0 ? "green" : "red")}>{get.Change1Week} %</td></tr><tr><th scope ='row'>All Time High</th><td>{get.AllTimeHigh}</td></tr><tr><th scope ='row'>All Time Low</th><td>{get.AllTimeLow}</td></tr><tr><th scope ='row'>Earliest Price</th><td>{get.EarliestKnownPrice}</td></tr></tbody></table>" )); }