Skip to main content

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

NameTypeRequiredDescription
symbolSTRINGNOTrading pair filter
startTimeLONGNOStart time in milliseconds
endTimeLONGNOEnd time in milliseconds
limitINTNODefault 100; Max 1000
timestampLONGYESTimestamp

Response Fields

FieldTypeDescription
symbolSTRINGTrading pair
fundingRateSTRINGFunding rate applied at settlement
positionSizeSTRINGPosition notional size (USD)
fundingFeeSTRINGSigned fee; negative = paid, positive = received
positionSideSTRINGLONG or SHORT
assetSTRINGSettlement asset (USDT)
timeLONGSettlement timestamp (ms)
tranIdSTRINGUnique 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&timestamp=${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())