valenoq.api.request.get
Get the time series data for the provided ticker(s).
valenoq.api.request.balance_sheet
Get the balance sheet data for the provided ticker(s).
valenoq.api.config.get
Getting configuration data from a local config file (~/.valenoq/api.config)
valenoq.api.config.set
Storing configuration data into a local config file (~/.valenoq/api.config)
valenoq.api.request.
balance_sheet
Returns the balance sheet for specified tickers and quarter.
The ticker name or list of ticker names for which the data is requested The maximum length of the list is 5
The API key (available after registration at https://valenoq.com). If api_key is not provided and the configuration was skipped, then the returned balance sheet will be truncated
The number of quarters (since the last one) for which the data is requested. Maximum limit is 12. Default value: 1 (latest reported balance sheet is returned)
The format of the output. Default value: pandas DataFrame object.
Examples
Last quarter balance sheet for a ticker:
>>> data = request.balance_sheet("AAPL")
Last quarter balance sheet for a list of tickers:
>>> data = request.balance_sheet(["AAPL", "INTC"])
Five last balance sheets for “AAPL”:
>>> data = request.balance_sheet("AAPL", nr_quarters=5)
get
Returns the historical time series either for intraday or end-of-the day data.
The start date of the data series
The end date of the data series Must be provided is the start day is not empty
The requested date.
The API key (available after registration at https://valenoq.com). If api_key is not provided and the configuration was skipped, then the returned time series will be truncated
The data frequency. Default value: “hour”
The interval of intraday data. Applicable only when the frequence is “minute”. If the requested frequency is either “hour” or “day”, then the provided value of collapse is ignored and the default 1 is used.
Default values: - 5 if the requested frequency is “minute” - 1 otherwise
The format of the output. Default value: pandas DataFrame object
1-day bar:
>>> data = request.get("AAPL", date="2018-05-01", frequency="day") >>> data close high low open vol ticker dt 2018-05-01 169.1 169.2 165.27 166.41 53569300.0 AAPL
1-minute bars for “AAPL”:
>>> data = request.get("AAPL", date="2018-05-01", frequency="minute", collapse=1)
1-minute bars for a list of tickers:
>>> request.get(["AAPL", "TSLA"], date="2018-05-01", frequency="minute", collapse=1)
1-minute bars for a list of tickers and interval of dates:
>>> tickers = ["AAPL", "TSLA"] >>> request.get(tickers, start="2018-05-01", end="2018-05-02", frequency="minute", collapse=1)
valenoq.api.config.
Getting current api_key:
>>> config.get("api_key")
set
Setting api_key globally:
>>> config.set(api_key="yourApiKey")