Skip to main content

Behavioral Analysis

The BA module provides programmatic access to the commands from within the OpenBB Terminal. Import the OpenBB SDK module, and then access the functions similarly to how the Terminal menus are navigated. The code completion will be activated upon entering ., after, openbb.ba

How to Use

​ The examples provided below will assume that the following import block is included at the beginning of the Python script or Notebook file: ​

from openbb_terminal.sdk import openbb

​ A brief description below highlights the main Functions and Modules available in the BA SDK

PathTypeDescription
openbb.stocks.ba.bullbearFunctionEstimate Quick Sentiment
openbb.stocks.ba.headlinesFunctionSentiment from 15+ News Headlines
openbb.stocks.ba.spaccFunctionShows SPAC announcements from SPAC subreddit
openbb.stocks.ba.watchlistFunctionShow Other User's Watchlists
openbb.stocks.ba.messagesFunctionOutput last 30 messages on the board
openbb.stocks.ba.mentionsFunctionInterest Over Time Based on Mentions
openbb.stocks.ba.histFunctionPlot Historical RHI and AHI
openbb.stocks.ba.snewsFunctionStock Price Plotted Over Sentiment
openbb.stocks.ba.redditsentFunctionSearch for Tickers and Find Sentiment
openbb.stocks.ba.popularFunctionShow Popular Tickers
openbb.stocks.ba.spacFunctionShows Other User's SPAC Announcements
openbb.stocks.ba.getddFunctionGet Due Diligence
openbb.stocks.ba.regionsFunctionRegions Showing the Highest Interest
openbb.stocks.ba.trendingFunctionTrending Stocks
openbb.stocks.ba.wsbFunctionHighlights from WSB Subreddit
openbb.stocks.ba.queriesFunctionTop Related Queries
openbb.stocks.ba.sentimentFunctionStock Sentiment Prediction from Last Tweets
openbb.stocks.ba.inferFunctionStock Sentiment from Last Tweets
openbb.stocks.ba.stalkerFunctionStocktwit's last messages
openbb.stocks.ba.riseFunctionTop Rising Related Queries

Alternatively you can print the contents of the BA SDK with:

help(openbb.stocks.ba)

Examples

headlines

Sentiment from over 15 news headlines for each day. This data can be used for further analysis of the stock

openbb.stocks.ba.headlines("TSLA")
dateSentiment Analysis
2022-11-09 00:00:000.209
2022-11-10 00:00:00-0.025
2022-11-11 00:00:000.027
2022-11-14 00:00:00-0.402
2022-11-15 00:00:00-0.122
2022-11-16 00:00:00-0.35
2022-11-17 00:00:000.156
2022-11-18 00:00:000.216
2022-11-21 00:00:00-0.071
2022-11-22 00:00:00-0.003

regions

See the top regions where a stock is searched

openbb.stocks.ba.regions("TSLA")
geoNameTSLA
Canada100
United States95
Singapore94
Estonia51
Taiwan50
Slovenia40
Switzerland36
Denmark36
New Zealand33
Sweden31
Finland24
Australia24
Belgium22
Czechia20
Bulgaria18
United Arab Emirates17
United Kingdom15
Portugal12
Austria11
Romania10
South Africa7
Saudi Arabia7
Germany7
Argentina6
Spain6
France4
Colombia4
Philippines4
Brazil4
Thailand4
Poland3
Vietnam2
Russia2
Turkey2
Pakistan0

rise

See which search queries are popular right now

openbb.stocks.ba.rise("AAPL")
queryvalue
0nio220300
1nio stock106650
2pltr stock64750
3mrna stock59750
4nio stock price53450
5zm stock49500
6bynd44850
7pltr41000
8spce37350
9zm31650