# Margin Trading

Daily per-stock margin trading and short selling detail across the Shanghai and Shenzhen markets, including margin financing balance (rzye), short selling balance (rqye), margin buy amount (rzmre) and short sell volume. The financing balance reflects leveraged long exposure and its build-up/unwind pace, while the securities-lending balance reflects short-side activity. Commonly used to track market leverage levels, single-name capital sentiment and long/short balance, and to read shifts in risk appetite. Updated each trading day; balances and buy amounts are in CNY, with some fields in share volume.

`GET /v2/market/margin`

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `symbol` | string | No | Stock code, e.g. 000001.SZ |
| `start_date` | string | No | Start date (YYYYMMDD) |
| `end_date` | string | No | End date (YYYYMMDD) |
| `trade_date` | string | No | Trading date YYYYMMDD (single day) |

## Response Fields

| Field | Type | Description |
| --- | --- | --- |
| `trade_date` | string | Trading date |
| `symbol` | string | Stock code |
| `name` | string | Stock name |
| `rzye` | number | Margin buy balance (CNY) |
| `rqye` | number | Short sell balance (CNY) |
| `rzmre` | number | Margin buy amount today |
| `rqyl` | number | Short sell volume today |
| `rzche` | number | Margin repayment today |
| `rqchl` | number | Short cover volume today |
| `rqmcl` | number | Short sell volume today |
| `rzrqye` | number | Total margin + short balance |

## API Example

cURL

```
curl -H "X-API-Key: YOUR_KEY" \
  "https://asharehub.com/v2/market/margin?symbol=000001.SZ"
```

Python SDK

```
from asharehub import AShareHub

client = AShareHub(api_key="YOUR_KEY")
df = client.margin(symbol="000001.SZ")
print(df.head())
```

## Sample Data

returns a pandas.DataFrame

| trade_date | symbol | name | rzye | rqye | rzmre | rqyl | rzche | rqchl | rqmcl | … +1 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 20260625 | 000001.SZ | 平安银行 | 5289513969 | 17770268 | 120048695 | 1705400 | 90947668 | 12600 | 39900 | … |
| 20260624 | 000001.SZ | 平安银行 | 5260412942 | 17636831 | 104930666 | 1678100 | 75921807 | 7300 | 3400 | … |
| 20260623 | 000001.SZ | 平安银行 | 5231404083 | 18014220 | 81747812 | 1682000 | 110944363 | 55800 | 6600 | … |
