BavestRestClient class

The BavestRestClient class is the http rest client for the bavest finance api. To use it, you will need to provide an api key. To get an api key, please visit https://dashboard.bavest.co and create an account.

Bavest provide a free tier for developers and open-source projects. Please contact us at sales@bavest.co if you are interested.

import 'package:bavest/bavest.dart';

// Usage:
final client = BavestRestClient(api_key);

// Get quote for Apple
client.quote(SecurityIdentifier(symbol: "AAPL"));

Please checkout https://docs.bavest.co/ for more information.

Inheritance

Constructors

BavestRestClient(String apiKey)
The BavestRestClient factory constructor is used to create a singleton instance of the BavestRestClient class.
factory

Properties

apiKey String
The apiKey is the api key you get from https://dashboard.bavest.co It is required to make requests to the bavest finance api.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

balance(SecurityIdentifier id, {String? currency, Freq mode = Freq.annual}) Future<Balance>
The balance method is used to get the balance sheet for a given stock symbol. By default, the balance sheet is returned in EUR. You can specify a different currency by passing the currency argument.
override
candle(SecurityIdentifier id, String from, String to, CandleResolution resolution, {String? currency}) Future<Candles>
The candle method is used to get the candle data for a given stock symbol. By default, the candle data is returned in EUR. You can specify a different currency by passing the currency argument.
override
cashflow(SecurityIdentifier id, {String? currency, Freq mode = Freq.annual}) Future<Cashflow>
The cashflow method is used to get the cashflow statement for a given stock symbol. By default, the cashflow statement is returned in EUR. You can specify a different currency by passing the currency argument.
override
companyNews(SecurityIdentifier id) Future<List<News>>
The news method is used to get the news for a given stock symbol.
override
dividends(SecurityIdentifier id, {String? currency}) Future<Dividends>
The dividends method is used to get the dividends for a given stock symbol. By default, the dividends are returned in EUR. You can specify a different currency by passing the currency argument.
override
esg(SecurityIdentifier id) Future<Esg>
The esg method is used to get the ESG scores for a given stock symbol.
override
etfCountry(SecurityIdentifier id) Future<EtfCountry>
The etfCountry method is used to get the ETF country for a given ETF symbol.
override
etfHoldings(SecurityIdentifier id) Future<EtfHoldings>
The etfHoldings method is used to get the ETF holdings for a given ETF symbol.
override
etfProfile(SecurityIdentifier id) Future<EtfProfile>
The etfProfile method is used to get the ETF profile for a given ETF symbol.
override
etfSector(SecurityIdentifier id) Future<EtfSector>
The etfSector method is used to get the ETF sectors for a given ETF symbol.
override
forex(String fromCurrency, String toCurrency) Future<Forex>
The forex method is used to get the forex rates for a given stock symbol.
override
fundamentals(SecurityIdentifier id) Future<Fundamentals>
The fundamentals method is used to get the fundamentals for a given stock symbol.
override
income(SecurityIdentifier id, {String? currency, Freq mode = Freq.annual}) Future<Income>
The income method is used to get the income statement for a given stock symbol. By default, the income statement is returned in EUR. You can specify a different currency by passing the currency argument.
override
ipos() Future<Ipo>
The ipos endpoint returns upcoming initial public offerings (IPOs) and their expected release dates.
override
metric(SecurityIdentifier id) Future<Metric>
The metric method is used to get the metric for a given stock symbol.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
peersWidget(SecurityIdentifier id) Future<List<PeersWidget>>
The peersWidget endpoint returns a list of peers for a given stock symbol. The list contains the symbol, name and logo of the peers.
override
portfolioAllocation(Portfolio portfolio) Future<List<PortfolioAllocation>>
The portfolioAllocation method is used to get the portfolio allocation for a given portfolio.
override
portfolioBenchmark(Portfolio portfolio) Future<void>
The portfolioBenchmark method is used to get the portfolio benchmark for a given portfolio.
override
portfolioChart(Portfolio portfolio, {String currency = "EUR", required int from, required int to, required CandleResolution resolution}) Future<Candles>
The portfolioChart method is used to get the portfolio chart for a given portfolio.
override
portfolioMetrics(Portfolio portfolio, {String currency = 'EUR'}) Future<PortfolioMetric>
The portfolioMetrics method is used to get the portfolio metrics for a given portfolio.
override
portfolioPrice(Portfolio portfolio, {String currency = "EUR"}) Future<Quote>
The portfolioPrice method is used to get the portfolio price for a given portfolio.
override
portfolioRegion(Portfolio portfolio) Future<List<PortfolioRegion>>
The portfolioRegion method is used to get the portfolio regions for a given portfolio.
override
portfolioSector(Portfolio portfolio, {String currency = "EUR"}) Future<List<PortfolioSector>>
The portfolioSector method is used to get the portfolio sectors for a given portfolio.
override
portfolioStats(Portfolio portfolio, {String currency = "EUR", required int from, required int to, required CandleResolution resolution}) Future<PortfolioStats>
The portfolioStats method is used to get the portfolio stats for a given portfolio.
override
profile(SecurityIdentifier id) Future<CompanyProfile>
The profile method is used to get the profile for a given stock symbol. Market capitalisation is adjusted by the specified currency and is NOT in million. The zip code, isin and city can be empty.
override
quote(SecurityIdentifier id, {String? currency}) Future<Quote>
The quote method is used to get the quote for a given stock symbol. By default, the quote is returned in EUR. You can specify a different currency by passing the currency argument.
override
The search method is used to get the search for given symbols. The query argument is used to specify the query to search for.
override
sentiment(SecurityIdentifier id) Future<Sentiment>
The sentiment method is used to get the sentiment for a given stock symbol.
override
splits(SecurityIdentifier id, {int years = 1}) Future<Splits>
The splits method is used to get the splits for a given stock symbol. The id argument is used to specify the stock id. The years argument is used to specify the number of years to get the splits for.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited