經紀商每日持倉歷史
僅支援 Longbridge 香港 / 新加坡賬戶
此方法僅支援 Longbridge 香港 / 新加坡賬戶,可查詢任意標的,包括美股。
獲取某一經紀商在港股上市證券中的每日持倉歷史記錄。
SDK Links
Python |
Rust |
Go |
Node.js |
Java |
C++ |
Parameters
SDK 方法參數。
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | string | 是 | 港股代碼,例如 700.HK |
| broker_id | string | 是 | 經紀商參與者 ID,例如 B01224 |
Request Example
from longbridge.openapi import MarketContext, Config, OAuthBuilder
oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url))
config = Config.from_oauth(oauth)
ctx = MarketContext(config)
resp = ctx.broker_holding_daily("700.HK", "B01224")
print(resp)import asyncio
from longbridge.openapi import AsyncMarketContext, Config, OAuthBuilder
async def main() -> None:
oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url))
config = Config.from_oauth(oauth)
ctx = AsyncMarketContext.create(config)
resp = await ctx.broker_holding_daily("700.HK", "B01224")
print(resp)
if __name__ == "__main__":
asyncio.run(main())const { Config, MarketContext, OAuth } = require('longbridge')
async function main() {
const oauth = await OAuth.build('your-client-id', (_, url) => {
console.log('Open this URL to authorize: ' + url)
})
const config = Config.fromOAuth(oauth)
const ctx = MarketContext.new(config)
const resp = await ctx.brokerHoldingDaily('700.HK', 'B01224')
console.log(resp)
}
main().catch(console.error)import com.longbridge.*;
import com.longbridge.market.*;
class Main {
public static void main(String[] args) throws Exception {
try (OAuth oauth = new OAuthBuilder("your-client-id").build(url -> System.out.println("Open to authorize: " + url)).get();
Config config = Config.fromOAuth(oauth);
MarketContext ctx = MarketContext.create(config)) {
var resp = ctx.getBrokerHoldingDaily("700.HK", "B01224").get();
System.out.println(resp);
}
}
}use std::sync::Arc;
use longbridge::{oauth::OAuthBuilder, market::MarketContext, Config};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open: {url}")).await?;
let config = Arc::new(Config::from_oauth(oauth));
let ctx = MarketContext::new(config);
let resp = ctx.broker_holding_daily("700.HK", "B01224").await?;
println!("{:?}", resp);
Ok(())
}package main
import (
"context"
"fmt"
"log"
"github.com/longbridge/openapi-go/config"
"github.com/longbridge/openapi-go/oauth"
"github.com/longbridge/openapi-go/market"
)
func main() {
o := oauth.New("your-client-id").
OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) })
if err := o.Build(context.Background()); err != nil {
log.Fatal(err)
}
conf, err := config.New(config.WithOAuthClient(o))
if err != nil {
log.Fatal(err)
}
c, err := market.NewFromCfg(conf)
if err != nil {
log.Fatal(err)
}
defer c.Close()
resp, err := c.BrokerHoldingDaily(context.Background(), "700.HK", "B01224")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", resp)
}Response
Response Example
{
"code": 0,
"message": "success",
"data": {
"list": [
{
"date": "2026.05.13",
"holding": "22903430",
"chg": "7029132.0000",
"ratio": "0.0025"
},
{
"date": "2026.05.12",
"holding": "15874298",
"chg": "-2150000.0000",
"ratio": "0.0017"
}
]
}
}
Response Status
| Status | Description | Schema |
|---|---|---|
| 200 | 成功 | BrokerHoldingDailyResponse |
| 400 | 請求錯誤 | None |
Schemas
BrokerHoldingDailyHistoryResponse
| Name | Type | Required | Description |
|---|---|---|---|
| list | object[] | true | 每日持倉歷史紀錄, |
| ∟ date | string | true | 日期(如 2026.05.13) |
| ∟ holding | string | false | 總持股數 |
| ∟ chg | string | false | 日變動量 |
| ∟ ratio | string | false | 持倉比率 |