Skip to content

Commit e982c41

Browse files
hogan-yuanclaude
andauthored
docs: add shareholders, screener, short-trades, rank, stock-events docs + CLI v0.22.0 release notes (#1013)
## Summary SDK documentation and CLI release notes for 13 new APIs. Branch cut from main. Related SDK PRs: [openapi #527](longbridge/openapi#527), [openapi-go #92](longbridge/openapi-go#92) ### New SDK docs (3 locales: zh-CN, zh-HK, en) **FundamentalContext:** `shareholder_top`, `shareholder_detail`, `valuation_comparison` **MarketContext:** `stock_events`, `rank_categories`, `rank_list` **QuoteContext:** `short_positions` (updated to US+HK unified), `short_trades` (new) **New ScreenerContext:** `screener_recommend_strategies`, `screener_user_strategies`, `screener_strategy`, `screener_search`, `screener_indicators` ### CLI v0.22.0 release notes `shareholder --top/--object-id`, `short-trades`, `compare`, `top-movers`, `screener`, `rank` ## Test plan - [ ] `autocorrect --lint docs/` — No issues ✅ 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1 parent e89d4ba commit e982c41

48 files changed

Lines changed: 9678 additions & 125 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/en/docs/changelog.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,27 @@ sidebar_position: 7
66
sidebar_icon: newspaper
77
---
88

9+
## 2026-05-22
10+
11+
### CLI v0.22.0
12+
13+
- **`shareholder --top`** — Top-20 major shareholders (institutions, individuals, insiders) with multi-period comparison; `--object-id <id>` for single shareholder holding history and trade details
14+
- **`short-positions`** — Extended to HK market (`.HK` auto-routes to HKEX short-position data), unified with US FINRA interface
15+
- **`short-trades`** — Daily short sale volume (US: FINRA/NASDAQ; HK: HKEX disclosure data)
16+
- **`compare`** — Multi-stock valuation comparison (PE/PB/PS/market-cap/close); server auto-selects peers when no comparison symbols given
17+
- **`top-movers`** — Stocks whose price exceeds the 20-day standard deviation, with correlated news; supports `--market`, `--sort time|change|hot`
18+
- **`screener` command group** — Stock screener: `strategies` (recommended/saved), `search --strategy-id <id>` or `--filter key:min:max`, `indicators` to list available filters
19+
- **`rank`** — Popularity leaderboard; list all categories without `--key`, or pass `--key <key>` (e.g. `ib_hot_all-us`)
20+
- MCP server updated with the same new tools
21+
22+
### SDK v4.2.0
23+
24+
- **FundamentalContext**`shareholder_top`, `shareholder_detail`, `valuation_comparison`
25+
- **QuoteContext**`short_positions` unified for US and HK; new `short_trades`
26+
- **MarketContext**`top_movers`, `rank_categories`, `rank_list`
27+
- **New ScreenerContext**`screener_recommend_strategies`, `screener_user_strategies`, `screener_strategy`, `screener_search`, `screener_indicators`
28+
- Languages: Rust / Python / Node.js / Java / C / C++ / Go
29+
930
## 2026-05-15
1031

1132
### CLI v0.21.0

docs/en/docs/cli/release-notes.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ sidebar_icon: newspaper
77

88
# Release Notes
99

10+
### [v0.22.0](https://github.com/longbridge/longbridge-terminal/releases/tag/v0.22.0)
11+
12+
- **New `shareholder --top`** — Top-20 major shareholders (institutions, individuals, insiders) with multi-period comparison; `--object-id <id>` for single shareholder holding history and trade details
13+
- **Extended `short-positions`** — Added HK market support (`.HK` suffix auto-routes to HKEX short-position data)
14+
- **New `short-trades`** — Daily short sale volume (US: FINRA/NASDAQ; HK: HKEX disclosure data)
15+
- **New `compare`** — Multi-stock valuation comparison (PE/PB/PS/market-cap/close); server auto-selects peers when no comparison symbols given
16+
- **New `top-movers`** — Stocks whose price movement exceeds the 20-day standard deviation, with correlated news; supports `--market`, `--sort time|change|hot`
17+
- **New `screener` command group** — Stock screener: `strategies` (recommended/saved), `search --strategy-id <id>` or `--filter key:min:max`, `indicators` to list available filters
18+
- **New `rank`** — Popularity leaderboard; list all categories without `--key`, or pass `--key <key>` for a specific ranking (e.g. `ib_hot_all-us`)
19+
- MCP server updated with the same new tools
20+
1021
### [v0.21.0](https://github.com/longbridge/longbridge-terminal/releases/tag/v0.21.0)
1122

1223
- **New: `business-segments`** — revenue breakdown by business segment, current period or historical trend
Lines changed: 261 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,261 @@
1+
---
2+
slug: shareholder-detail
3+
title: Shareholder Detail
4+
sidebar_position: 28
5+
language_tabs: false
6+
toc_footers: []
7+
includes: []
8+
search: true
9+
highlight_theme: ''
10+
headingLevel: 2
11+
---
12+
13+
Get holding history and trade details for a specific shareholder. The `object_id` comes from the `shareholder_top` response.
14+
15+
<CliCommand>
16+
longbridge shareholder AAPL.US --object-id 19463
17+
longbridge shareholder 700.HK --object-id 20181
18+
</CliCommand>
19+
20+
<SDKLinks module="fundamental" klass="FundamentalContext" method="shareholder_detail" />
21+
22+
23+
## Parameters
24+
25+
> **SDK method parameters.**
26+
27+
| Name | Type | Required | Description |
28+
| ---- | ---- | -------- | ----------- |
29+
| symbol | string | YES | Security symbol, e.g. `AAPL.US` |
30+
| object_id | integer | YES | Shareholder ID from `shareholder_top` `object_id` field |
31+
32+
## Request Example
33+
34+
<Tabs groupId="request-example">
35+
<TabItem value="python" label="Python">
36+
37+
```python
38+
from longbridge.openapi import FundamentalContext, Config, OAuthBuilder
39+
40+
oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url))
41+
config = Config.from_oauth(oauth)
42+
ctx = FundamentalContext(config)
43+
44+
resp = ctx.shareholder_detail("AAPL.US", 19463)
45+
print(resp)
46+
```
47+
48+
</TabItem>
49+
<TabItem value="python-async" label="Python (async)">
50+
51+
```python
52+
import asyncio
53+
from longbridge.openapi import AsyncFundamentalContext, Config, OAuthBuilder
54+
55+
async def main() -> None:
56+
oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url))
57+
config = Config.from_oauth(oauth)
58+
ctx = AsyncFundamentalContext.create(config)
59+
60+
resp = await ctx.shareholder_detail("AAPL.US", 19463)
61+
print(resp)
62+
63+
if __name__ == "__main__":
64+
asyncio.run(main())
65+
```
66+
67+
</TabItem>
68+
<TabItem value="nodejs" label="Node.js">
69+
70+
```javascript
71+
const { Config, FundamentalContext, OAuth } = require('longbridge')
72+
73+
async function main() {
74+
const oauth = await OAuth.build('your-client-id', (_, url) => {
75+
console.log('Open this URL to authorize: ' + url)
76+
})
77+
const config = Config.fromOAuth(oauth)
78+
const ctx = FundamentalContext.new(config)
79+
const resp = await ctx.shareholderDetail('AAPL.US', 19463)
80+
console.log(resp)
81+
}
82+
main().catch(console.error)
83+
```
84+
85+
</TabItem>
86+
<TabItem value="java" label="Java">
87+
88+
```java
89+
import com.longbridge.*;
90+
import com.longbridge.fundamental.*;
91+
92+
class Main {
93+
public static void main(String[] args) throws Exception {
94+
try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get();
95+
Config config = Config.fromOAuth(oauth);
96+
FundamentalContext ctx = FundamentalContext.create(config)) {
97+
var resp = ctx.getShareholderDetail("AAPL.US", 19463L).get();
98+
System.out.println(resp);
99+
}
100+
}
101+
}
102+
```
103+
104+
</TabItem>
105+
<TabItem value="rust" label="Rust">
106+
107+
```rust
108+
use std::sync::Arc;
109+
use longbridge::{oauth::OAuthBuilder, fundamental::FundamentalContext, Config};
110+
111+
#[tokio::main]
112+
async fn main() -> Result<(), Box<dyn std::error::Error>> {
113+
let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open: {url}")).await?;
114+
let config = Arc::new(Config::from_oauth(oauth));
115+
let ctx = FundamentalContext::new(config);
116+
let resp = ctx.shareholder_detail("AAPL.US", 19463).await?;
117+
println!("{:?}", resp);
118+
Ok(())
119+
}
120+
```
121+
122+
</TabItem>
123+
<TabItem value="cpp" label="C++">
124+
125+
```cpp
126+
#include <iostream>
127+
#include <longbridge.hpp>
128+
129+
using namespace longbridge;
130+
using namespace longbridge::fundamental;
131+
132+
int main() {
133+
OAuthBuilder("your-client-id").build(
134+
[](const std::string& url) { std::cout << "Open: " << url << std::endl; },
135+
[](auto res) {
136+
if (!res) return;
137+
Config config = Config::from_oauth(*res);
138+
FundamentalContext ctx = FundamentalContext::create(config);
139+
ctx.shareholder_detail("AAPL.US", 19463, [](auto resp) {
140+
if (resp) std::cout << "OK" << std::endl;
141+
});
142+
});
143+
std::cin.get();
144+
}
145+
```
146+
147+
</TabItem>
148+
<TabItem value="go" label="Go">
149+
150+
```go
151+
package main
152+
153+
import (
154+
"context"
155+
"fmt"
156+
"log"
157+
158+
"github.com/longbridge/openapi-go/config"
159+
"github.com/longbridge/openapi-go/oauth"
160+
"github.com/longbridge/openapi-go/fundamental"
161+
)
162+
163+
func main() {
164+
o := oauth.New("your-client-id").
165+
OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) })
166+
if err := o.Build(context.Background()); err != nil {
167+
log.Fatal(err)
168+
}
169+
conf, err := config.New(config.WithOAuthClient(o))
170+
if err != nil {
171+
log.Fatal(err)
172+
}
173+
c, err := fundamental.NewFromCfg(conf)
174+
if err != nil {
175+
log.Fatal(err)
176+
}
177+
defer c.Close()
178+
resp, err := c.ShareholderDetail(context.Background(), "AAPL.US", 19463)
179+
if err != nil {
180+
log.Fatal(err)
181+
}
182+
fmt.Printf("%+v\n", resp)
183+
}
184+
```
185+
186+
</TabItem>
187+
</Tabs>
188+
189+
## Response
190+
191+
192+
### Response Example
193+
194+
```json
195+
{
196+
"code": 0,
197+
"message": "success",
198+
"data": {
199+
"name": "The Vanguard Group, Inc.",
200+
"title": "",
201+
"avatar": "",
202+
"owner_source": "Institution",
203+
"holding_periods": [],
204+
"holding_details": [],
205+
"holding_summary": [],
206+
"trading_periods": ["Past 1 Month", "Past 3 Months", "Past 1 Year", "Past 3 Years"],
207+
"tradings": [
208+
{
209+
"period": "Past 1 Month",
210+
"accum_buy": "8500000.00",
211+
"accum_sell": "2687264.00",
212+
"net_buy": "5812736.00",
213+
"trading_details": [
214+
{
215+
"trading_date": "2025-12-18",
216+
"trading_shares": "5200000",
217+
"trading_price": "248.12",
218+
"trading_type": "Buy"
219+
}
220+
]
221+
}
222+
]
223+
}
224+
}
225+
```
226+
227+
### Response Status
228+
229+
| Status | Description | Schema |
230+
| ------ | ----------- | ------ |
231+
| 200 | Success | [ShareholderDetailResponse](#ShareholderDetailResponse) |
232+
| 400 | Bad request | None |
233+
234+
## Schemas
235+
236+
### ShareholderDetailResponse
237+
238+
<a id="ShareholderDetailResponse"></a>
239+
240+
| Name | Type | Required | Description |
241+
| ---- | ---- | -------- | ----------- |
242+
| name | string | false | Shareholder name |
243+
| title | string | false | Shareholder title / type |
244+
| avatar | string | false | Avatar URL |
245+
| owner_source | string | false | Shareholder type: `Company`, `Institution`, `Person`, `Insider` |
246+
| holding_periods | string[] | false | Available holding periods |
247+
| holding_details | object[] | false | Holding detail records |
248+
| holding_summary | object[] | false | Holding summary records |
249+
| trading_periods | string[] | false | Available trading periods (e.g. `Past 1 Month`, `Past 3 Months`) |
250+
| tradings | object[] | false | Trade aggregates per period |
251+
| ∟ period | string | false | Period label (e.g. `Past 1 Month`) |
252+
| ∟ accum_buy | string | false | Cumulative shares bought in this period |
253+
| ∟ accum_sell | string | false | Cumulative shares sold in this period |
254+
| ∟ net_buy | string | false | Net shares bought (buy minus sell) in this period |
255+
| ∟ trading_details | object[] | false | Individual transactions within the period |
256+
| ∟ ∟ trading_date | string | false | Trade date |
257+
| ∟ ∟ trading_shares | string | false | Number of shares traded |
258+
| ∟ ∟ trading_price | string | false | Trade price |
259+
| ∟ ∟ trading_type | string | false | Trade direction: `Buy` or `Sell` |
260+
261+
> Note: Some fields return an empty string or empty array when data is unavailable.

0 commit comments

Comments
 (0)