你的查詢不正確。檢查文檔中的符號搜索,您的URL必須為function查詢傳入SYMBOL_SEARCH。 您對關鍵字的查詢也沒有按應有的URL編碼,因此"S&P 500"有一個問題,即在插入字符串時創建了無效查詢。更好的方法是使用URLComponents,這樣可以安全地處理這個問題。 Code: func fetchSymbols(keyword: String) -> AnyPublisher<SearchResults, Error> { guard var components = URLComponents(string: "https://www.alphavantage.co/query") else { return Fail( outputType: SearchResults.self, failure: APIError.invalidComponents ).eraseToAnyPublisher() } components.queryItems = [ URLQueryItem(name: "function", value: "SYMBOL_SEARCH"), URLQueryItem(name: "keywords", value: keyword), URLQueryItem(name: "apikey", value: