Skip to main content

Income History

Description

Query account income history including realized PnL, funding fees, commissions, etc.

HTTP Request

GET /fapi/v1/income (HMAC SHA256)

Weight

30

Request Parameters

NameTypeRequiredDescription
symbolSTRINGNOTrading pair
incomeTypeENUMNOIncome type: TRANSFER, REALIZED_PNL, FUNDING_FEE, COMMISSION, INSURANCE_CLEAR, etc.
startTimeLONGNOStart time
endTimeLONGNOEnd time
limitINTNODefault 100; Max 1000
timestampLONGYESTimestamp

Response Example

[
{
"symbol": "BTCUSDT",
"incomeType": "FUNDING_FEE", // Income type
"income": "-0.01000000", // Amount
"asset": "USDT", // Asset
"info": "5841022", // Detail field
"time": 1570636800000, // Timestamp
"tranId": "96893222", // Internal transaction ID
"tradeId": "5000" // Trade ID
}
]

Only the most recent 3 months of history can be queried. If no symbol is sent, income records for all trading pairs will be returned.

Code Examples

curl

API_KEY="your_api_key"
API_SECRET="your_api_secret"
TIMESTAMP=$(date +%s%3N)
QUERY_STRING="limit=10&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-sepolia.ztdx.io/fapi/v1/income?${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"

timestamp = int(time.time() * 1000)
qs = f"limit=10&timestamp={timestamp}"
sig = hmac.new(API_SECRET.encode(), qs.encode(), hashlib.sha256).hexdigest()
response = requests.get(
f"{BASE_URL}/fapi/v1/income",
params={"limit": 10, "timestamp": timestamp, "signature": sig},
headers={"X-MBX-APIKEY": API_KEY}
)
for item in response.json():
print(f"{item['incomeType']}: {item['income']} {item['asset']} ({item['symbol']})")