Python SDK

Free API key for Open-Source projects

First, use the TypeForm to provide all the required information. After registration, you will receive an API key by email, if you are admitted to the program.

Install the package

First install the python package using pip:

pip install bavest 

Documentation

See here for more information.

Usage

  1. Now, use the package in your project:
from bavest import BavestRESTClient
  1. Create a finance client:
client = BavestRESTClient(apiKey)
  1. Now you can use it to get data from the api:
quote = client.quote("AAPL")

Examples

to = datetime.now()
frm = to + dateutil.relativedelta.relativedelta(days=-20)
resolution = Resolution.MONTHLY
candles = client.candles(symbol, frm, to, resolution)
news = client.news(symbol)
search = client.search(symbol)
forex = client.forex(frm, to)

# ETF
etfSector = client.etf.sector(symbol)
etfCountry = client.etf.country(symbol)
etfHoldings = client.etf.holdings(symbol)
etfProfile = client.etf.profile(symbol)

# Portfolio Items
transactionItem = TransactionItem("MSFT", 2, frm).get()
transactionList = [transactionItem]

portfolioRegion = client.portfolio.region(transactionList)
portfolioStats = client.portfolio.stats(frm, to, resolution, transactionList, "USD")
portfolioChart = client.portfolio.chart(frm, to, resolution, transactionList)