Trading Economics data backend to be used by OpenBB Workspace.
This custom backend provides access to Trading Economics data from within the OpenBB Workspace platform, allowing you to search and visualize economic indicators.
This tool is for personal, educational, and research purposes only.
- Python 3.8+
- Firefox browser installed (required by tedata)
- Clone this repository:
git clone https://github.com/jlokos/tedata_openbb_backend.git
cd tedata_openbb_backend
- Create a virtual environment and install the dependencies:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -r requirements.txt
You can customize the behavior using these environment variables:
TEDATA_DISABLE_LOGGING=true # Disable detailed tedata logging
Start the FastAPI server:
uvicorn main:app --reload --port 8000
Go into OpenBB Workspace at https://pro.openbb.co/ and add this custom backend.
- Name: TedataBB
- URL: http://127.0.0.1:8000
If all is working, you can click "Test" and get confirmation of how many widgets are valid.
Search for economic indicators across Trading Economics database:
- Search by country, indicator name, or other keywords
- View search results in a table format
Extract time-series data for selected economic indicators:
- Supports multiple scraping methods (highcharts_api, path, tooltips, mixed)
- Retrieves historical data points
- Presents data in a table format ready for analysis
View detailed metadata for any economic indicator:
- See full description, source, latest values
- View update frequency and other important information
- Choose between pretty formatted view and raw JSON format
- Search functionality needs improvement to allow grouping by indicator_id
- When clicking an indicator ID in search results, it should copy to clipboard rather than populating the search widget
The main entry point for the FastAPI application that:
- Creates a FastAPI instance with API documentation
- Configures CORS middleware for cross-origin requests
- Implements endpoint handlers for searching and scraping data
- Provides utility functions for data extraction and formatting
Defines the widget configurations recognized by OpenBB Workspace:
- Parameter definitions
- Widget size recommendations
- Descriptions and documentation
- Category assignments for organization
Contributions are welcome! Please feel free to submit a Pull Request.