A Swift Package / Library for asynchronous API access to finance.yahoo.com REST API endpoints. H/T to Alfian.
- Fetching chart data for an array of timeframes
- Search for stock ticker symbols by company name
- Fetch quotes via ticker symbol
- Uses Swift concurrency (async/await)
- Fetches raw JSON data
- Available on iOS, macOS, macCatalyst, tvOS, watchOS
- Use SwiftUI or UIKit
- File > Swift Packages > Add Package Depenency
- Add repo url (https://github.com/waynedahlberg/WKDStocksAPI.git)
- Use "Main" branch
Import and init the WKDStocksAPI
.
import WKDStocksAPI
let api = WKDStocksAPI()
let appleChart1d = try await api.fetchChartData(tickerSymbol: "AAPL", range: .oneDay)
let tickers = try await api.searchTicker(query: "Tesla")
let quotes = api.fetchQuotes(symbols: "AAPL, TSLA, GOOG, MSFT")