Data extensions organize the OpenBB Platform's financial data capabilities into logical business domains such as equity, economy, ETF, fixed income, currency, crypto, and regulatory data. Each extension exposes a set of endpoints (commands) that accept multiple provider implementations through a unified interface.
For information about the provider system that supplies data to these extensions, see Provider Architecture. For details on the extension discovery and loading mechanism, see Extension System. For the command execution flow, see Command Execution Engine.
Sources: openbb_platform/extensions/economy/openbb_economy/economy_router.py1-636 openbb_platform/extensions/equity/integration/test_equity_python.py1-100
Each data extension follows a standard directory layout:
openbb_platform/extensions/{extension_name}/
├── openbb_{extension_name}/
│ ├── {extension_name}_router.py # Main router with command definitions
│ ├── {sub_domain}/ # Optional sub-routers
│ │ └── {sub_domain}_router.py
│ └── __init__.py
├── integration/
│ ├── test_{extension_name}_api.py # API integration tests
│ └── test_{extension_name}_python.py # Python interface tests
└── pyproject.toml # Entry point registration
Sources: openbb_platform/extensions/economy/openbb_economy/economy_router.py1-25 openbb_platform/extensions/economy/openbb_economy/survey/survey_router.py1-14
Extensions use the Router class to define their command structure:
Diagram: Extension Router Hierarchy and Command Execution Pattern
All commands follow this pattern from openbb_platform/extensions/economy/openbb_economy/economy_router.py56-63:
Sources: openbb_platform/extensions/economy/openbb_economy/economy_router.py21-24 openbb_platform/extensions/economy/openbb_economy/economy_router.py36-63
Each command specifies:
"ConsumerPriceIndex")APIEx and PythonExStandardParams, ExtraParams, ProviderChoicesDiagram: Command to Provider Resolution Flow
Sources: openbb_platform/extensions/economy/openbb_economy/economy_router.py66-96
The economy extension provides macroeconomic data through the main router and three sub-routers:
| Router | Prefix | Key Endpoints |
|---|---|---|
| Main | /economy | calendar, cpi, fred_search, fred_series, unemployment, balance_of_payments, interest_rates, retail_prices |
| GDP | /economy/gdp | forecast, nominal, real |
| Survey | /economy/survey | university_of_michigan, sloos, economic_conditions_chicago, manufacturing_outlook_texas, manufacturing_outlook_ny |
| Shipping | /economy/shipping | port_volume, shipping_index |
Notable Features:
fred_search and fred_series for Federal Reserve Economic Datafred_regional for state-level series groupscentral_bank_holdings, primary_dealer_positioningSources: openbb_platform/extensions/economy/openbb_economy/economy_router.py21-636 openbb_platform/extensions/economy/integration/test_economy_python.py20-906
The equity extension covers company-level financial data:
Diagram: Equity Extension Endpoint Organization
Supported Providers: FMP, Intrinio, YFinance, TMX, Nasdaq, SEC, Finviz, Benzinga, Seeking Alpha
Sources: openbb_platform/extensions/equity/integration/test_equity_python.py21-1590
The ETF extension provides exchange-traded fund data:
| Endpoint | Description | Providers |
|---|---|---|
search | ETF symbol search | FMP, TMX, Intrinio |
historical | Price history | Alpha Vantage, CBOE, FMP, Intrinio, YFinance, Tiingo, Tradier, Polygon, TMX |
info | ETF information/profile | FMP, Intrinio, TMX, YFinance |
holdings | Fund holdings | FMP, Intrinio, TMX |
sectors | Sector exposure | FMP, Intrinio |
countries | Geographic exposure | FMP |
price_performance | Performance metrics | FMP, Intrinio |
Sources: openbb_platform/extensions/etf/integration/test_etf_python.py20-370
Extensions define standard interfaces that multiple providers implement:
Diagram: Multi-Provider Data Flow for CPI Endpoint
The provider is selected via:
obb.economy.cpi(provider='fred')Sources: openbb_platform/extensions/economy/openbb_economy/economy_router.py66-96 openbb_platform/extensions/economy/integration/test_economy_python.py62-113
Commands accept both standard and provider-specific parameters:
Sources: openbb_platform/extensions/economy/integration/test_economy_python.py62-113
Each extension maintains comprehensive integration tests for both Python and API interfaces:
Diagram: Integration Test Execution Pattern
Sources: openbb_platform/extensions/equity/integration/test_equity_python.py1-100 openbb_platform/extensions/economy/integration/test_economy_api.py1-100
The platform includes automated checks to ensure complete test coverage:
Diagram: Test Coverage Validation System
The system verifies:
Sources: openbb_platform/extensions/tests/utils/integration_tests_testers.py22-96 openbb_platform/extensions/tests/test_integration_tests_python.py1-50
From openbb_platform/extensions/economy/integration/test_economy_python.py62-113:
Sources: openbb_platform/extensions/economy/integration/test_economy_python.py62-113
Sources: openbb_platform/extensions/economy/openbb_economy/economy_router.py66-96
Extensions can organize related functionality into sub-routers:
From openbb_platform/extensions/economy/openbb_economy/economy_router.py17-24:
Sources: openbb_platform/extensions/economy/openbb_economy/economy_router.py17-24 openbb_platform/extensions/economy/openbb_economy/survey/survey_router.py1-14
| Endpoint | FRED | OECD | IMF | FMP | EconDB | Federal Reserve | Trading Economics | Nasdaq |
|---|---|---|---|---|---|---|---|---|
calendar | - | - | - | ✓ | - | - | ✓ | ✓ |
cpi | ✓ | ✓ | ✓ | - | - | - | - | - |
fred_search | ✓ | - | - | - | - | - | - | - |
fred_series | ✓ | - | - | - | - | ✓ | - | - |
unemployment | - | ✓ | - | - | - | - | - | - |
balance_of_payments | ✓ | - | - | - | - | - | - | - |
central_bank_holdings | - | - | - | - | - | ✓ | - | - |
indicators | - | - | ✓ | - | ✓ | - | - | - |
Sources: openbb_platform/extensions/economy/integration/test_economy_python.py20-906
| Endpoint Category | FMP | Intrinio | YFinance | SEC | TMX | Nasdaq | Finviz | Benzinga |
|---|---|---|---|---|---|---|---|---|
| Fundamentals | ✓ | ✓ | ✓ | - | - | - | - | - |
| Price Data | ✓ | ✓ | ✓ | - | ✓ | - | - | - |
| Estimates | ✓ | ✓ | ✓ | - | - | - | ✓ | ✓ |
| Ownership | ✓ | ✓ | - | ✓ | ✓ | - | - | - |
| Filings | ✓ | ✓ | - | ✓ | ✓ | ✓ | - | - |
| Search | - | ✓ | - | ✓ | ✓ | ✓ | - | - |
Sources: openbb_platform/extensions/equity/integration/test_equity_python.py21-1590
Refresh this wiki