Funding Fee History
Description
Get funding fee settlement history for the authenticated user. Each record represents one funding interval settlement on a position.
HTTP Request
GET /fapi/v1/fundingFeeHistory (HMAC SHA256)
Weight
5
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| symbol | STRING | NO | Trading pair filter |
| startTime | LONG | NO | Start time in milliseconds |
| endTime | LONG | NO | End time in milliseconds |
| limit | INT | NO | Default 100; Max 1000 |
| timestamp | LONG | YES | Timestamp |
Response Fields
| Field | Type | Description |
|---|---|---|
| symbol | STRING | Trading pair |
| fundingRate | STRING | Funding rate applied at settlement |
| positionSize | STRING | Position notional size (USD) |
| fundingFee | STRING | Signed fee; negative = paid, positive = received |
| positionSide | STRING | LONG or SHORT |
| asset | STRING | Settlement asset (USDT) |
| time | LONG | Settlement timestamp (ms) |
| tranId | STRING | Unique settlement ID |
Response Example
[
{
"symbol": "BTCUSDT",
"fundingRate": "0.0001",
"positionSize": "60000.00",
"fundingFee": "-6.00",
"positionSide": "LONG",
"asset": "USDT",
"time": 1776060000000,
"tranId": "550e8400-e29b-41d4-a716-446655440000"
}
]
Records are returned ordered by time descending.
Code Examples
cURL
API_KEY="your_api_key"
API_SECRET="your_api_secret"
TIMESTAMP=$(date +%s%3N)
QUERY_STRING="symbol=BTCUSDT&limit=100×tamp=${TIMESTAMP}"
SIGNATURE=$(echo -n "${QUERY_STRING}" | openssl dgst -sha256 -hmac "${API_SECRET}" | awk '{print $2}')
curl -s -H "X-MBX-APIKEY: ${API_KEY}" \
"https://api.ztdx.io/fapi/v1/fundingFeeHistory?${QUERY_STRING}&signature=${SIGNATURE}"
Python
import time, hmac, hashlib, requests
API_KEY = "your_api_key"
API_SECRET = "your_api_secret"
BASE_URL = "https://api.ztdx.io"
def sign(params: str) -> str:
return hmac.new(API_SECRET.encode(), params.encode(), hashlib.sha256).hexdigest()
def signed_get(path, params={}):
params["timestamp"] = int(time.time() * 1000)
qs = "&".join(f"{k}={v}" for k, v in params.items())
params["signature"] = sign(qs)
return requests.get(f"{BASE_URL}{path}", params=params, headers={"X-MBX-APIKEY": API_KEY})
resp = signed_get("/fapi/v1/fundingFeeHistory", params={"symbol": "BTCUSDT", "limit": "100"})
print(resp.json())