package main import ( "encoding/json" "fmt" "log" "net/http" "time" ) func main() { // Read NVDA's file (one GET, no key), naming your own project req, err := http.NewRequest("GET", "https://tickerinside.com/api/v1/sec/nvda.json", nil) if err != nil { log.Fatal(err) } req.Header.Set("User-Agent", "MyProject/1.0 (+https://example.com)") client := &http.Client{Timeout: 30 * time.Second} resp, err := client.Do(req) if err != nil { log.Fatal(err) } defer resp.Body.Close() if resp.StatusCode != http.StatusOK { log.Fatalf("HTTP %d", resp.StatusCode) } // Decode the fields this example uses var stock struct { HeldBy int `json:"held_by"` HeldBySecNport int `json:"held_by_sec_nport"` Holders [][]any `json:"holders"` CiteAs string `json:"cite_as"` } if err := json.NewDecoder(resp.Body).Decode(&stock); err != nil { log.Fatal(err) } // How many funds hold it: in their issuers' own files, and in SEC filings fmt.Println("NVDA held_by", stock.HeldBy, "(issuer files), held_by_sec_nport", stock.HeldBySecNport, "(SEC filings)") // holders is sorted, largest weight first: [fund, weight %, file date] for _, h := range stock.Holders { fmt.Println(h[0], h[1], h[2]) } // The line to print under any figure you quote fmt.Println(stock.CiteAs) }