public AlphaVantageBestMatches Search(string ticker)
        {
            var contentJson = AlphaVantageBaseConnection.GetDownloadString("SYMBOL_SEARCH", ticker);

            try
            {
                var bestMatches = JsonConvert.DeserializeObject <AlphaVantageBestMatches>(contentJson);
                return(bestMatches);
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine($"Failed to deserialize the quote for: {ticker}, {e.Message}");
            }

            return(null);
        }
Esempio n. 2
0
        public static AlphaVantageQuote FetchGlobalQuote(string ticker)
        {
            var contentJson = AlphaVantageBaseConnection.GetDownloadString("GLOBAL_QUOTE", ticker);

            try
            {
                var currentStockQuote = JsonConvert.DeserializeObject <AlphaVantageQuote>(contentJson);
                return(currentStockQuote);
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine($"Failed to deserialize the quote for: {ticker}, {e.Message}");
            }

            return(null);
        }