3,600 questions
The result is not a list it is a single object that contains a list. .NET Core Console application
using HttpClientConsole;
using System.Text.Json;
HttpClient client = new HttpClient();
Rootobject root = new Rootobject();
var result = await client.GetAsync("https://www.amiiboapi.com/api/amiibo/");
if (result.IsSuccessStatusCode)
{
var json = await result.Content.ReadAsStringAsync();
root = JsonSerializer.Deserialize<Rootobject>(json);
}
foreach (var item in root.amiibo)
{
Console.WriteLine(item.character);
}
public class Rootobject
{
public Amiibo[] amiibo { get; set; }
}
public class Amiibo
{
public string amiiboSeries { get; set; }
public string character { get; set; }
public string gameSeries { get; set; }
public string head { get; set; }
public string image { get; set; }
public string name { get; set; }
public Release release { get; set; }
public string tail { get; set; }
public string type { get; set; }
}
public class Release
{
public string au { get; set; }
public string eu { get; set; }
public string jp { get; set; }
public string na { get; set; }
}