fin_quote 0.1.4
fin_quote: ^0.1.4 copied to clipboard

A multi-platform API to retrieve quote information and prices for stocks (e.g. Amazon, Google), commodities (e.g. Gold, Oil) and crypto-currencies (e.g. Bitcoin, Ethereum).

example/main.dart

import 'package:fin_quote/fin_quote.dart';

Future<void> main(List<String> arguments) async {
  final Map<String, Map<String, dynamic>> quoteRaw =
      await FinanceQuote.getRawData(
          quoteProvider: QuoteProvider.yahoo, symbols: <String>['KO', 'GOOG']);

  print('Number of quotes retrieved: ${quoteRaw.keys.length}.');
  print(
      'Number of attributes retrieved for KO: ${quoteRaw['KO'].keys.length}.');
  print(
      'Current market price for KO: ${quoteRaw['GOOG']['regularMarketPrice']}.');
  print(
      'Number of attributes retrieved for GOOG: ${quoteRaw['GOOG'].keys.length}.');
  print(
      'Current market price for KO: ${quoteRaw['GOOG']['regularMarketPrice']}.');

  final Map<String, Map<String, String>> quotePrice =
      await FinanceQuote.getInfo(
          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']}.');

  final Map<String, Map<String, dynamic>> cryptoQuoteRaw =
      await FinanceQuote.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']}.');
}
4
likes
90
pub points
52%
popularity

Publisher

Unknown

A multi-platform API to retrieve quote information and prices for stocks (e.g. Amazon, Google), commodities (e.g. Gold, Oil) and crypto-currencies (e.g. Bitcoin, Ethereum).

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD (LICENSE)

Dependencies

html, http, intl, logger, meta

More

Packages that depend on fin_quote