### GET Request Example for Batch Order Status Source: https://docs.coinex.com/api/v2/spot/order/http/get-multi-order-status This example demonstrates how to construct a GET request to the batch order status endpoint, specifying the market and a list of order IDs. ```http GET /spot/batch-order-status?market=CETUSDT&order_ids=13400,13401 ``` -------------------------------- ### Get System Time Response Example Source: https://docs.coinex.com/api/v2/common/http/time This is an example of the JSON response received when calling the GET /time endpoint. It includes the server timestamp in milliseconds. ```json { "code": 0, "message": "OK", "data": { "timestamp": 1642231731234 } } ``` -------------------------------- ### GET Request Example for User Order Transactions Source: https://docs.coinex.com/api/v2/spot/deal/http/list-user-order-deals This example demonstrates how to construct a GET request to retrieve user order transactions. Ensure all required parameters like 'market', 'market_type', and 'order_id' are included. ```http GET /spot/order-deals?market=BTCUSDT&market_type=MARGIN&order_id=8678890&page=1&limit=10 ``` -------------------------------- ### Get Market Status Example Source: https://docs.coinex.com/api/v2/futures/market/http/list-market This example demonstrates how to make an HTTP GET request to retrieve market status for a specific market like BTCUSDT. Ensure you are using the correct API endpoint. ```http GET /futures/market?market=BTCUSDT ``` -------------------------------- ### Get Sub-Account List Request Example Source: https://docs.coinex.com/api/v2/account/subs/http/list-sub This example demonstrates how to make a GET request to the /account/subs endpoint to retrieve a paginated list of sub-accounts, filtering by frozen status. ```http GET /account/subs?is_frozen=false&page=1&limit=10 ``` -------------------------------- ### GET Agent Rebate Records Request Example Source: https://docs.coinex.com/api/v2/refer/agent_referee/http/get-agent-rebate-record Example of a GET request to retrieve agent rebate records. Includes parameters for start time, end time, page number, and limit per page. Ensure to use valid Unix timestamps for time parameters. ```http GET /refer/agent-rebate/record?start_time=1609459200000&end_time=1609545600000&page=1&limit=10 ``` -------------------------------- ### Get Borrowing Limit Response Example Source: https://docs.coinex.com/api/v2/assets/loan-flat/http/list-margin-interest-limit Example JSON response for the Get Borrowing Limit endpoint, showing market details, interest rate, leverage, and borrowing amounts. ```json { "code": 0, "data": { "market": "BTCUSDT", "ccy": "USDT", "daily_interest_rate": "0.0009", "leverage": "10", "min_amount": "1", "max_amount": "200000" }, "message": "OK" } ``` -------------------------------- ### GET Request Example for Direct Rebate Details Source: https://docs.coinex.com/api/v2/refer/referee/http/get-referee-rebate-detail This example demonstrates how to call the API endpoint to retrieve direct rebate details. It includes query parameters for searching, time range, and pagination. Ensure you handle authentication and rate limits as specified. ```http GET /refer/referee-rebate/detail?search=user&start_time=1609459200000&end_time=1609545600000&page=1&limit=10 ``` -------------------------------- ### Get Maintenance Info Request Example Source: https://docs.coinex.com/api/v2/common/http/maintain This is an example of a GET request to retrieve maintenance information. Ensure the path is correct. ```http GET /maintain-info ``` -------------------------------- ### Get Unfilled Orders Request Example Source: https://docs.coinex.com/api/v2/spot/order/http/list-pending-order Example of an HTTP GET request to retrieve unfilled orders for a specific market and market type. Ensure to include required parameters like market_type. ```http GET /spot/pending-order?market=CETUSDT&market_type=MARGIN&order_side=buy&page=1&limit=10 ``` -------------------------------- ### Get Borrowing Limit Request Example Source: https://docs.coinex.com/api/v2/assets/loan-flat/http/list-margin-interest-limit Example of an HTTP GET request to retrieve borrowing limits. Requires 'market' and 'ccy' parameters. ```http GET /assets/margin/interest-limit?market=BTCUSDT&ccy=USDT ``` -------------------------------- ### GET Deposit History Request Example Source: https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/list-deposit-history Example of a GET request to retrieve deposit history with specified currency, status, page, and limit. ```http GET /assets/deposit-history?coin=CET&status=finish&page=1&limit=10 ``` -------------------------------- ### GET Market Liquidation History Example Source: https://docs.coinex.com/api/v2/futures/market/http/list-market-liquidation-history Example GET request to retrieve liquidation history for the LATUSDT market. No specific time filtering is applied, and default pagination settings are used. ```http GET /futures/liquidation-history?market=LATUSDT ``` -------------------------------- ### Get Filled Order Request Example Source: https://docs.coinex.com/api/v2/futures/order/http/list-finished-order Example GET request to retrieve filled orders. Specify market, market_type, side, page, and limit parameters as needed. ```http GET /spot/finished-order?market=CETUSDT&market_type=FUTURES&side=buy&page=1&limit=10 ``` -------------------------------- ### Spot Balance Response Example Source: https://docs.coinex.com/api/v2/account/subs/http/get-sub-spot-balance This is an example of the JSON response when successfully retrieving spot balance data for a sub-account. ```json { "code": 0, "data": [ { "ccy": "CET", "available": "41232.366264748", "frozen": "3702.28145353364" } ], "message": "OK" } ``` -------------------------------- ### GET /assets/margin/borrow-history Request Example Source: https://docs.coinex.com/api/v2/assets/loan-flat/http/list-margin-borrow-history This example demonstrates how to construct a GET request to retrieve borrowing history. It includes query parameters for filtering by market, status, page number, and limit per page. Ensure you have the correct authentication headers. ```http GET /assets/margin/borrow-history?market=CETUSDT&status=finish&page=1&limit=10 ``` -------------------------------- ### Unfilled Order Response Example Source: https://docs.coinex.com/api/v2/spot/order/http/list-pending-order Example JSON response structure for the GET /spot/pending-order endpoint, detailing the fields for each unfilled order, including amounts, prices, and fees. ```json { "code": 0, "data": [ { "order_id": 13400, "market": " CETUSDT", "market_type": "MARGIN", "side": "buy", "type": "limit", "amount": "10000", "price": "1", "unfilled_amount": "50241.7185224371", "filled_amount": "27564.87468358", "filled_value": "27564.87468358", "client_id": "client_id_1", "base_fee": "11.6582326221", "quote_fee": "0", "discount_fee": "0", "maker_fee_rate": "0", "taker_fee_rate": "0.0003", "last_fill_amount": "27564.87468358", "last_fill_price": "1", "created_at": 1691482451000, "updated_at": 1691482451000 } ], "pagination": { "total": 1, "has_next": false } "message": "OK" } ``` -------------------------------- ### Get Sub-Account Info Response Example Source: https://docs.coinex.com/api/v2/account/subs/http/get-sub-info This is an example of the JSON response when successfully retrieving sub-account information. It includes user type and sub-account name if applicable. ```json { "code": 0, "data": { "sub_user_name": "sub1", "user_type": "SUB_ACCOUNT" }, "message": "OK" } ``` -------------------------------- ### Get Market Position Level Example Source: https://docs.coinex.com/api/v2/futures/market/http/list-market-position-level This example demonstrates how to retrieve position level data for a specific market (BTCUSDT). The response includes details on position limits, leverage, and margin rates for different levels. ```http GET /futures/position-level?market=BTCUSDT ``` ```json { "code": 0, "data": [ { "market": "BTCUSDT", "level": [ {"amount": "20", "leverage": "100", "maintenance_margin_rate": "0.005", "min_initial_margin_rate": "0.01"}, {"amount": "50", "leverage": "50", "maintenance_margin_rate": "0.01", "min_initial_margin_rate": "0.02"}, {"amount": "100", "leverage": "30", "maintenance_margin_rate": "0.015", "min_initial_margin_rate": "0.0333"}, {"amount": "200", "leverage": "20", "maintenance_margin_rate": "0.02", "min_initial_margin_rate": "0.05"}, {"amount": "500", "leverage": "15", "maintenance_margin_rate": "0.025", "min_initial_margin_rate": "0.06"}, {"amount": "1000", "leverage": "10", "maintenance_margin_rate": "0.03", "min_initial_margin_rate": "0.1"} ] } ], "message": "OK" } ``` -------------------------------- ### HTTP Request Example Source: https://docs.coinex.com/api/v2/futures/position/http/list-position-settle-history Example of a GET request to retrieve position auto settlement history with specified parameters. ```http GET /futures/position-settle-history?market=CETUSDT&market_type=FUTURES&position_id=927266133&start_time=1636451914231&page=1&limit=100 ``` -------------------------------- ### GET Unfilled Stop Order Request Example Source: https://docs.coinex.com/api/v2/futures/order/http/list-pending-stop-order This example demonstrates how to construct a GET request to retrieve unfilled stop orders. Ensure you include necessary parameters like market_type, and optionally market, side, page, and limit. ```http GET /futures/pending-stop-order?market=CETUSDT&market_type=FUTURES&side=buy&page=1&limit=10 ``` -------------------------------- ### Get Sub-Account List Response Example Source: https://docs.coinex.com/api/v2/account/subs/http/list-sub This is an example of a successful response from the /account/subs endpoint, showing the structure of the returned data including sub-account details and pagination information. ```json { "code": 0, "message": "OK", "data": [ { "sub_user_name": "sub2", "is_frozen": true, "is_authorized": false, "permissions": ["FUTURES", "API"], "balance_usd": "3564.23" } ], "pagination": { "total": 1, "has_next": false } } ``` -------------------------------- ### GET Request Example for Withdrawal Record Source: https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/list-withdrawal-history Demonstrates how to call the GET /assets/withdraw endpoint to retrieve withdrawal records. Includes parameters for currency and pagination. ```http GET /assets/withdraw?coin=USDT&page=1&limit=10 ``` -------------------------------- ### Get Coin Info Request Example Source: https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/list-assets-info This example demonstrates how to request information for a specific currency, CET, using the /assets/info endpoint. The 'ccy' parameter is optional; omitting it returns data for all currencies. ```HTTP GET /assets/info?ccy=CET ``` -------------------------------- ### Response Example Source: https://docs.coinex.com/api/v2/futures/position/http/list-position-settle-history Example JSON response for the position auto settlement history endpoint, showing settlement details for a specific position. ```json { "code": 0, "message": "OK", "data": [ { "market": " CETUSDT", "market_type": "FUTURES", "position_id": 927266133, "margin_mode": "cross", "leverage": "10", "liq_price": "0.05679", "bkr_price": "0.053635", "settle_price": "0.06817", "open_interest": "129384.12" "margin_avbl": "189132.05", "margin_change": "5000", "created_at": 1691482451000 } ], "pagination": { "has_next": false } } ``` -------------------------------- ### Order Placement Response Example Source: https://docs.coinex.com/api/v2/futures/order/http/put-order Example of a successful response after placing an order. It includes details like order ID, filled amounts, and fees. ```json { "code": 0, "data": { "order_id": "13400", "market": " CETUSDT", "market_type": "FUTURES", "side": "buy", "type": "limit", "amount": "10000", "price": "1", "unfilled_amount": "50241.7185224371", "filled_amount": "27564.87468358", "filled_value": "27564.87468358", "client_id": "client_id_1", "fee": "11.6582326221", "fee_ccy": "USDT", "maker_fee_rate": "0", "taker_fee_rate": "0.0003", "last_filled_amount": "27564.87468358", "last_filled_price": "1", "realized_pnl": "-22.142539215", "created_at": 1691482451000, "updated_at": 1691482451000 }, "message": "OK" } ``` -------------------------------- ### Place Limit Order Request Example Source: https://docs.coinex.com/api/v2/futures/order/http/put-order Example of a POST request to place a limit order. Ensure all required parameters are correctly set. ```json { "market": "CETUSDT", "market_type": "FUTURES", "side": "buy", "type": "limit", "amount": "10000", "price": "1", "client_id": "user1", "is_hide": true } ``` -------------------------------- ### Get Market Depth Request Example Source: https://docs.coinex.com/api/v2/spot/market/http/list-market-depth Example of an HTTP GET request to retrieve market depth data for BTCUSDT with a limit of 5 and an interval of 0.01. ```http GET /spot/depth?market=BTCUSDT&limit=5&interval=0.01 ``` -------------------------------- ### Place Market Order Request Example Source: https://docs.coinex.com/api/v2/futures/order/http/put-order Example of a POST request to place a market order. This type of order executes at the best available market price. ```json { "market": "CETUSDT", "market_type": "FUTURES", "side": "buy", "type": "market", "amount": "10000", "client_id": "user1", "is_hide": true } ``` -------------------------------- ### Get Market Candlestick Request Example Source: https://docs.coinex.com/api/v2/futures/market/http/list-market-kline Example of an HTTP GET request to retrieve market candlestick data. Ensure 'market' and 'period' parameters are provided. ```http GET /futures/kline?market=LATUSDT&limit=1&period=1day ``` -------------------------------- ### Response Example for Sub-Account API KEY List Source: https://docs.coinex.com/api/v2/account/subs/http/list-sub-api This is an example of the JSON response when successfully retrieving API keys for a sub-account. It includes details such as api_id, creation time, access ID, IP whitelist status, permissions, expiration, and remarks. ```json { "code": 0, "data": [ { "api_id": 554, "created_at": 1642145331234, "access_id": "xxxxxxxxxx", "ip_whitelist": [ "1.1.1.1" ], "trade_enabled": true, "withdraw_enabled": false, "is_expired": false, "expires_at": 0, "remark": "spot market maker" } ], "pagination": { "total": 1, "has_next": false }, "message": "OK" } ``` -------------------------------- ### Response Example for Deposit and Withdrawal Configuration Source: https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/list-all-deposit-withdrawal-config This JSON response details the configuration for asset deposits and withdrawals, including asset-level settings and chain-specific parameters like minimum amounts and fees. ```json { "code": 0, "data": [ {"asset": { "ccy": "CET", "deposit_enabled": true, "withdraw_enabled": false, "inter_transfer_enabled": true, "is_st": false }, "chains": [ { "chain": "CSC", "min_deposit_amount": "0.023", "min_withdraw_amount": "0.019", "deposit_enabled": false, "withdraw_enabled": false, "deposit_delay_minutes": 0, "safe_confirmations": 100, "irreversible_confirmations": 200, "deflation_rate": "0", "withdrawal_fee": "0.019", "withdrawal_precision": 6, "memo": "", "is_memo_required_for_deposit": false, "explorer_asset_url": "https://www.coinex.net/token/0x398dca951cd4fc18264d995dcd171aa5debda129" } ]}, ] "message": "OK" } ``` -------------------------------- ### Response Example for Deposit/Withdrawal Config Source: https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/get-deposit-withdrawal-config This JSON response details the asset's general deposit/withdrawal status and specific configurations for each supported chain, including minimum amounts, enabled status, and confirmation requirements. ```json { "code": 0, "data": { "asset": { "ccy": "CET", "deposit_enabled": true, "withdraw_enabled": false, "inter_transfer_enabled": true, "is_st": false }, "chains": [ { "chain": "CSC", "min_deposit_amount": "0.023", "min_withdraw_amount": "0.019", "deposit_enabled": false, "withdraw_enabled": false, "deposit_delay_minutes": 0, "safe_confirmations": 100, "irreversible_confirmations": 200, "deflation_rate": "0", "withdrawal_fee": "0.019", "withdrawal_precision": 6, "memo": "", "is_memo_required_for_deposit": false, "explorer_asset_url": "https://www.coinex.net/token/0x398dca951cd4fc18264d995dcd171aa5debda129" } ], "message": "OK" } ``` -------------------------------- ### Market Index Response Example Source: https://docs.coinex.com/api/v2/spot/market/http/list-market-index This is an example of a successful response from the /spot/index endpoint. It shows the structure of the data returned, including the market identifier, timestamp, the calculated index price, and an array of sources with their exchange name, data collection time, index weight, and individual index price. ```json { "code": 0, "data": [ { "market": "BTCUSDT", "created_at": 1689152421692, "price": "30718.42", "sources": [ { "exchange": "kucoin", "created_at": 1689152421685, "index_weight": "1.00000000", "index_price": "30718.42" } ] } ], "message": "OK" } ``` -------------------------------- ### Get Market Status Request Example Source: https://docs.coinex.com/api/v2/spot/market/http/list-market Example of an HTTP GET request to retrieve market status for a specific market. The 'market' parameter accepts a comma-separated list of market names, with a maximum of 10. ```http GET /spot/market?market=BTCUSDT ``` -------------------------------- ### Order Status Response Example Source: https://docs.coinex.com/api/v2/futures/order/http/get-order-status This is an example of a successful response when querying the order status. It includes details about the order such as amounts, prices, fees, and the current status. ```json { "code": 0, "data": { "order_id": 13400, "market": " CETUSDT", "market_type": "FUTURES", "side": "buy", "type": "limit", "amount": "10000", "price": "1", "unfilled_amount": "50241.7185224371", "filled_amount": "27564.87468358", "filled_value": "27564.87468358", "client_id": "client_id_1", "fee": "11.6582326221", "fee_ccy": "USDT", "maker_fee_rate": "0", "taker_fee_rate": "0.0003", "last_filled_amount": "27564.87468358", "last_filled_price": "1", "realized_pnl": "-22.142539215", "created_at": 1691482451000, "updated_at": 1691482451000, "status": "part_deal" }, "message": "OK" } ``` -------------------------------- ### Funding Rate Response Example Source: https://docs.coinex.com/api/v2/futures/market/http/list-market-funding-rate This is an example of the JSON response when querying for market funding rates. It includes details like market name, mark price, latest and next funding rates, and their respective times. ```JSON { "code": 0, "data": [ { "market": "LATUSDT", "mark_price": "0.008157", "latest_funding_rate": "-0.00007488", "next_funding_rate": "-0.00027732", "max_funding_rate": "0.00375", "min_funding_rate": "-0.00375", "latest_funding_time": 1642145331234, "next_funding_time": 1642231731234 }, { "market": "ELONUSDT", "mark_price": "0.000000152823", "latest_funding_rate": "-0.00003688", "next_funding_rate": "-0.00013372", "max_funding_rate": "0.00375", "min_funding_rate": "-0.00375", "latest_funding_time": 1642145331234, "next_funding_time": 1642231731234 } ], "message": "OK" } ``` -------------------------------- ### Batch Place Orders Request Example Source: https://docs.coinex.com/api/v2/futures/order/http/put-multi-order This JSON object demonstrates the structure for a batch order placement request. It includes details for a single limit order on a futures market. Ensure all required fields like market, market_type, side, type, and amount are correctly populated. ```json { "orders": [ { "market": "CETUSDT", "market_type": "FUTURES", "side": "buy", "type": "limit", "amount": "10000", "price": "1", "client_id": "user1", "is_hide": true } ] } ``` -------------------------------- ### GET Request for Direct Rebate Records Source: https://docs.coinex.com/api/v2/refer/referee/http/get-referee-rebate-record Example of a GET request to retrieve direct rebate records with specified time range and pagination. ```http GET /refer/referee-rebate/record?start_time=1609459200000&end_time=1609545600000&page=1&limit=10 ``` -------------------------------- ### Credit Account Info Response Example Source: https://docs.coinex.com/api/v2/assets/balance/http/get-credit-info This is an example of a successful response from the /assets/credit/info endpoint, showing the structure of the returned data including equity, repaid, risk_rate, withdrawal_risk, and withdrawal_value. ```json { "code": 0, "data": { "equity": "12487.94058101", "repaid": "2457.19846450", "risk_rate": "", "withdrawal_risk": "1.35", "withdrawal_value": "10030.74211651" }, "message": "OK" } ``` -------------------------------- ### Get Agent Referee List Request Source: https://docs.coinex.com/api/v2/refer/agent_referee/http/list-agent-referee This is an example of a GET request to the agent-referee endpoint. It can be used to retrieve a paginated list of agent referees. ```http GET /refer/agent-referee ``` -------------------------------- ### Response Example for Futures Market Settings Source: https://docs.coinex.com/api/v2/account/settings/http/accquire-futures-market-settings This is an example of the JSON response when querying user futures market settings. It indicates the status of the auto-settlement feature. ```JSON { "code": 0, "data": { "settle_switch": 2 }, "message": "OK" } ``` -------------------------------- ### Credit Account Balance Response Example Source: https://docs.coinex.com/api/v2/assets/balance/http/get-credit-balance This is an example of the JSON response you will receive when successfully querying your credit account balance. It includes currency, amount to be repaid, and interest. ```json { "code": 0, "data": [ { "ccy": "USDT", "repaid": "98.99999998", "interest": "259.29744279" } ], "message": "OK" } ``` -------------------------------- ### Deposit Address Response Example Source: https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/get-deposit-address This is an example of a successful response from the GET /assets/deposit-address endpoint. It includes the deposit address and an optional memo if required by the currency. ```json { "code": 0, "data": { "address": "0x40aa234bcdc528ce411a6020da1a3c07124039d4", "memo": "" }, "message": "OK" } ``` -------------------------------- ### GET /futures/deals - Get Market Transactions Source: https://docs.coinex.com/api/v2/futures/market/http/list-market-deals Retrieves a list of recent transactions for a specified market. You can control the number of results and the starting point of the query. ```APIDOC ## GET /futures/deals ### Description Retrieves a list of recent transactions for a specified market. You can control the number of results and the starting point of the query. ### Method GET ### Endpoint `/futures/deals` ### Parameters #### Query Parameters - **market** (string) - Required - Market name (e.g., BTCUSDT) - **limit** (int) - Optional - Number of transaction data items. Default is 100, max value is 1000. - **last_id** (int) - Optional - The starting point of the query TxID. 0 means to acquire from the latest record. ### Request Example `GET /futures/deals?market=BTCUSDT` ### Response #### Success Response (200) - **code** (int) - Response code. - **data** (array) - Array of transaction objects. - **deal_id** (int) - Deal ID. - **created_at** (int) - Transaction timestamp in milliseconds. - **side** (string) - Taker side, "buy" or "sell". - **price** (string) - Filled price. - **amount** (string) - Executed Amount. - **message** (string) - Response message. #### Response Example ```json { "code": 0, "data": [ { "deal_id": 3514376759, "created_at": 1689152421692, "side": "buy", "price": "30718.42", "amount": "0.00000325" }, { "deal_id": 3514376758, "created_at": 1689152421692, "side": "buy", "price": "30718.42", "amount": "0.00015729" } ], "message": "OK" } ``` ``` -------------------------------- ### Request Example for Take Profit Source: https://docs.coinex.com/api/v2/futures/position/http/modify-position-take-profit This JSON object demonstrates a request to set a take-profit order. It specifies the market, market type, take-profit ID, and the desired take-profit price. ```json { "market": "CETUSDT", "market_type": "FUTURES", "take_profit_id": 123456, "take_profit_price": "0.075" } ``` -------------------------------- ### Get Direct Referee List Request Source: https://docs.coinex.com/api/v2/refer/referee/http/list-referee This is an example of an HTTP GET request to retrieve the list of direct referees. It requires authentication and is subject to rate limits. ```http GET /refer/referee ```