### Request Example Source: https://www.bitgetapp.com/api-doc/instloan/public/Get-Product-Info Example of how to make a GET request to retrieve product information. ```curl curl "https://api.bitget.com/api/v2/spot/ins-loan/product-infos?productId=xxx" \ -H "ACCESS-KEY:your apiKey" \ -H "ACCESS-SIGN:*******" \ -H "ACCESS-PASSPHRASE:*****" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Request Example Source: https://www.bitgetapp.com/api-doc/spot/market/Get-Coin-List Example of how to make a GET request to the /api/v2/spot/public/coins endpoint. ```bash curl "https://api.bitget.com/api/v2/spot/public/coins" ``` -------------------------------- ### Request Example Source: https://www.bitgetapp.com/api-doc/contract/market/Get-All-Symbols-Contracts Example of how to make a GET request to retrieve contract details. ```curl curl "https://api.bitget.com/api/v2/mix/market/contracts?productType=usdt-futures&symbol=BTCUSDT" ``` -------------------------------- ### Request Example Source: https://www.bitgetapp.com/api-doc/spot/market/Get-Symbols Example of how to make a GET request to retrieve spot trading symbols. ```bash curl "https://api.bitget.com/api/v2/spot/public/symbols" ``` -------------------------------- ### Request Example Source: https://www.bitgetapp.com/api-doc/uta/public/Instruments Example of how to make a GET request to the /api/v3/market/instruments endpoint. ```curl curl "https://api.bitget.com/api/v3/market/instruments?category=SPOT" \ ``` -------------------------------- ### Request Example Source: https://www.bitgetapp.com/api-doc/copytrading/spot-copytrade/trader/Config-Query-Settings Example of a cURL request to get copytrade configuration settings. ```bash curl "https://api.bitget.com/api/v2/copy/spot-trader/config-query-settings" \ -H "ACCESS-KEY:your apiKey" \ -H "ACCESS-SIGN:*******" \ -H "ACCESS-PASSPHRASE:*****" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Request Example Source: https://www.bitgetapp.com/api-doc/contract/market/Get-Discount-Rate Example of how to make a GET request to the discount rate endpoint. ```curl curl "https://api.bitget.com/api/v2/mix/market/discount-rate" ``` -------------------------------- ### REST API for Maximum Openable Quantity Source: https://www.bitgetapp.com/api-doc/classic/best-practices Example REST API endpoint to get the maximum openable quantity for futures trading. ```http GET /api/v2/mix/account/open-count ``` -------------------------------- ### Demo Trading WebSocket Endpoints Source: https://www.bitgetapp.com/api-doc/uta/guide Endpoints for establishing WebSocket connections for demo trading. ```text Public: wss://wspap.bitget.com/v3/ws/public Private: wss://wspap.bitget.com/v3/ws/private ``` -------------------------------- ### REST API for Maximum Available Quantity Source: https://www.bitgetapp.com/api-doc/uta/best-practices Example request and response for polling the REST API to get the maximum available quantity for trading. ```json {"category":"SPOT","symbol":"BTCUSDT","orderType":"market","side":"sell"} ``` ```json {"code": "00000", "requestTime": 1741851607871, "data": {"available": "52.008255", "maxOpen": "", "buyOpenCost": "", "sellOpenCost": "", "maxBuyOpen": "", "maxSellOpen": ""}, "msg": "success"} ``` -------------------------------- ### Response Example Source: https://www.bitgetapp.com/api-doc/instloan/public/Get-Product-Info Example of a successful response when retrieving product information. ```json { "code": "00000", "msg": "success", "requestTime": 1711697573019, "data": { "productId": "xxxxxxxx", "leverage": "2", "transferLine": "0.6667", "spotBuyLine": "0.8", "liquidationLine": "0.9", "stopLiquidationLine": "0.75" } } ``` -------------------------------- ### Request Example Source: https://www.bitgetapp.com/api-doc/spot/market/Get-Market-Trades Example of how to make a GET request to the fills-history endpoint. ```curl curl "https://api.bitget.com/api/v2/spot/market/fills-history?symbol=BTCUSDT&limit=20&startTime=1678965010861&endTime=1678965910861" ``` -------------------------------- ### Request Example Source: https://www.bitgetapp.com/api-doc/spot/account/Get-Subaccount-Assets Example of how to make a GET request to the subaccount-assets endpoint. ```curl curl "https://api.bitget.com/api/v2/spot/account/subaccount-assets" \ -H "ACCESS-KEY:*******" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Request Example Source: https://www.bitgetapp.com/api-doc/common/notice/Get-All-Notices Example of how to make a GET request to the /api/v2/public/annoucements endpoint. ```bash curl "https://api.bitget.com/api/v2/public/annoucements?language=zh_CN" ``` -------------------------------- ### Request Example Source: https://www.bitgetapp.com/api-doc/spot/account/Get_Upgrade_Status Example of how to make a GET request to the upgrade-status endpoint. ```curl curl "https://api.bitget.com/api/v2/spot/account/upgrade-status" \ -H "ACCESS-KEY:*******" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Request Example Source: https://www.bitgetapp.com/api-doc/spot/account/Get-Account-Info This example demonstrates how to make a GET request to the /api/v2/spot/account/info endpoint using curl. ```bash curl "https://api.bitget.com/api/v2/spot/account/info" \ -H "ACCESS-KEY:*******" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Response Example Source: https://www.bitgetapp.com/api-doc/spot/account/Get-Account-Assets This is an example of a successful response when getting account assets. ```json { "code": "00000", "message": "success", "requestTime": 1695808949356, "data": [ { "coin": "usdt", "available": "0", "frozen": "0", "locked": "0", "limitAvailable": "0", "uTime": "1622697148" } ] } ``` -------------------------------- ### Request Example Source: https://www.bitgetapp.com/api-doc/contract/market/Get-Open-Interest This example shows how to make a GET request to retrieve open interest data. ```bash curl "https://api.bitget.com/api/v2/mix/market/open-interest?symbol=BTCUSDT&productType=usdt-futures" ``` -------------------------------- ### Request Example Source: https://www.bitgetapp.com/api-doc/spot/account/Get-Account-Assets This is an example of a cURL request to get account assets. ```bash curl "https://api.bitget.com/api/v2/spot/account/assets?coin=USDT" \ -H "ACCESS-KEY:your apiKey" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Request Example Source: https://www.bitgetapp.com/api-doc/contract/market/Get-Fills-History Example of how to make a GET request to the fills-history endpoint. ```curl curl "https://api.bitget.com/api/v2/mix/market/fills-history?symbol=BTCUSDT&productType=usdt-futures" ``` -------------------------------- ### Spot Trading Symbol and Coin Examples Source: https://www.bitgetapp.com/api-doc/uta/changelog Examples demonstrating the correct format for symbol and coin fields in Spot Trading. ```text Symbol: PRESPAXUSDT Coin: preSPAX ``` -------------------------------- ### Place Order Response Example Source: https://www.bitgetapp.com/api-doc/spot/trade/Place-Order Example JSON response after placing a spot trade order. ```json { "code": "00000", "msg": "success", "requestTime": 1695808949356, "data": { "orderId": "1001", "clientOid": "121211212122" } } ``` -------------------------------- ### Request Example Source: https://www.bitgetapp.com/api-doc/contract/account/Get-Account-Bill Example of how to make a GET request to the /api/v2/mix/account/bill endpoint. ```curl curl "https://api.bitget.com/api/v2/mix/account/bill?productType=USDT-FUTURES" \ -H "ACCESS-KEY:*******" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Place Order Request Example Source: https://www.bitgetapp.com/api-doc/spot/trade/Place-Order Example of a cURL request to place a spot trade order. ```curl curl -X POST "https://api.bitget.com/api/v2/spot/trade/place-order" \ -H "ACCESS-KEY:your apiKey" \ -H "ACCESS-SIGN:*******" \ -H "ACCESS-PASSPHRASE:*****" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" \ -d '{"symbol": "BTCUSDT","side": "buy","orderType": "limit","force":"gtc","price":"23222.5","size":"1","clientOid":"121211212122"}' ``` -------------------------------- ### Request Example Source: https://www.bitgetapp.com/api-doc/contract/account/Get-Switch-Union-USDT This is an example of a GET request to the /api/v2/mix/account/switch-union-usdt endpoint. ```curl curl "https://api.bitget.com/api/v2/mix/account/switch-union-usdt" \ -H "ACCESS-KEY:*******" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Request Example Source: https://www.bitgetapp.com/api-doc/spot/account/Upgrade_Account This example shows how to make a POST request to upgrade an account using cURL. ```curl curl -X POST "https://api.bitget.com/api/v2/spot/account/upgrade" \ -H "ACCESS-KEY:*******" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" \ -d '{}' ``` -------------------------------- ### Request Example Source: https://www.bitgetapp.com/api-doc/common/public/Get-Trade-Rate Example of how to make a GET request to the /api/v2/common/trade-rate endpoint. ```curl curl "https://api.bitget.com/api/v2/common/trade-rate?symbol=BTCUSDT&business=mix" \ -H "ACCESS-KEY:*******" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Response Example Source: https://www.bitgetapp.com/api-doc/spot/market/Get-Coin-List Example of a successful JSON response when querying for spot coin information. ```json { "code": "00000", "msg": "success", "requestTime": 1695799900330, "data": [ { "coinId": "1", "coin": "BTC", "transfer": "true", "chains": [ { "chain": "BTC", "needTag": "false", "withdrawable": "true", "rechargeable": "true", "withdrawFee": "0.005", "extraWithdrawFee": "0", "depositConfirm": "1", "withdrawConfirm": "1", "minDepositAmount": "0.001", "minWithdrawAmount": "0.001", "browserUrl": "https://blockchair.com/bitcoin/testnet/transaction/", "contractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7", "withdrawStep": "0", "withdrawMinScale": "8", "congestion":"normal" } ] } ] } ``` -------------------------------- ### Request Example Source: https://www.bitgetapp.com/api-doc/copytrading/spot-copytrade/trader/Order-Total-Detail Example of how to make a GET request to the order-total-detail endpoint. ```curl curl "https://api.bitget.com/api/v2/copy/spot-trader/order-total-detail" \ -H "ACCESS-KEY:your apiKey" \ -H "ACCESS-SIGN:*******" \ -H "ACCESS-PASSPHRASE:*****" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Response Example Source: https://www.bitgetapp.com/api-doc/instloan/account/Get-LTV Example JSON response structure for the Get LTV API call. ```json { "code": "00000", "msg": "success", "requestTime": 1711697588556, "data": { "ltv": "0.6667", "subAccountUids": [ "xxxxxxxxxx", "xxxxxxxxxx" ], "unpaidUsdtAmount": "1.12", "usdtBalance":"1223", "unpaidInfo":[ { "coin":"USDT", "unpaidQty":"12", "unpaidInterest":"1.2" } ], "balanceInfo":[ { "coin":"USDT", "price":"12", "amount":"1.2", "convertedUsdtAmount":"12" } ] } } ``` -------------------------------- ### Response Example Source: https://www.bitgetapp.com/api-doc/spot/account/Get-Account-Info This is an example of a successful response from the Get Account Information API endpoint, showing user details and permissions. ```json { "code": "00000", "msg": "success", "requestTime": 1695808949356, "data": { "userId": "**********", "inviterId": "**********", "ips": "127.0.0.1", "authorities": [ "cpor", "coor" ], "parentId": 1, "traderType": "trader", "channelCode": "XXX", "channel": "YYY", "regisTime":"1246566789345" } } ``` -------------------------------- ### Go Timestamp Example Source: https://www.bitgetapp.com/api-doc/common/signature Example of how to get the current timestamp in milliseconds using Go. ```go import ( "time" ) int64(time.Now().UnixNano()/1000000) ``` -------------------------------- ### Request Example Source: https://www.bitgetapp.com/api-doc/instloan/account/Get-LTV Example of how to make a GET request to the /api/v2/spot/ins-loan/ltv-convert endpoint using curl. ```curl curl "https://api.bitget.com /api/v2/spot/ins-loan/ltv-convert" \ -H "ACCESS-KEY:your apiKey" \ -H "ACCESS-SIGN:*******" \ -H "ACCESS-PASSPHRASE:*****" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Request Example Source: https://www.bitgetapp.com/api-doc/instloan/public/Get-Spot-Symbols Example of how to make a GET request to retrieve spot symbols. ```curl curl "https://api.bitget.com/api/v2/spot/ins-loan/symbols?productId=xxx" \ -H "ACCESS-KEY:your apiKey" \ -H "ACCESS-SIGN:*******" \ -H "ACCESS-PASSPHRASE:*****" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Request Example Source: https://www.bitgetapp.com/api-doc/copytrading/spot-copytrade/trader/Profit-Summarys Example of how to make a GET request to the profit summary endpoint. ```curl curl "https://api.bitget.com/api/v2/copy/spot-trader/profit-summarys" \ -H "ACCESS-KEY:your apiKey" \ -H "ACCESS-SIGN:*******" \ -H "ACCESS-PASSPHRASE:*****" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Response Example Source: https://www.bitgetapp.com/api-doc/copytrading/spot-copytrade/trader/Config-Query-Settings Example JSON response for the copytrade configuration settings query. ```json { "code": "00000", "msg": "success", "requestTime": 1695807020372, "data": { "removeLimitUsdt": "100", "spotInfoList": [ { "maxQuoteSize": "5000000", "surplusQuoteSize": "4998894.59", "symbol": "BTCUSDT" }, { "maxQuoteSize": "300000", "surplusQuoteSize": "300000", "symbol": "ETHBTC" }, { "maxQuoteSize": "50000", "surplusQuoteSize": "50000", "symbol": "ETHUSDT" } ], "labelList": [], "enable": "YES", "showAssetsMap": "NO", "showEquity": "NO", "traceSymbolList": [ { "enable": "NO", "symbol": "BGBUSDT", "minOpenCount": "0.0001" }, { "enable": "YES", "symbol": "BTCUSDT", "minOpenCount": "0.0005" }, { "enable": "YES", "symbol": "ETHBTC", "minOpenCount": "0.0001" }, { "enable": "YES", "symbol": "ETHUSDT", "minOpenCount": "0.0001" } ] } } ``` -------------------------------- ### Response Example Source: https://www.bitgetapp.com/api-doc/contract/account/Get-Account-List Example JSON response for the account list query. ```json { "code": "00000", "data": [ { "marginCoin": "USDT", "locked": "0.31876482", "available": "10575.26735771", "crossedMaxAvailable": "10580.56434289", "isolatedMaxAvailable": "10580.56434289", "maxTransferOut": "10572.92904289", "accountEquity": "10582.90265771", "usdtEquity": "10582.902657719473", "btcEquity": "0.204885807029", "crossedRiskRate": "0", "unrealizedPL": "", "coupon": "0", "unionTotalMagin": "111,1", "unionAvailable": "1111.1", "unionMm": "111", "assetList": [ { "coin": "BTC", "balance": "1.2", "available": "1.2" } ], "isolatedMargin": "23.43", "crossedMargin": "34.34", "crossedUnrealizedPL":"23", "isolatedUnrealizedPL":"0", "grant": "0", "assetMode": "union" } ], "msg": "success", "requestTime": 1630901215622 } ```