一個跨平台的 Flutter 套件,提供對股票、商品和加密貨幣的即時與歷史金融資料存取。它讓開發者能夠從亞馬遜、谷歌、黃金、石油、比特幣和以太坊等各種資產中取得報價資訊與當前價格。專為整合至金融相關應用而設計,支援跨平台使用,並具備簡單的 API。此套件非常適合用來建構投資追蹤器、投資組合儀表板或交易工具。它依賴外部 API 取得資料,並需正確設定驗證與頻率限制。
適用情境
股票價格追蹤
加密貨幣市場監控
商品價格更新
投資組合價值計算
財務儀表板開發
主要特色
支援股票、加密貨幣和商品
即時與歷史資料
跨平台相容性
簡單 API 界面
可擴充的資料檢索
適合對象
金融應用開發者
投資追蹤工具
交易平台整合
教育金融應用
個人預算應用
使用建議
需要 API 金鑰設定
依賴第三方資料提供者
可能套用速率限制
資料準確性取決於來源
需要網路連接
原始 README
以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。
A Dart plugin for retrieving financial quote prices.
This package provides a set of high-level functions and classes that make it easy to retrieve financial quote information and prices for stocks (Amazon, Google, ...), commodities (Gold, Oil, ...) and crypto-currencies (Bitcoin, Ethereum, ...). It's platform-independent, supports iOS and Android.
Using
The easiest way to use this library is via the top-level functions. They allow you to make quote price requests with minimal hassle:
finalMap<String, Map<String, String>> quotePrice =
awaitFinanceQuote.getPrice(
quoteProvider: QuoteProvider.yahoo, symbols: <String>['KO']);
print('Number of quotes retrieved: ${quotePrice.keys.length}.');
print('Number of attributes retrieved for KO: ${quotePrice['KO'].keys.length}.');
print('Current market price for KO: ${quotePrice['KO']['price']}.');
If you're making multiple quote requests to the same server, you can request all of them in a single function call:
finalMap<String, Map<String, String>> quotePrice =
awaitFinanceQuote.getPrice(
quoteProvider: QuoteProvider.yahoo, symbols: <String>['KO', 'GOOG']);
print('Number of quotes retrieved: ${quotePrice.keys.length}.');
print('Number of attributes retrieved for KO: ${quotePrice['KO'].keys.length}.');
print('Current market price for KO: ${quotePrice['KO']['price']}.');
print('Number of attributes retrieved for GOOG : ${quotePrice['GOOG'].keys.length}.');
print('Current market price for KO: ${quotePrice['GOOG']['price']}.');
If you want all available quote data from the selected provider, you can request it with the function call:
finalMap<String, Map<String, dynamic>> cryptoQuoteRaw =
awaitFinanceQuote.getRawData(
quoteProvider: QuoteProvider.coincap, symbols: <String>['bitcoin', 'ethereum']);
print('Number of quotes retrieved: ${cryptoQuoteRaw.keys.length}.');
print('Number of attributes retrieved for bitcoin : ${cryptoQuoteRaw['bitcoin'].keys.length}.');
print('Current market price for bitcoin: ${cryptoQuoteRaw['bitcoin']['priceUsd']}.');
print('Number of attributes retrieved for ethereum: ${cryptoQuoteRaw['ethereum'].keys.length}.');
print('Current market price for ethereum: ${cryptoQuoteRaw['ethereum']['priceUsd']}.');
Supported providers
Yahoo
Morningstar
Coinmarketcap
Coincap
Binance
TERMS & CONDITIONS
Quote information fetched through this module is bound by the quote providers terms and conditions.