blog hero

Nov 6, 2025 7 MIN

Extending OpenBB for A-Share and Hong Kong Stock Analysis with AKShare and Tushare

Guest post by Roger Ye, Software Engineering Manager at EPAM Systems

Introducing OpenBB

OpenBB is a fintech startup that enables financial institutions to build tailored AI-powered analytics applications integrating their data and AI agents.

The architecture addresses a challenge many firms face: integrating data from multiple sources into consistent and customizable workflows.

OpenBB offers two products: the open-source Open Data Platform (the backend engine) and the enterprise OpenBB Workspace (the frontend interface), forming a complete “backend + frontend” financial analytics stack.

For firms operating in Greater China markets, native coverage of A-shares and Hong Kong-listed equities has been limited.

Compared to traditional financial terminals in China like Tonghuashun, Tongdaxin, or Wind, OpenBB differs significantly in technical architecture, target users, and ecosystem extensibility.

The extensions described below demonstrate how OpenBB's extensible architecture enables integration of region-specific data sources and the creation of tailored AI-powered applications.

OpenBB Workspace

OpenBB Workspace enables teams to build custom analytics applications by combining data sources with AI agents into configurable dashboards. Rather than providing ready-to-use applications, Workspace serves as a development environment where firms create tailored solutions for their specific workflows.

Key capabilities include custom widget creation, integration with proprietary data sources, the OpenBB Copilot (native AI-assistant), and deployment flexibility (cloud, VPC, or on-premise). The Workspace is designed for organizations that need to combine external data with internal sources while maintaining control over their data and AI agents.

Open Data Platform by OpenBB

The Open Data Platform (ODP) consists of an open-source toolset that includes a desktop app, a Python package, and various data extensions.

It runs locally and provides several capabilities relevant to quantitative analysis and data engineering workflows:

  1. Unified data abstraction layer: Connect to multiple data providers (FRED, FRED, IMF, BLS, Congress, FOMC, etc.) through a single interface, supporting both public and proprietary sources. OpenBB provides example extensions that unify access to public financial and economic datasets. However, the real value is ODP’s extensibility, so you can install or uninstall individual data extensions.
  2. Standardized output: All data returned as Pandas DataFrames or JSON, compatible with Jupyter, Airflow, and quantitative strategies.
  3. REST API deployment: Launch a FastAPI-powered backend that can be accessed by custom frontends, scripts, or AI agents.
  4. MCP servers: MCP connects your integrated data to any AI agent (Claude, OpenBB Copilot, etc.) without custom engineering.

Part 1: Extending the Open Data Platform with AKShare and Tushare

Data integration is fundamental to any quantitative workflow. While the Open Data Platform natively supports global providers, coverage for China's domestic markets requires custom extensions. To address this, I've created OpenBB-compatible extensions for two established open-source data libraries:

These extensions integrate with OpenBB's provider framework, enabling firms to access A-share and Hong Kong stock data through the same interface used for other markets.

1. Python API Usage

After installing the extensions, you can access A-share and HK stock data through OpenBB's unified Python interface:

1
2
3
4
5
6
7
8
9
from openbb import obb
# Fetch historical prices for Sinopec (600028.SH) via AKShare
df = obb.equity.price.historical(
    symbol="600028",
    start_date="2024-01-01",
    end_date="2025-09-08",
    provider="akshare"
).to_dataframe()
print(df.tail())

2. Command-Line Interface

Beyond Python, ODP offers a command-line interface for quick queries and visualizations, such as plotting candlestick charts for Sinopec (600028):

3. REST API

The Platform also exposes a REST API, enabling cross-language integration. Once the local server is running (using openbb-api), data is accessible at: http://127.0.0.1:6900

Part 2: Integrating with OpenBB Workspace

OpenBB Workspace provides a web-based interface for interactive analysis. After logging in, connect your local backend via the Apps tab.

Connecting Your Local Backend

From the Workspace sidebar, access the Apps tab and add your backend:

Or use this pre-filled link: https://pro.openbb.co/app?modal=connect-backend&name=OpenBB%20Platform&url=http://127.0.0.1:6900

Once connected, AKShare and Tushare widgets become available in the widget library, and you can open them with a quick search:

Part 3: Custom Apps for A-Share & Hong Kong Markets: openbb-hka

To streamline workflows for Chinese markets, I developed openbb-hka, a specialized Workspace application with prebuilt dashboards for A-shares and Hong Kong stocks.

Check the GitHub repository here.

Key Features include:

  • Dedicated dashboards for A-share and HK markets
  • Integrated AI assistant powered by DeepSeek
  • One-click conversion of AI-generated charts into interactive dashboard widgets

Quick Start

1
uv run uvicorn main:app --port 8000

Then add the backend in OpenBB Workspace using this URL: http://127.0.0.1:8000

After connecting it, two applications appear: A-Share Analysis and HK Stock Analysis.

The A-share dashboard provides a comprehensive view combining price, valuation, fundamentals, and capital flow data:

AI Agent Integration

OpenBB Workspace supports custom AI agents through backend integration. The openbb-hka application enables integration with AI models like Qianwen and DeepSeek for localized workflows, improving the overall experience and operational efficiency.

For detailed integration steps, refer to the openbb-hka project documentation and OpenBB Workspace's Agents Integration documentation.

Example query to the AI assistant:

"Based on available data, provide an investment recommendation for Sinopec (600028) in 2025."

The AI automatically pulls live data from your dashboard, generates a report with charts and analysis, and allows you to pin charts directly onto your Workspace for future reference or further analysis:

Part 4: Managing Backends Using the Open Data Platform Desktop Application

When using OpenBB for data analysis, the Workspace serves as the frontend interface and supports connections to multiple backends to meet analytical needs across different domains. The Open Data Platform (ODP) provides a cross-platform desktop application built on the Tauri framework, which allows unified management of various backend environments. In previous sections, we introduced two backend examples: the default backend included with ODP, and the openbb-hka backend that I developed. Below, we demonstrate how to manage these backends centrally using the ODP desktop application.

After installing and launching the ODP desktop application, you will see the main interface shown below. The application currently consists of three main management modules:

  • Backend Management: Configure and run multiple backend services simultaneously.
  • Python Environment Management: If multiple Python runtime environments are installed, you can switch between and manage them here.
  • API Key Management: Centrally configure and manage the API keys required for various services.

As shown in the image, the default installation includes the native OpenBB backend and the OpenBB MCP backend. To add a custom backend, such as openbb-hka, click the "New Backend" button.

In the dialog that appears, first select the corresponding Python runtime environment. Then, enter a name for the new backend and specify the startup command. After filling in the required information, click "Create" to successfully add the backend.

Once added, all backends will be displayed in a unified management list. From this interface, you can start or stop any backend service and use the "Logs" feature to monitor real-time status and log information, enabling convenient management and oversight of your backend environments.

Conclusion

OpenBB is redefining financial analysis, not just as a financial terminal, but as an Integrated Development Environment (IDE) for finance. Its powerful abstraction layer and extensible architecture unlock unprecedented flexibility for AI-augmented investing, localized data integration, and personalized analytics.

Firms working with multiple regional markets can apply similar approaches to integrate other data providers while maintaining a standardized interface across their analytics infrastructure.

For commercial data sources like Wind, Choice, or iFinD, the same extension framework applies, enabling firms to build comprehensive data platforms that combine public and proprietary sources. I invite fellow developers and quants to join this ecosystem and help shape the future of open finance in Asia.


Roger Ye is a Software Engineering Manager at EPAM Systems based in Shenzhen, China. His career spans Motorola, Intel, and McAfee, with expertise in cross-platform application and embedded system development. He contributes to open-source projects and has authored programming books, including "Android System Programming." You can find him on LinkedIn.

Bridge the Gap to AI-Powered Finance

Give your team with the tools to move faster, smarter, and more securely.

We use cookies

This website uses cookies to meausure and improve your user experience.