From a34dca10767d96dfe0ae2ba6e53ac0db9095f104 Mon Sep 17 00:00:00 2001 From: Steven Polley Date: Wed, 7 May 2025 12:06:39 -0600 Subject: [PATCH] spoof user agent string for yahoo finance API --- providers/staticjsonYahooFinance/client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/providers/staticjsonYahooFinance/client.go b/providers/staticjsonYahooFinance/client.go index 333d668..7c9c7cf 100644 --- a/providers/staticjsonYahooFinance/client.go +++ b/providers/staticjsonYahooFinance/client.go @@ -26,6 +26,9 @@ func (c *client) get(endpoint string, out interface{}, query url.Values) error { return err } + // Yahoo finance requires user agent string now? + req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0") + res, err := c.httpClient.Do(req) if err != nil { return fmt.Errorf("http get request failed: %v", err)