convez.ai
PluginIntegração & APIsAvançado
longportapp

Longbridge OpenAPI SDK

longportapp/openapi

SDK para trading, cotações e análise de mercado via OpenAPI

Ver no GitHub
BomPluginScore · de 0 a 100

SDK multi-linguagem (Rust, Python, Node.js, Java, C, C++) que fornece interfaces programáticas para trading, cotações em tempo real, portfólio e subscrições de dados de mercado. Inclui suporte a MCP server para integração com Claude e outros agentes de IA.

Instalação

$npx convez-ai longportapp/openapi

1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.

Métricas

Estrelas
473
Forks
70
Acompanhando
14
Saúde
62%
Último commit
há 1 dia
Versão
v5.4.0
Issues abertas
4
Contribuidores
19

Casos de uso

  • Construir ferramentas de análise de estratégia de investimento
  • Automatizar operações de trading e gestão de portfólio
  • Integrar dados de mercado em tempo real em aplicações

Veredito

SDK robusto e multi-plataforma para acesso à infraestrutura de trading e dados da Longbridge. Adequado para desenvolvedores experientes que precisam integrar operações financeiras com baixa latência em suas aplicações.

README

A tradução para o português deste README ainda está na fila.

Longbridge OpenAPI SDK

Go project version PyPI version npm version Maven Central

Longbridge OpenAPI provides programmatic quote trading interfaces for investors with research and development capabilities and assists them to build trading or quote strategy analysis tools based on their own investment strategies. The functions fall into the following categories:

  • Trading - Create, amend, cancel orders, query today’s/past orders and transaction details, etc.
  • Quotes - Real-time quotes, acquisition of historical quotes, etc.
  • Portfolio - Real-time query of the account assets, positions, funds
  • Real-time subscription - Provides real-time quotes and push notifications for order status changes

This repo contains the following main components:

NameDocumentDescription
RustDocLongbridge OpenAPI for Rust (>= 1.89.0)
PythonDocLongbridge OpenAPI for Python 3 (>= 3.8)
Node.jsDocLongbridge OpenAPI for Node.js (>= 10)
JavaDocLongbridge OpenAPI for Java (>= 11)
CDocLongbridge OpenAPI for C (>= C99)
C++DocLongbridge OpenAPI for C++(>= C++17)
Gohttps://github.com/longbridge/openapi-go
MCPAn MCP server implementation for Longbridge OpenAPI

Context Types

ContextDescription
QuoteContextReal-time quotes, candlesticks, options, warrants, watchlists, push subscriptions
TradeContextOrders, positions, account balance, executions, cash flow
AssetContextAccount statement download
ContentContextNews, community topics
FundamentalContextFinancial reports, analyst ratings, dividends, valuation, company overview, shareholders
MarketContextMarket status, broker holdings, A/H premium, trade statistics, anomaly alerts, index constituents
CalendarContextFinancial calendar (earnings, dividends, splits, IPOs, macro data, market closures)
PortfolioContextExchange rates, portfolio P&L analysis
AlertContextPrice alert management (add/enable/disable/delete)
DCAContextDollar-cost averaging plan management
SharelistContextCommunity sharelist management

Quickstart

Pick a language SDK from the table above and follow its README for install and first request. Full reference docs: https://longbridge.github.io/openapi

SDK Documentation

https://longbridge.github.io/openapi

Troubleshooting

  • Environment variables not taking effect
    • macOS/Linux: export ... only affects the current shell session.
    • Windows: setx ... requires opening a new terminal/session to take effect.
  • Authentication errors (401/403)
    • Verify LONGBRIDGE_APP_KEY, LONGBRIDGE_APP_SECRET, LONGBRIDGE_ACCESS_TOKEN are correct and not expired.
    • Ensure your OpenAPI app has the required permissions.
  • Network / connection errors
    • Check firewall/proxy rules for HTTPS/WSS.
    • If you use a custom endpoint, set LONGBRIDGE_HTTP_URL, LONGBRIDGE_QUOTE_WS_URL, LONGBRIDGE_TRADE_WS_URL.
  • Quote subscription exits immediately
    • Keep the process running (event loop / sleep / blocking receive loop), otherwise you will not see push events.
  • Debugging
    • Enable logs via LONGBRIDGE_LOG_PATH.
    • If quotes connect but look empty, keep LONGBRIDGE_PRINT_QUOTE_PACKAGES=true to confirm opened quote packages.

Minimal Verification

If you're not sure whether your environment / credentials are correct, start with the built-in HTTP client examples.

  • Python:

    python examples/python/http_client.py
    
  • Node.js:

    node examples/nodejs/http_client.js
    
  • Rust:

    cargo run --manifest-path examples/rust/Cargo.toml -p http_client
    
  • Java (from the example module directory):

    cd examples/java/http_client
    mvn -q -DskipTests package
    mvn -q -DskipTests exec:java
    
  • C/C++:

    • Use the sources in examples/c/http_client/main.c and examples/cpp/http_client/main.cpp.
    • Build instructions depend on your toolchain; see the corresponding language SDK README.

Expected results:

  • If credentials are valid and network is reachable, the HTTP call returns JSON.
  • If it returns 401/403, check your LONGBRIDGE_APP_KEY, LONGBRIDGE_APP_SECRET, LONGBRIDGE_ACCESS_TOKEN.
  • If it times out / cannot connect, check proxy/firewall and your endpoint env vars.

Resources

License

Licensed under either of

Ver o original no GitHub

Bom para

Relacionados