Files
Jason Lee 0add508ae2 feat: add Skill page with interactive demo (#376)
## Summary

- **New `/skill` page** with full trilingual support (en / zh-CN /
zh-HK)
- **Interactive chat demo**: 4 scenarios (Live Quote, Portfolio,
Subscription, Earnings) × 5 AI clients (OpenClaw, ChatGPT, Claude,
Claude Code, Codex) with typewriter animation
- **Rich response rendering**: tables with Shadcn-style borders, mini
SVG sparkline charts, syntax-highlighted code blocks
- **Scenario cards section** below the demo describing use cases
- **Nav update**: Skill link added to all three locale nav configs

## Bug Fixes

- **Syntax highlighter**: replaced chained-regex approach with a
single-pass tokenizer. The old code ran number → keyword → string
regexes sequentially on the same string — the keyword regex matched
`class` inside generated `<span class="hl-n">` attributes, and the
string regex matched `"hl-n"` as a string literal, corrupting the HTML
structure entirely
- **v-html routing**: replaced `currentMessages[2]?.rich` template
condition with an explicit `isRichResponse` ref set in `runAnimation()`
to prevent incorrect branch selection when switching client tabs

## Test plan

- [ ] Visit `/skill`, `/zh-CN/skill`, `/zh-HK/skill` — page loads in all
locales
- [ ] Click through all 4 scenario tabs — animation plays correctly for
each
- [ ] Click through all 5 client tabs — correct message shown, Claude
Code tab shows syntax-highlighted code (not raw HTML)
- [ ] Verify sparkline charts render in the Live Quote / OpenClaw
scenario
- [ ] Verify table borders render correctly (outer border + row
dividers, no missing bottom border)
- [ ] Verify gain/loss values show green/red colors in tables

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 20:03:14 +08:00

4.2 KiB

Longbridge Developers Documentation

Longbridge Developers 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

Interface Type

Longbridge provides diversified access methods such as HTTP / WebSockets interfaces for accessing the underlying services and SDK (Python / C++, etc.) encapsulated in the upper layer, allowing flexible choices.

How to Enable OpenAPI

  1. Log in to the Longbridge App to complete the account opening process;

  2. Log in to the longbridge.com and enter the developer platform, complete the developer verification (OpenAPI permission application), and obtain a token.

Quote Coverage

Market Symbol
HK Market Securities (including equities, ETFs, Warrants, CBBCs)
Hang Seng Index
US Market Securities (including stocks, ETFs)
Nasdsaq Index
OPRA Options
CN Market Securities (including stocks, ETFs)
Index

Trading

Supported trading functions include:

Market Stock and ETF Warrant & CBBC Options
HK Market
US Market

Rate Limit

Category Limitation
Quote API
  • One account can only create one long link and subscribe to a maximum of 500 symbols at the same time
  • No more than 10 calls in a 1-second interval and the number of concurrent requests should not exceed 5
Trade API
  • No more than 30 calls in a 30-second interval, and the interval between two calls should not be less than 0.02 seconds

:::success

The OpenAPI SDK has done effective frequency control internally:

  • Quote: The methods under QuoteContext will be actively controlled by the SDK according to the server's rate limit. When the request is too fast, the SDK will automatically delay the request. Therefore, you do not need to implement the frequency control details separately.
  • Trade: The methods under TradeContext are not limited by the SDK. Due to the special nature of the trading order placement scenario, this is left to the user to handle.

:::

Pricing

Longbridge does not charge any additional fees for activating or using interface services. You only need to open a Longbridge Integrated A/C and get OpenAPI service permissions to use it for free. For actual transaction fees, please contact the brokerage firm where you have opened your securities account.

Other

The OpenAPI services are provided by Longbridge and the applicable affiliates (subject to the agreement). openapi-trade.longbridge.com