获取账户资金
该接口用于获取用户每个币种可用、可取、冻结、待结算金额、在途资金 (基金申购赎回) 信息。
SDK Links
Python |
Rust |
Go |
Node.js |
Request
HTTP Method | GET |
HTTP URL | /v1/asset/account |
Parameters
Content-Type: application/json; charset=utf-8
Name | Type | Required | Description |
---|---|---|---|
currency | string | NO | 币种(HKD、USD、CNH) |
Request Example
# 获取账户资金
# https://open.longportapp.com/docs/trade/asset/account
from longport.openapi import TradeContext, Config
config = Config.from_env()
ctx = TradeContext(config)
resp = ctx.account_balance()
print(resp)
Response
Response Headers
- Content-Type: application/json
Response Example
{
"code": 0,
"data": {
"list": [
{
"total_cash": "1759070010.72",
"max_finance_amount": "977582000",
"remaining_finance_amount": "0",
"risk_level": "1",
"margin_call": "2598051051.50",
"currency": "HKD",
"net_assets": "24145.90",
"init_margin": "1540.09",
"maintenance_margin": "1540.09",
"buy_power": "1759070.12",
"cash_infos": [
{
"withdraw_cash": "97592.30",
"available_cash": "195902464.37",
"frozen_cash": "11579339.13",
"settling_cash": "207288537.81",
"currency": "HKD"
},
{
"withdraw_cash": "199893416.74",
"available_cash": "199893416.74",
"frozen_cash": "28723.76",
"settling_cash": "-276806.51",
"currency": "USD"
}
]
}
]
}
}
Response Status
Status | Description | Schema |
---|---|---|
200 | 返回成功 | accountcash_rsp |
400 | 内部错误 | None |
Schemas
accountcash_rsp
Name | Type | Required | Description |
---|---|---|---|
list | object[] | false | 账户资金信息 |
∟ total_cash | string | true | 现金总额 |
∟ max_finance_amount | string | true | 最大融资金额 |
∟ remaining_finance_amount | string | true | 剩余融资金额 |
∟ risk_level | string | true | 风控等级 可选值: 0 - 安全 1 - 中风险2 - 预警3 - 危险 |
∟ margin_call | string | true | 追缴保证金 |
∟ net_assets | string | true | 净资产 |
∟ init_margin | string | true | 初始保证金 |
∟ maintenance_margin | string | true | 维持保证金 |
∟ currency | string | true | 币种 |
∟ market | string | false | 市场 |
∟ buy_power | string | true | 购买力 |
∟ cash_infos | object[] | false | 现金详情 |
∟∟ withdraw_cash | string | true | 可提现金 |
∟∟ available_cash | string | true | 可用现金 |
∟∟ frozen_cash | string | true | 冻结现金 |
∟∟ settling_cash | string | true | 待结算现金 |
∟∟ currency | string | true | 币种 |