using System; using System.Net.Http; using System.Text.Json; // Read the list of covered funds (one GET, no key), naming your own project using var http = new HttpClient(); http.DefaultRequestHeaders.UserAgent.ParseAdd( "MyProject/1.0 (+https://example.com)"); using var doc = JsonDocument.Parse(await http.GetStringAsync( "https://tickerinside.com/api/v1/funds.json")); var list = doc.RootElement; // funds: read from their issuers' own files, with the date of the data Console.WriteLine($"{list.GetProperty("count").GetInt32()} funds from issuer " + $"files, as_of {list.GetProperty("as_of").GetString()}"); // sec_funds: more US stock ETFs, from SEC filings, t and n as in funds Console.WriteLine($"{list.GetProperty("sec_count").GetInt32()} more from SEC " + "filings, listed in sec_funds"); // One entry per fund: t is the ticker, n the name foreach (var f in list.GetProperty("funds").EnumerateArray()) { Console.WriteLine( $"{f.GetProperty("t").GetString()} {f.GetProperty("n").GetString()}"); }