using System.Collections;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
public static void Test()
var jsonString = GetJson();
var jtoken = JToken.Parse(jsonString);
var ids = jtoken.SelectTokens("data.cars.results[*].id").Select(id => (int)id).ToArray();
Console.WriteLine("{0} ids found:", ids.Length);
Console.WriteLine(string.Join(",", ids));
static string GetJson() =>
public static void Main()
Console.WriteLine("Environment version: {0} ({1}), {2}", System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription , Environment.Version, Environment.OSVersion);
Console.WriteLine("{0} version: {1}", typeof(JsonSerializer).Namespace, typeof(JsonSerializer).Assembly.FullName);
Console.WriteLine("Failed with unhandled exception: ");