{
"endpoint": "live",
"quotes": [
{
"ask": 1.21153,
"base_currency": "EUR",
"bid": 1.21153,
"mid": 1.21153,
"quote_currency": "USD"
},
{
"ask": 1.39483,
"base_currency": "GBP",
"bid": 1.39481,
"mid": 1.39482,
"quote_currency": "USD"
}
],
"requested_time": "Thu, 29 Apr 2021 16:19:11 GMT",
"timestamp": 1619713151
}
this is my Result i want to get the output from API and deserialized it i tried it but got the
Input string was not in a correct format: c#
Error can you help me on that
What I have tried:
private async void getCurrentPrize()
{
HttpClient client = new HttpClient();
HttpResponseMessage response = await client.GetAsync("https://marketdata.tradermade.com/api/v1/live?currency=EURUSD,GBPUSD&api_key=_xxxxxxxxxxxxx");
response.EnsureSuccessStatusCode();
var responseBody = await response.Content.ReadAsStringAsync();
var result = JsonConvert.DeserializeObject<CurrencyDetails>(responseBody);
CurrencyDetails deserialized = new CurrencyDetails();
foreach (var item in result.quotes)
{
}
public class CurrencyDetails
{
public string endpoint { get; set; }
public List<quotes> quotes { get; set; }
public string requested_time { get; set; }
public long timestamp { get; set; }
}
public class quotes
{
public double ask { get; set; }
public double bid { get; set; }
public string base_currency { get; set; }
public double mid { get; set; }
public string quote_currency { get; set; }
}
this is my code can you help me on this