S SPARKDATA
← Back to data results

China equities

Margin Trade Stats

MarginTradeStats
FreeJSONTry online

Operation explorer

Margin Trade Stats

MarginTradeStats
Manage API keys

Loading account…

The example is prefilled. Choose an API key and run it.

Uses the account’s current access and allowance. Field notes stay separate so copied JSON remains executable.

  • secuMarketCode: 沪深京市
  • Samples use verified instruments and dictionary values. Records depend on the query range, data updates and the selected key's permissions.
  • The sample requests 5 records; some business aggregates may return more rows, as shown in the actual response.
Example field notes 5
secuMarketCodestring_array · required
市场支持沪深京市、沪深两市、沪市、深市、京市等市场Use an exact name or dictionary code. 沪深京市 (ALL)
beginDatestring
查询开始日期Use YYYY-MM-DD; wrap array values in a JSON array.
endDatestring
查询结束日期Use YYYY-MM-DD; wrap array values in a JSON array.
pageNostring
定位分页查询的目标页码,默认不限Page numbers start at 1; the sample reads the first page.
pageSizestring
单页返回的最大记录条数,默认不限The sample requests 5 records for a quick preview.
POST /v1/data/operations/MarginTradeStats

curl example with field notes
# secuMarketCode: string_array (required) — 市场支持沪深京市、沪深两市、沪市、深市、京市等市场
# beginDate: string — 查询开始日期
# endDate: string — 查询结束日期
# pageNo: string — 定位分页查询的目标页码,默认不限
# pageSize: string — 单页返回的最大记录条数,默认不限
curl --silent --show-error --fail-with-body --request POST \
  'https://spark-data.cn/v1/data/operations/MarginTradeStats' \
  --header "Authorization: Bearer ${SPARKDATA_API_KEY:?Set SPARKDATA_API_KEY first}" \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data-binary '{"parameters":{"secuMarketCode":["ALL"],"beginDate":"2026-10-14","endDate":"2026-11-13","pageNo":"1","pageSize":"5"}}'

This API is free. Query it with any API key in your account.

Data description

Use the field names shown below when building requests.

两融市场成交统计接口支持输入证券市场名称及截止日期,快速获取指定市场的核心两融交易数据。接口返回证券市场名称、截止日期、融资余额、融资买入额、融资偿还额、融券余量、融券余额、融券卖出量、融资融券余额等关键字段,全面覆盖融资、融券两大业务的成交、持仓及余额规模,帮助用户深入了解两融市场交易活跃度、资金流向及整体业务规模,精准把握两融市场运行态势。 典型问法 某证券市场 2024 年 6 月 30 日的融资余额和融券卖出量分别是多少?2023 年四季度,沪市与深市的融资买入额、融资融券余额差异如何? 使用场景 1、单市场单期查询: 输入证券市场名称、统计周期及截止日期,精准获取指定时期内该市场的详细两融成交及余额数据。示例:查询沪市 A 股 2024 年一季度的融资买入额与融券余量;获取创业板 2023 年的融资余额、融券余额及融资偿还额数据。 2、多市场对比查询: 批量输入多个证券市场名称,对比不同市场在同一统计周期(同一截止日期)内的两融交易表现差异。示例:对比沪市主板与深市主板 2024 年二季度的融资买入额与融券卖出量;分析科创板与北交所最新融资融券余额、融券余量规模差异。 3、两融动态追踪: 输入证券市场名称及多个报告期(截止日期),获取多期两融数据,展示各项指标的历史变化趋势,辅助分析两融市场交易活跃度、资金流向及业务规模的发展态势。示例:查看沪深京全市场近三年各季度的融资余额、融券余额及融资买入额变动情况;追踪沪市科创板 2022-2024 年间融券卖出量与融资偿还额的变化趋势,评估其两融交易活跃度及资金参与度。

POST /v1/data/operations/MarginTradeStats · JSON

Input parameters

FieldTypeConstraintDescription and example
secuMarketCode
证券市场名称
string_array
string_array
Required
Dictionary selection: MARGIN_MARKET_CODE
市场支持沪深京市、沪深两市、沪市、深市、京市等市场

Example: ["ALL"]

beginDate
开始日期
string
string
Optional查询开始日期

Example: 2026-10-14

endDate
截止日期
string
string
Optional查询结束日期

Example: 2026-11-13

pageNo
页面编号
string
string
Optional定位分页查询的目标页码,默认不限

Example: 1

pageSize
页内记录数
string
string
Optional单页返回的最大记录条数,默认不限

Example: 5

Response fields

FieldTypeConstraintDescription and example
secumarketcode
证券市场名称
string
string
—市场支持沪深京市、沪深两市、沪市、深市、京市等市场

Example: Example text

enddate
截止日期
string
string
—数据统计日期

Example: Example text

financebalance
融资余额
string
string
—指定日期股票市场融资余额,即尚未偿还的融资资金总额

Example: Example text

financebuyvalue
融资买入额
string
string
—指定日期股票市场融资买入额

Example: Example text

financerepaymentvalue
融资偿还额
string
string
—指定日期股票市场融资偿还额

Example: Example text

securitylendingmargin
融券余量
string
string
—指定日期股票市场融券余量,即尚未归还的融券股票数量

Example: Example text

securitylendingbalance
融券余额
string
string
—指定日期股票市场融券余额,即尚未偿还的融券资金总额(融券余量 × 标的股价)

Example: Example text

securitylendingsellvolume
融券卖出量
string
string
—指定日期股票市融券卖出量

Example: Example text

margintradingbalance
融资融券余额
string
string
—指定日期股票市场融资余额与融券余额的合计值,反映两融整体规模

Example: Example text

Request example

Example instruments, required parameters and applicable page limits are prefilled. Open the side drawer for field notes and a live response.

{
  "parameters": {
    "secuMarketCode": [
      "ALL"
    ],
    "beginDate": "2026-10-14",
    "endDate": "2026-11-13",
    "pageNo": "1",
    "pageSize": "5"
  }
}
  • secuMarketCode: 沪深京市
  • Samples use verified instruments and dictionary values. Records depend on the query range, data updates and the selected key's permissions.
  • The sample requests 5 records; some business aggregates may return more rows, as shown in the actual response.

Coverage and access boundaries

Run the example to check the securities, dates and fields you need. Available history and content rights vary by endpoint. Requests use your account access and the selected API key.

Follow the parameter notes for minute intervals, price adjustment and time units. A missing field does not mean a zero value.