longbridge
A Python library for Longbridge Open API
Decision gist · record as of 2026-08-14
Yes, with conditions. Longbridge is actively maintained, has no known vulnerabilities, and offers a comprehensive API surface for trading and market data. However, the unclear license status is a blocker for commercial use—verify licensing terms in the repository before deploying in proprietary projects. Install friction is moderate due to compiled wheels, but this is typical for performance-critical financial libraries. Suitable for retail traders, fintech developers, and market data consumers with Longbridge account access.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires OAuth client registration or legacy API key credentials (LONGBRIDGE_APP_KEY, LONGBRIDGE_APP_SECRET, LONGBRIDGE_ACCESS_TOKEN environment variables).
- Python >= 3.8 required.
- Medium install friction due to compiled wheels across multiple Python versions and platforms (cp310–cp312, macOS, Linux, Windows).
License · maintenance · safety
(unclear) — License status is unclear—no SPDX identifier or raw license text is available in the package metadata. Verify the actual license terms in the repository before use in proprietary or commercial projects.
last release 2026-08-14 (0 days) · last repo commit 2026-08-14 · 449 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 363,757 downloads/mo, #7,217 on PyPI
Alternatives
Verify before relying
pip install longbridge
from longbridge.openapi import Config, QuoteContext, OAuthBuilder
oauth = OAuthBuilder("your-client-id").build(
lambda url: print(f"Open this URL to authorize: {url}")
)
config = Config.from_oauth(oauth)
ctx = QuoteContext(config)
resp = ctx.quote(["700.HK", "AAPL.US"])
print(resp)- Whether the unclear license permits commercial or proprietary use without restriction
- Real-world latency and throughput characteristics for high-frequency trading scenarios
- Completeness of async API coverage across all context types
What it is and what it does
Longbridge is a Python SDK that wraps the Longbridge OpenAPI, a financial data and trading platform. It provides synchronous and asynchronous interfaces to multiple specialized contexts: QuoteContext for real-time quotes and candlesticks, TradeContext for order and position management, FundamentalContext for financial reports and analyst ratings, MarketContext for market status and holdings, and several others for calendar data, alerts, and portfolio analysis. The package is built with Rust bindings for performance and supports OAuth 2.0 authentication as the recommended method, with legacy API key support available.
The SDK is designed for developers building trading applications, market analysis tools, and portfolio management systems. It handles WebSocket subscriptions for push data, supports both synchronous and asynchronous workflows, and includes configuration management for multiple environments and language settings. Zero runtime dependencies keep the install footprint minimal.
Use it for
- Build a real-time stock quote dashboard that subscribes to price updates and displays candlestick data for multiple securities.
- Automate order submission and monitor execution status, positions, and account balance across trading sessions.
- Retrieve financial reports, analyst ratings, and dividend information for fundamental analysis and valuation workflows.
- Implement price alerts and manage watchlists programmatically for custom trading workflows.
- Analyze portfolio P&L using exchange rates and portfolio context APIs for multi-currency portfolios.
- Fetch financial calendar events (earnings, splits, IPOs) to schedule market analysis or trading strategies.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, with conditions.
Longbridge is actively maintained, has no known vulnerabilities, and offers a comprehensive API surface for trading and market data. However, the unclear license status is a blocker for commercial use—verify licensing terms in the repository before deploying in proprietary projects. Install friction is moderate due to compiled wheels, but this is typical for performance-critical financial libraries. Suitable for retail traders, fintech developers, and market data consumers with Longbridge account access.
Install
longbridge on PyPI
Before you install
Medium install friction due to compiled wheels across multiple Python versions and platforms (cp310–cp312, macOS, Linux, Windows). Package is actively maintained with recent releases and no known vulnerabilities.
Requires OAuth client registration or legacy API key credentials (LONGBRIDGE_APP_KEY, LONGBRIDGE_APP_SECRET, LONGBRIDGE_ACCESS_TOKEN environment variables). Python >= 3.8 required.
License in practice
License status is unclear—no SPDX identifier or raw license text is available in the package metadata. Verify the actual license terms in the repository before use in proprietary or commercial projects.
Quickstart
pip install longbridge
from longbridge.openapi import Config, QuoteContext, OAuthBuilder
oauth = OAuthBuilder("your-client-id").build(
lambda url: print(f"Open this URL to authorize: {url}")
)
config = Config.from_oauth(oauth)
ctx = QuoteContext(config)
resp = ctx.quote(["700.HK", "AAPL.US"])
print(resp)
Verify before relying
- Whether the unclear license permits commercial or proprietary use without restriction
- Real-world latency and throughput characteristics for high-frequency trading scenarios
- Completeness of async API coverage across all context types
Package facts
| License | Not declared unclear |
| Python support | Supports the current Python release >=3.8 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 0 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 363,757 / month, #7,217 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 3 - AlphaIntended Audience :: DevelopersProgramming Language :: Python :: Implementation :: CPythonProgramming Language :: RustTopic :: Office/Business :: Financial |
Evidence: longbridge-4.5.0-cp310-cp310-macosx_10_12_x86_64.whl; longbridge-4.5.0-cp310-cp310-macosx_11_0_arm64.whl; longbridge-4.5.0-cp310-cp310-manylinux_2_39_aarch64.whl; longbridge-4.5.0-cp310-cp310-manylinux_2_39_x86_64.whl; longbridge-4.5.0-cp310-cp310-musllinux_1_2_aarch64.whl; longbridge-4.5.0-cp310-cp310-musllinux_1_2_x86_64.whl; longbridge-4.5.0-cp310-cp310-win_amd64.whl; longbridge-4.5.0-cp311-cp311-macosx_10_12_x86_64.whl; longbridge-4.5.0-cp311-cp311-macosx_11_0_arm64.whl; longbridge-4.5.0-cp311-cp311-manylinux_2_39_aarch64.whl; longbridge-4.5.0-cp311-cp311-manylinux_2_39_x86_64.whl; longbridge-4.5.0-cp311-cp311-musllinux_1_2_aarch64.whl; longbridge-4.5.0-cp311-cp311-musllinux_1_2_x86_64.whl; longbridge-4.5.0-cp311-cp311-win_amd64.whl; longbridge-4.5.0-cp312-cp312-macosx_10_12_x86_64.whl; longbridge-4.5.0-cp312-cp312-macosx_11_0_arm64.whl; longbridge-4.5.0-cp312-cp312-manylinux_2_39_aarch64.whl; longbridge-4.5.0-cp312-cp312-manylinux_2_39_x86_64.whl; longbridge-4.5.0-cp312-cp312-musllinux_1_2_aarch64.whl; longbridge-4.5.0-cp312-cp312-musllinux_1_2_x86_64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “portfolio analysis tools”
- longbridgeLongbridge provides a Python SDK for accessing Longbridge's OpenAPI,…
- QuantLibQuantLib provides Python bindings to a C++ library for quantitative…
- vnstock-ezchartGenerates publication-quality static financial charts for Vietnamese…
Give your agent the search over MCP, or paste the wish link into any chat.
More Financial packages
statsmodels provides statistical models, inference methods, and descriptive statistics for Python, complementing scipy with regression, time series, discrete choice, survival analysis, and multivariate methods.
Install it if you need publication-quality statistical models, hypothesis tests, or time series analysis beyond what scipy or pandas provide.
Generates country- and subdivision-specific government holiday calendars on demand, supporting 250 country codes with optional language localization and holiday categories.
Fetches financial and market data from Yahoo Finance's public APIs, including ticker information, historical prices, and live streaming data.
However, do not use it for commercial applications or high-volume data collection without confirming compliance with Yahoo's terms of service.
Bokeh is an interactive visualization library that creates browser-based plots, dashboards, and data applications from Python code, with support for large and streaming datasets.
Install it if you need browser-based interactivity.
Parses, validates, and reformats standard numbers and codes across many countries and industries—tax IDs, bank accounts, identity numbers, VAT codes, and financial identifiers.
Install it if you validate or reformat standardized numbers.
Provides elementary financial functions (IRR, NPV, PMT, and others) that were deprecated and removed from NumPy, offering a dedicated replacement for financial calculations.
However, given the aging status (no releases since 2019) and unclear compatibility with modern Python and recent numpy versions, verify that it works with your target…
See also schwab-py · tastytrade · kiteconnect · polygon-api-client · massive · openbb-tradingeconomics · tradingeconomics · growwapi · metatrader5 · xero-python