| layout | title | parent | nav_order |
|---|---|---|---|
default |
Chapter 1: Getting Started with OpenBB |
OpenBB Tutorial |
1 |
Welcome to your journey with OpenBB! This chapter will guide you through installing and setting up the OpenBB Platform, understanding its core components, and creating your first investment research analysis.
- OpenBB Platform architecture and components
- Installation methods (pip, Docker, source)
- Basic configuration and setup
- First investment analysis walkthrough
- Core concepts and terminology
OpenBB consists of several key components working together to provide comprehensive investment research capabilities:
graph TB
subgraph "Data Providers"
A[Alpha Vantage]
B[Financial Modeling Prep]
C[Intrinio]
D[Polygon.io]
E[Custom APIs]
end
subgraph "Core Engine"
F[Data Fetcher]
G[Analysis Engine]
H[Portfolio Manager]
I[Charting Engine]
end
subgraph "User Interfaces"
J[Terminal CLI]
K[Web Dashboard]
L[Python SDK]
M[REST API]
end
subgraph "Extensions"
N[Custom Providers]
O[Analysis Modules]
P[Integration Hooks]
end
A --> F
B --> F
C --> F
D --> F
E --> F
F --> G
G --> H
G --> I
G --> J
G --> K
G --> L
G --> M
N --> F
O --> G
P --> M
- Data Providers: Integration with 100+ financial data sources
- Core Engine: Data processing, analysis, and portfolio management
- User Interfaces: Terminal, web, SDK, and API access
- Extensions: Custom providers and analysis modules
# Install OpenBB Platform
pip install openbb
# Verify installation
openbb --version
# Update to latest version
pip install --upgrade openbb
# Install optional dependencies
pip install openbb[all] # Install all optional dependencies# Pull OpenBB Docker image
docker pull ghcr.io/openbb-finance/openbb:latest
# Run OpenBB container
docker run -it --rm ghcr.io/openbb-finance/openbb:latest
# Run with web interface
docker run -p 8501:8501 ghcr.io/openbb-finance/openbb:latest --web# Clone the repository
git clone https://github.com/OpenBB-finance/OpenBB.git
cd OpenBB
# Create virtual environment
python -m venv openbb_env
source openbb_env/bin/activate # On Windows: openbb_env\Scripts\activate
# Install in development mode
pip install -e .
# Install optional dependencies
pip install -e .[all]# Create conda environment
conda create -n openbb python=3.10
conda activate openbb
# Install OpenBB
pip install openbb
# Or install from conda-forge
conda install -c conda-forge openbb# Set API keys as environment variables
export OPENBB_API_KEY_ALPHA_VANTAGE="your_alpha_vantage_key"
export OPENBB_API_KEY_FMP="your_fmp_key"
export OPENBB_API_KEY_INTRINIO="your_intrinio_key"
export OPENBB_API_KEY_POLYGON="your_polygon_key"
# Or create a .env file
cat > .env << EOF
OPENBB_API_KEY_ALPHA_VANTAGE=your_alpha_vantage_key
OPENBB_API_KEY_FMP=your_fmp_key
OPENBB_API_KEY_INTRINIO=your_intrinio_key
OPENBB_API_KEY_POLYGON=your_polygon_key
EOF# ~/.openbb/config.json
{
"data": {
"sources": {
"alpha_vantage": {
"api_key": "your_key_here"
},
"financial_modeling_prep": {
"api_key": "your_key_here"
}
}
},
"interface": {
"theme": "dark",
"language": "en"
},
"export": {
"default_format": "csv",
"output_directory": "~/openbb_exports"
}
}# Install Jupyter support
pip install jupyter
# Launch OpenBB in Jupyter
import openbb
openbb.launch()
# Or use the OpenBB extension
%load_ext openbb# Launch OpenBB terminal
openbb
# You'll see the OpenBB prompt:
# >>>
# Get help
help
# List available commands
/
# Exit OpenBB
exit# Launch web interface
openbb --web
# Or specify port
openbb --web --port 8502
# Access at http://localhost:8501# Import OpenBB
from openbb import obb
# Initialize with API keys
obb.account.login(
alpha_vantage="your_key",
fmp="your_key"
)
# Use OpenBB functions
data = obb.stocks.quote("AAPL")
print(data)# Launch OpenBB
openbb
# Get stock quote
/equity/quote AAPL
# Get historical data
/equity/historical AAPL --start 2023-01-01 --end 2023-12-31
# View company information
/equity/profile AAPL
# Get financial statements
/equity/financials AAPL# Load stock data
/equity/load AAPL
# Calculate technical indicators
/ta/sma --length 20
/ta/rsi --length 14
/ta/macd
# Plot charts
/chart# Get key metrics
/equity/metrics AAPL
# View valuation ratios
/equity/ratios AAPL
# Get analyst recommendations
/equity/analyst AAPL
# View earnings calendar
/equity/calendar# Clear pip cache and reinstall
pip cache purge
pip uninstall openbb
pip install openbb
# Check Python version compatibility
python --version# Verify API keys
openbb
/account
# Test data provider connection
/equity/quote AAPL --source alpha_vantage# Check system resources
free -h # Linux
vm_stat # macOS
# Increase Python memory limit
export PYTHONOPTIMIZE=1# Check Docker status
docker --version
docker ps
# Clean up Docker
docker system prune -a
# Run with increased memory
docker run --memory=4g ghcr.io/openbb-finance/openbb:latest# Stock data
/equity/quote SYMBOL # Get current quote
/equity/historical SYMBOL # Get historical data
/equity/profile SYMBOL # Get company profile
# Market data
/market/overview # Market overview
/market/indices # Major indices
/market/sector # Sector performance
# Economic data
/economy/gdp # GDP data
/economy/inflation # Inflation data
/economy/interest # Interest rates# Technical analysis
/ta/sma # Simple moving average
/ta/rsi # Relative strength index
/ta/macd # MACD indicator
# Fundamental analysis
/equity/financials SYMBOL # Financial statements
/equity/ratios SYMBOL # Valuation ratios
/equity/metrics SYMBOL # Key metrics# Portfolio management
/portfolio/load FILE # Load portfolio
/portfolio/show # Show portfolio
/portfolio/holdings # View holdings
/portfolio/performance # Performance analysis- Primary Sources: Real-time market data providers
- Secondary Sources: Financial statements and fundamentals
- Alternative Sources: News, social media, satellite data
- Technical Analysis: Price and volume patterns
- Fundamental Analysis: Financial health and valuation
- Quantitative Analysis: Statistical modeling
- Sentiment Analysis: Market psychology
- Equities: Stocks and ETFs
- Fixed Income: Bonds and treasuries
- Commodities: Gold, oil, agriculture
- Cryptocurrencies: Digital assets
- Derivatives: Options and futures
import psutil
import openbb
def check_system_health():
"""Check OpenBB system health"""
# Check memory usage
memory = psutil.virtual_memory()
print(f"Memory Usage: {memory.percent}%")
# Check disk space
disk = psutil.disk_usage('/')
print(f"Disk Usage: {disk.percent}%")
# Test OpenBB connection
try:
data = openbb.stocks.quote("AAPL")
print("OpenBB Connection: OK")
except Exception as e:
print(f"OpenBB Connection: ERROR - {e}")
def monitor_performance():
"""Monitor OpenBB performance"""
import time
# Test response time
start_time = time.time()
data = openbb.stocks.quote("AAPL")
end_time = time.time()
response_time = end_time - start_time
print(f"Response Time: {response_time:.2f} seconds")
if __name__ == "__main__":
check_system_health()
monitor_performance()Congratulations! 🎉 You've successfully:
- ✅ Installed OpenBB Platform
- ✅ Configured API keys and settings
- ✅ Launched both terminal and web interfaces
- ✅ Performed your first stock analysis
- ✅ Explored basic commands and features
Ready to explore financial data sources? Let's dive into Chapter 2: Data Access to learn about connecting to various financial data providers.
Practice what you've learned:
- Experiment with different installation methods
- Configure multiple data source API keys
- Try various stock analysis commands
- Set up both terminal and web interfaces
- Create a basic system monitoring script
What's the first stock or asset you analyzed with OpenBB? 📈
Most teams struggle here because the hard part is not writing more code, but deciding clear boundaries for openbb, OpenBB, equity so behavior stays predictable as complexity grows.
In practical terms, this chapter helps you avoid three common failures:
- coupling core logic too tightly to one implementation path
- missing the handoff boundaries between setup, execution, and validation
- shipping changes without clear rollback or observability strategy
After working through this chapter, you should be able to reason about Chapter 1: Getting Started with OpenBB as an operating subsystem inside OpenBB Tutorial: Complete Guide to Investment Research Platform, with explicit contracts for inputs, state transitions, and outputs.
Use the implementation notes around AAPL, install, quote as your checklist when adapting these patterns to your own repository.
Under the hood, Chapter 1: Getting Started with OpenBB usually follows a repeatable control path:
- Context bootstrap: initialize runtime config and prerequisites for
openbb. - Input normalization: shape incoming data so
OpenBBreceives stable contracts. - Core execution: run the main logic branch and propagate intermediate state through
equity. - Policy and safety checks: enforce limits, auth scopes, and failure boundaries.
- Output composition: return canonical result payloads for downstream consumers.
- Operational telemetry: emit logs/metrics needed for debugging and performance tuning.
When debugging, walk this sequence in order and confirm each stage has explicit success/failure conditions.
Use the following upstream sources to verify implementation details while reading this chapter:
- GitHub Repository
Why it matters: authoritative reference on
GitHub Repository(github.com). - Extension Marketplace
Why it matters: authoritative reference on
Extension Marketplace(github.com). - AI Codebase Knowledge Builder
Why it matters: authoritative reference on
AI Codebase Knowledge Builder(github.com).
Suggested trace strategy:
- search upstream code for
openbbandOpenBBto map concrete implementation paths - compare docs claims against actual runtime/config code before reusing patterns in production