XT.COM API Documentation
website·Indexed 36 days ago
https://doc.xt.comAPI reference for the XT.COM exchange, featuring endpoints for futures copy trading, earn product positions, loan asset inquiries, broker sub-account management, and spot batch order operations.
What's inside XT.COM
- XT AI TradeKit is an AI-agent-native trading suite for XT.COM. It allows developers and traders to use plain language to check markets, perform positioning analysis, research coins, read news, manage assets, and place orders without writing API integration code. It consists of two primary layers: a local MCP server that wraps XT's APIs into 39 structured tools, and a scenario-oriented Skill layer that defines how the AI should use those tools and interact with the user.
Understand the historical copy order response schema
The response returns an array of order objects in theresultfield. Each object contains details about the trade, including quantities, prices, profit metrics, and the associated leader's information.{ "rc": 0, "mc": "string", "ma": [{}], "result": [ { "id": "string", "orderId": "string", "symbol": "string", "buySize": 0, "buyTime": 0, "buyPrice": 0, "sellSize": 0, "sellTime": 0, "sellPrice": 0, "profit": 0, "profitRate": 0, "triggerProfitPrice": 0, "triggerStopPrice": 0, "leaderOrderId": "string", "leaderNickname": "string", "leaderAvatar": "string" } ] }Get technical support for XT API
For general questions about the XT API not covered in the documentation or for Market Maker (MM) related inquiries, use the XT API Support Group on Telegram or create a formal API support ticket via Zendesk.Telegram Group: https://t.me/XT%5Fapi API Ticket: https://xtsupport.zendesk.com/hc/zh-cn/requests/new?ticket%5Fform%5Fid=14988676408857
Retrieve user financial assets overview
Use the/v4/finance/balanceendpoint to get a comprehensive overview of a user's financial assets. This includes total assets (valued in USDT and BTC), total and latest interest earnings, demand assets, and loan assets. The endpoint requires authentication via request headers; no query parameters are needed.curl -G "https://sapi.xt.com/v4/finance/balance" \ -H "validate-appkey: $APPKEY" \ -H "validate-timestamp: $TIMESTAMP" \ -H "validate-signature: $SIGNATURE" \ -H "Content-Type: application/json"Retrieve coin fundamental profiles using market_coin_profile
Use the
market_coin_profile(coin)function (powered by thext-coin-researchskill) to retrieve a comprehensive profile of a cryptocurrency. Thecoinparameter accepts symbols or names (e.g.,btcorbitcoin). The tool returns market cap rank, current market cap, Fully Diluted Valuation (FDV), circulating vs. total supply, all-time high (ATH) with drawdown, and sector classification.Note: The FDV/market cap ratio is a critical indicator of unlock pressure; a higher ratio suggests more tokens are yet to circulate, increasing potential future sell pressure.
You: How do ARB's fundamentals look AI: [ARB / Arbitrum] Market cap rank #42, market cap 1.24B USD FDV 3.87B USD — FDV/market cap ≈ 3.1, a large share of tokens is still locked Circulating 3.2B / total 10B (32%) ATH $2.40 (2023-01), -87% since Sector: Layer 2, Ethereum ecosystem
Understand the historical leader order response schema
The response returns an array of order objects in theresultfield. Each object contains details about the trade, including buy/sell prices, quantities, timestamps, profit metrics, and the number of followers.{ "rc": 0, "mc": "string", "ma": [{}], "result": [ { "id": "string", "orderId": "string", "symbol": "string", "buySize": 0, "buyTime": 0, "buyPrice": 0, "sellSize": 0, "sellTime": 0, "sellPrice": 0, "profit": 0, "profitRate": 0, "triggerProfitPrice": 0, "triggerStopPrice": 0, "followCount": 0 } ] }Interpret XT.com API Message Codes (mc)
The XT.com API uses amc(Message Code) field in its responses to provide specific details about the outcome of a request. These codes are categorized by the type of error or state encountered:General Status
SUCCESS: Request successfulFAILURE: Request failed
Authentication Errors (AUTH_xxx)
AUTH_001toAUTH_007: Missing or bad request headers (appkey, timestamp, recvwindow, algorithms, signature)AUTH_101: ApiKey does not existAUTH_102: ApiKey is not activatedAUTH_103: Signature errorAUTH_104: Unbound IP requestAUTH_105: Outdated messageAUTH_106: Exceeded apikey permission
Symbol & Market Errors (SYMBOL_xxx)
SYMBOL_001: Symbol not existSYMBOL_002: Symbol offlineSYMBOL_003: Symbol suspend tradingSYMBOL_004: Symbol country disallow tradingSYMBOL_005: Symbol does not support trading via APISYMBOL_007: Trading pair does not support order modificationSYMBOL_010: Market does not support your tradingSYMBOL_011: Trading pair temporarily restricted due to high risk
Order & Trading Errors (ORDER_xxx)
ORDER_001: Platform rejectionORDER_002: Insufficient fundsORDER_003: Trading pair suspendedORDER_004: No transactionORDER_005: Order not existORDER_006: Too many open ordersORDER_007: Sub-account has no transaction authorityORDER_008: Order price or quantity precision is abnormalORDER_F0101toORDER_F0704: Trigger filters for Price, Quantity, Quote Quantity, Protection Limits, and Liquidation price limits
Deposit & Withdrawal Errors
DEPOSIT_001toDEPOSIT_008: Issues including closed deposits, low security (2FA required), incorrect address formats, or generation delays.WITHDRAW_001toWITHDRAW_017: Issues including closed withdrawals, invalid addresses, 2FA requirements, risk control triggers, T+1 rule restrictions, insufficient balance, or daily limit exceedance.
Common System Errors
COMMON_001: User does not existCOMMON_002: System busyCOMMON_003: Operation failedCURRENCY_001: Currency information is abnormal
Retrieve trading symbol information via /v4/public/symbol
Use the
/v4/public/symbolendpoint to get detailed information about trading pairs, including currency precision, fee rates, supported order types, and trading filters.Rate Limits:
- Single symbol requests: 10 requests per second per IP.
- Multiple symbol requests: 10 requests per second per IP.
curl --location --request GET 'https://sapi.xt.com/v4/public/symbol?symbol=XT_USDT' \ --header 'accept: */*' \ --header 'Content-Type: application/json'Retrieve the current copy trading following list
Use theGET /future/copytrade/user/v1/copy-trade/current-following-v2endpoint to retrieve a list of traders the user is currently following. The response includes detailed information about the follow mode (CUSTOM or AUTO), follow amounts, profit sharing, and a detailed list of open/closed orders including leverage, margin, and PnL.GET /future/copytrade/user/v1/copy-trade/current-following-v2Handle futures notification WebSocket responses
When a notification event is triggered, the WebSocket returns a JSON object containing the symbol, position details, and the notification type. ThenotifyTypefield indicates the severity or nature of the event:WARN(warning, about to be liquidated),PARTIAL(partial liquidation),LIQUIDATION(forced liquidation), orADL(auto-deleveraging).{ "topic": "notify", "event": "notify", "data": { "symbol": "btc_usdt", "positionType": "ISOLATED", "positionSide": "LONG", "positionSize": "123", "notifyType": "WARN" } }Contact XT API Support
For general questions about the XT API not covered in the documentation or for Market Maker (MM) related inquiries, use the following support channels:
- Telegram: XT API Support Group
- Support Tickets: Create an API Ticket via Zendesk.
Use Trading APIs for Independent Broker sub-accounts
Independent broker sub-accounts possess the same account, asset, spot trading, and futures trading capabilities as standard sub-accounts. The only distinction is the statistics and commission attribution logic. Developers should use the standard sub-account API documentation for spot and futures trading, ensuring they verify the correct Base URL for each product section in the respective 'Basic Information' pages.