### Get Product Info Request Example (cURL) Source: https://github.com/sebastianganser/bitget_api/blob/main/instloan/public/Get-Product-Info.md Example of how to make an HTTP GET request to the Bitget API to retrieve product information. It includes necessary headers for authentication and content type. ```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" ``` -------------------------------- ### Get Order Detail Request Example (cURL) Source: https://github.com/sebastianganser/bitget_api/blob/main/contract/trade/Get-Order-Details.md This example demonstrates how to make a GET request to the Bitget API to retrieve the details of a specific order. It includes required headers for authentication and parameters to identify the order. ```bash curl "https://api.bitget.com/api/v2/mix/order/detail?symbol=ETHUSDT&orderId=1&clientOid=1&productType=usdt-futures" \ -H "ACCESS-KEY:your apiKey" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:zh-CN" \ -H "Content-Type: application/json" ``` -------------------------------- ### Get LTV Request Example (cURL) Source: https://github.com/sebastianganser/bitget_api/blob/main/instloan/account/Get-LTV.md Example of how to make an HTTP GET request to the Bitget API's /api/v2/spot/ins-loan/ltv-convert endpoint using cURL. It demonstrates the necessary headers for authentication and content type. ```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" ``` -------------------------------- ### Get Order Fills Request Example (cURL) Source: https://github.com/sebastianganser/bitget_api/blob/main/contract/trade/Get-Order-Fills.md Example of an HTTP GET request to retrieve order fill details using cURL. It demonstrates how to include authentication headers and query parameters like productType. ```bash curl "https://api.bitget.com/api/v2/mix/order/fills?productType=usdt-futures" \ -H "ACCESS-KEY:your apiKey" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:zh-CN" \ -H "Content-Type: application/json" ``` -------------------------------- ### Get All Positions Request Example (curl) Source: https://github.com/sebastianganser/bitget_api/blob/main/contract/position/get-all-position.md Example of how to make an HTTP GET request to the Bitget API to retrieve all positions. It specifies the endpoint, query parameters like productType and marginCoin, and required headers for authentication and content type. ```curl curl "https://api.bitget.com/api/v2/mix/position/all-position?productType=USDT-FUTURES&marginCoin=USDT" \ -H "ACCESS-KEY:*******" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Get P2P Merchant List Request Example (cURL) Source: https://github.com/sebastianganser/bitget_api/blob/main/common/p2p/Get-P2P-Merchant-List.md Example of how to make a GET request to the Bitget API to retrieve a list of P2P merchants. It includes necessary headers such as ACCESS-KEY, ACCESS-SIGN, ACCESS-PASSPHRASE, ACCESS-TIMESTAMP, and locale. The 'online' and 'limit' query parameters are demonstrated. ```bash curl "https://api.bitget.com/api/v2/p2p/merchantList?online=yes&limit=20" \ -H "ACCESS-KEY:*******" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Get Account Bills Request Example (cURL) Source: https://github.com/sebastianganser/bitget_api/blob/main/contract/account/Get-Account-Bill.md Example of how to make a GET request to the Bitget API to retrieve account bills. This includes setting necessary headers like API keys, timestamps, and specifying the product type. ```bash 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" ``` -------------------------------- ### Get All Account Balance - cURL Request Example Source: https://github.com/sebastianganser/bitget_api/blob/main/common/account/All-Account-Balance.md Example of an HTTP GET request to the Bitget API endpoint for retrieving all account balances. It includes necessary authentication headers and content type. ```shell curl "https://api.bitget.com/api/v2/account/all-account-balance" \ -H "ACCESS-KEY:your apiKey" \ -H "ACCESS-SIGN:*******" \ -H "ACCESS-PASSPHRASE:*****" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Get Loan History Request Example (cURL) Source: https://github.com/sebastianganser/bitget_api/blob/main/earn/loan/Get-Borrow-History.md This snippet demonstrates how to make a GET request to the Bitget API to retrieve loan history. It includes essential headers for authentication and specifies the start and end times for the query. The example uses cURL for clarity. ```curl curl "https://api.bitget.com/api/v2/earn/loan/borrow-history?startTime=1685957902000&endTime=1691228302423" \ -H "ACCESS-KEY:your apiKey" \ -H "ACCESS-SIGN:*******" \ -H "ACCESS-PASSPHRASE:*****" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Get Product Info Response Example (JSON) Source: https://github.com/sebastianganser/bitget_api/blob/main/instloan/public/Get-Product-Info.md Example JSON response from the Bitget API when requesting product information. It shows the structure of the returned data, including status codes and product details. ```json { "code": "00000", "msg": "success", "requestTime": 1711697573019, "data": { "productId": "xxxxxxxx", "leverage": "2", "transferLine": "0.6667", "spotBuyLine": "0.8", "liquidationLine": "0.9", "stopLiquidationLine": "0.75" } } ``` -------------------------------- ### Get Market Trades Request Example (cURL) Source: https://github.com/sebastianganser/bitget_api/blob/main/spot/market/Get-Market-Trades.md Example of how to make an HTTP GET request to the Bitget API to retrieve market trades. It includes parameters for symbol, limit, start time, and end time. The time interval between startTime and endTime should not exceed 7 days, and data can be retrieved for up to 90 days. ```bash curl "https://api.bitget.com/api/v2/spot/market/fills-history?symbol=BTCUSDT&limit=20&startTime=1678965010861&endTime=1678965910861" ``` -------------------------------- ### Bitget WebSocket Login Request Example Source: https://github.com/sebastianganser/bitget_api/blob/main/common/websocket-intro.md An example of a JSON payload for a Bitget WebSocket login request, demonstrating the expected format and values for authentication parameters. ```json { "op":"login", "args":[ { "apiKey":"xx_xxx", "passphrase":"xxx", "timestamp":"1538054050", "sign":"8RCOqCJAhhEh4PWcZB/96QojLDqMAg4qNynIixFzS3E=" } ] } ``` -------------------------------- ### Get Isolated Repayment History (cURL) Source: https://github.com/sebastianganser/bitget_api/blob/main/margin/isolated/record/Get-Isolated-Repay-History.md Example of how to retrieve isolated repayment history using cURL. This request requires authentication headers and specifies trading pair and start time. ```shell curl "https://api.bitget.com/api/v2/margin/isolated/repay-history?symbol=BTCUSDT&startTime=1695336324000" -H "ACCESS-KEY:*******" \ -H "ACCESS-SIGN:*******" \ -H "ACCESS-PASSPHRASE:*****" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Get Isolated Liquidation History (cURL) Source: https://github.com/sebastianganser/bitget_api/blob/main/margin/isolated/record/Get-Isolated-Liquidation-Records.md Example of how to retrieve isolated liquidation records using cURL. This request requires authentication headers and specifies the trading pair and start time. ```shell curl "https://api.bitget.com/api/v2/margin/isolated/liquidation-history?symbol=BTCUSDT&startTime=1692690126000" -H "ACCESS-KEY:*******" \ -H "ACCESS-SIGN:*******" \ -H "ACCESS-PASSPHRASE:*****" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Equity Channel Push Data Example (JSON) Source: https://github.com/sebastianganser/bitget_api/blob/main/contract/websocket/private/Equity-Channel.md This JSON object illustrates the data pushed through the equity channel. It includes an action type ('snapshot'), subscription arguments, and a 'data' array containing account equity (USDT and BTC), unrealized PNL, and margin details. ```json { "action": "snapshot", "arg": { "instType": "USDT-FUTURES", "channel": "equity", "instId": "default" }, "data": [ { "btcEquity": "0.0021", "usdtEquity": "13.985457617660", "usdtUnrealized": "0.000000000000", "unionTotalMargin": "100", "unionAvailable": "11", "unionMm": "11" } ], "ts": 1695717225146 } ``` -------------------------------- ### Get BGB Convert History (cURL) Source: https://github.com/sebastianganser/bitget_api/blob/main/common/bgb-convert/Get-BGB-Convert-Record.md Example of how to retrieve BGB conversion history using cURL. This request requires authentication headers and allows filtering by start time, end time, and limit. The response contains a list of conversion records. ```curl curl "https://api.bitget.com/api/v2/convert/bgb-convert-records?startTime=1686128558000&endTime=1686214958000&limit=10" \ -H "ACCESS-KEY:*******" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Push Data Example Source: https://github.com/sebastianganser/bitget_api/blob/main/contract/websocket/public/Order-Book-Channel.md This section details the structure of the push data received from the Bitget API, including response parameters and an example of a snapshot push. ```APIDOC ## Push Data ### Description This section details the structure of the push data received from the Bitget API, including response parameters and an example of a snapshot push. ### Method N/A (This is a push notification, not a request) ### Endpoint N/A (This is a push notification, not a request) ### Parameters #### Response Parameters - **event** (String) - Event type. - **arg** (Object) - Subscribed channels information. - **> instType** (String) - Product type (e.g., `USDT-FUTURES`, `COIN-FUTURES`, `USDC-FUTURES`). - **> channel** (String) - Channel name (e.g., `books/books1/books5/books15`). - **> instId** (String) - Product ID (e.g., `ETHUSDT`). - **msg** (String) - Error message (returned only on error). - **code** (String) - Error code (returned only on error). #### Push Parameters - **arg** (Object) - Channels with successful subscription. - **> instType** (String) - Product type (e.g., `USDT-FUTURES`, `COIN-FUTURES`, `USDC-FUTURES`). - **> channel** (String) - Channel name (e.g., `books/books1/books5/books15`). - **> instId** (String) - Product ID. - **action** (String) - Push data action (e.g., `snapshot`, incremental push data, or full volume push data). - **data** (List) - Subscription data. - **> asks** (List) - Seller depth (price, quantity). - **> bids** (List) - Buyer depth (price, quantity). - **> ts** (String) - Match engine timestamp (ms), e.g., `1597026383085`. - **> checksum** (Long) - Testing and validation checksum. - **> seq** (Long) - Sequence number. Increases when the order book is updated and can be used to determine whether there are out-of-order packets. - **ts** (String) - Data streaming time. ### Request Example N/A ### Response #### Success Response (Push Data Example) ```json { "action": "snapshot", "arg": { "instType": "USDT-FUTURES", "channel": "books5", "instId": "BTCUSDT" }, "data": [ { "asks": [ [ "27000.5", "8.760" ], [ "27001.0", "0.400" ] ], "bids": [ [ "27000.0", "2.710" ], [ "26999.5", "1.460" ] ], "checksum": 0, "seq": 123, "ts": "1695716059516" } ], "ts": 1695716059516 } ``` ``` -------------------------------- ### Get Merge Market Depth Request Example (cURL) Source: https://github.com/sebastianganser/bitget_api/blob/main/contract/market/Get-Merge-Depth.md Example of how to make an HTTP GET request to the Bitget API to fetch merged market depth data. This example specifies the product type and trading symbol. ```bash curl "https://api.bitget.com/api/v2/mix/market/merge-depth?productType=usdt-futures&symbol=BTCUSDT" ``` -------------------------------- ### Get Subaccount Withdrawal Records (cURL) Source: https://github.com/sebastianganser/bitget_api/blob/main/broker/subaccount/Subaccount-Withdrawal-Records.md Example of how to retrieve sub-account withdrawal records using a cURL command. This request requires authentication headers and can be filtered by start and end times. ```shell curl "https://api.bitget.com/api/v2/broker/subaccount-withdrawal?startTime=1700561435000&endTime=1703153435933" \ -H "ACCESS-KEY:your apiKey" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:zh-CN" \ -H "Content-Type: application/json" ``` -------------------------------- ### Batch Place Order Request Example (JSON) Source: https://github.com/sebastianganser/bitget_api/blob/main/uta/websocket/private/Batch-Place-Order-Channel.md This JSON object demonstrates the structure for a batch order placement request to the Bitget API. It specifies the operation, a unique identifier, the category (e.g., spot), the topic for batch placement, and an array of order arguments, each defining a single order with parameters like clientOid, orderType, price, quantity, side, symbol, and timeInForce. ```json { "op": "trade", "id": "1750035029506", "category": "spot", "topic": "batch-place", "args": [ { "clientOid": "xxxxxxxx", "orderType": "limit", "price": "100", "qty": "0.1", "side": "buy", "symbol": "BTCUSDT", "timeInForce": "gtc" }, { "clientOid": "xxxxxxxx", "orderType": "limit", "price": "100", "qty": "0.15", "side": "buy", "symbol": "BTCUSDT", "timeInForce": "gtc" } ] } ``` -------------------------------- ### Bitget API Push Data Example (JSON) Source: https://github.com/sebastianganser/bitget_api/blob/main/spot/websocket/public/Depth-Channel.md Example of data pushed from the Bitget API, typically representing order book updates or snapshots. It includes subscription arguments and the actual market data. ```json { "action": "snapshot", "arg": { "instType": "SPOT", "channel": "books5", "instId": "BTCUSDT" }, "data": [ { "asks": [ [ "26274.9", "0.0009" ], [ "26275.0", "0.0500" ] ], "bids": [ [ "26274.8", "0.0009" ], [ "26274.7", "0.0027" ] ], "checksum": 0, "seq": 123, "ts": "1695710946294" } ], "ts": 1695710946294 } ``` -------------------------------- ### Get Isolated Liquidation Orders (cURL) Source: https://github.com/sebastianganser/bitget_api/blob/main/margin/isolated/trade/Get-Isolated-Liquidation-Orders.md Example of how to retrieve isolated liquidation orders using a cURL command. This request requires authentication headers and specifies parameters like start time, end time, and limit for the query. The response includes order details and pagination information. ```curl curl "https://api.bitget.com/api/v2/margin/isolated/liquidation-order?startTime=1704100405000&endTime=1706174005091&limit=20" \ -H "ACCESS-KEY:*******" \ -H "ACCESS-SIGN:*******" \ -H "ACCESS-PASSPHRASE:*****" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Subscribe to Bitget API Channels Source: https://github.com/sebastianganser/bitget_api/blob/main/common/websocket-intro.md This snippet demonstrates how to subscribe to one or more channels on the Bitget API. It requires specifying the operation as 'subscribe' and providing a list of channel configurations in the 'args' array. Each channel configuration includes instrument type, channel name, and instrument ID. ```json { "op": "subscribe", "args": [ { "instType": "SPOT", "channel": "ticker", "instId": "BTCUSDT" }, { "instType": "SPOT", "channel": "candle5m", "instId": "BTCUSDT" } ] } ``` -------------------------------- ### Get Unified Account Tax Records (cURL) Source: https://github.com/sebastianganser/bitget_api/blob/main/uta/tax/Get-Tax-Records.md Example of how to retrieve unified account tax records using cURL. This request requires authentication headers and specifies the business type, start time, and end time for the query. The response includes transaction details, fees, and balances. ```shell curl "https://api.bitget.com/api/v3/tax/records?bizType=spot&startTime=1763402983000&endTime=1763662183573" \ -H "ACCESS-KEY:*******" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Get Deposit Records Request Example (cURL) Source: https://github.com/sebastianganser/bitget_api/blob/main/spot/account/Get-Deposit-Record.md This cURL command demonstrates how to request deposit records from the Bitget API. It includes necessary headers for authentication and parameters for filtering the records by coin, start time, end time, and limit. Ensure you replace placeholder values with your actual credentials and desired parameters. ```curl curl "https://api.bitget.com/api/v2/spot/wallet/deposit-records?coin=USDT&startTime=1659036670000&endTime=1659076670000&limit=20" \ -H "ACCESS-KEY:*******" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Place Plan Order using cURL Source: https://github.com/sebastianganser/bitget_api/blob/main/spot/plan/Place-Plan-Order.md This snippet demonstrates how to place a plan order using a cURL command. It includes the necessary headers for authentication and the JSON payload with order details. Ensure you replace placeholder values with your actual API credentials and order parameters. ```shell curl -X POST "https://api.bitget.com/api/v2/spot/trade/place-plan-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": "TRXUSDT", "side": "buy", "triggerPrice": 0.041572, "executePrice": "0.041572", "size": 151, "triggerType": "market_price", "orderType": "limit","clientOid": "12345"}' ``` -------------------------------- ### Create Subaccount Request Example (cURL) Source: https://github.com/sebastianganser/bitget_api/blob/main/broker/subaccount/Create-Subaccount.md Example of how to create a subaccount using a cURL request. This includes the necessary headers like ACCESS-KEY, ACCESS-SIGN, and the request body with subaccount details. ```curl curl -X POST "https://api.bitget.com/api/v2/broker/account/create-subaccount" \ -H "ACCESS-KEY:your apiKey" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:zh-CN" \ -H "Content-Type: application/json" \ -d '{"subaccountName": "subaccountName1","label": "remark"}' ``` -------------------------------- ### POST /api/v2/spot/trade/place-order Source: https://context7.com/sebastianganser/bitget_api/llms.txt Places a new spot trading order. ```APIDOC ## POST /api/v2/spot/trade/place-order ### Description Places a new spot trading order (buy or sell) with specified parameters such as symbol, order type, size, and price. Requires authentication. ### Method POST ### Endpoint /api/v2/spot/trade/place-order ### Parameters #### Request Body - **symbol** (string) - Required - The trading symbol (e.g., BTCUSDT). - **side** (string) - Required - The order side ('buy' or 'sell'). - **orderType** (string) - Required - The type of order ('limit', 'market', etc.). - **size** (string) - Required - The quantity of the base currency to trade. - **price** (string) - Optional - The price for limit orders. Not required for market orders. - **force** (string) - Optional - Order enforcement policy (e.g., 'gtc' for Good 'Til Cancelled). Defaults to 'gtc'. - **clientOid** (string) - Optional - A unique client-generated order ID for idempotency. ### Request Example ```json { "symbol": "BTCUSDT", "side": "buy", "orderType": "limit", "size": "0.001", "price": "35000", "force": "gtc", "clientOid": "order_1678886400000" } ``` ### Response #### Success Response (200) - **data** (object) - Contains details of the placed order. - **orderId** (string) - The unique identifier for the placed order. - **clientOid** (string) - The client-generated order ID, if provided. #### Response Example ```json { "code": "0", "msg": "success", "data": { "orderId": "1234567890", "clientOid": "order_1678886400000" } } ``` ``` -------------------------------- ### Place Order HTTP Request Example (cURL) Source: https://github.com/sebastianganser/bitget_api/blob/main/contract/trade/Place-Order.md This snippet demonstrates how to place an order using the Bitget API via a cURL command. It includes essential headers like ACCESS-KEY, ACCESS-SIGN, ACCESS-PASSPHRASE, ACCESS-TIMESTAMP, and Content-Type, along with the JSON payload specifying order details such as symbol, productType, marginMode, size, price, side, tradeSide, orderType, force, and clientOid. ```curl curl -X POST "https://api.bitget.com/api/v2/mix/order/place-order" \ -H "ACCESS-KEY:your apiKey" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:zh-CN" \ -H "Content-Type: application/json" \ -d '{ "symbol": "ETHUSDT", "productType": "USDT-FUTURES", "marginMode": "isolated", "marginCoin": "USDT", "size": "0.1", "price": "2000", "side": "sell", "tradeSide": "open", "orderType": "limit", "force": "gtc", "clientOid": "121211212122" }' ``` -------------------------------- ### Get Subaccount Email Request Example (cURL) Source: https://github.com/sebastianganser/bitget_api/blob/main/broker/subaccount/Get-Subaccount-Email.md Example of an HTTP GET request to retrieve a subaccount's email address from the Bitget API. Requires authentication headers and the subUid parameter. ```curl curl "https://api.bitget.com/api/v2/broker/account/subaccount-email?subUid=111111" \ -H "ACCESS-KEY:your apiKey" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:zh-CN" \ -H "Content-Type: application/json" ``` -------------------------------- ### Get Product Info using cURL Source: https://github.com/sebastianganser/bitget_api/blob/main/uta/loan/Get-Product-Infos.md Demonstrates how to fetch product information from the Bitget API using a cURL command. This requires authentication headers and specifies the 'productId' as a query parameter. ```bash curl "https://api.bitget.com/api/v3/ins-loan/product-infos?productId=xxxxxxxx" \ -H "ACCESS-KEY:*******" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Get Deposit Address Request Example (cURL) Source: https://github.com/sebastianganser/bitget_api/blob/main/spot/account/Get-Deposit-Address.md Example of an HTTP GET request to the Bitget API to retrieve a deposit address. It includes necessary headers for authentication and parameters for specifying the coin and chain. ```bash curl "https://api.bitget.com/api/v2/spot/wallet/deposit-address?coin=USDT&chain=trc20" \ -H "ACCESS-KEY:*******" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Place Strategy Order using cURL Source: https://github.com/sebastianganser/bitget_api/blob/main/uta/strategy/Place-Strategy-Order.md This snippet demonstrates how to place a strategy order using the cURL command-line tool. It includes the necessary endpoint, HTTP method, headers, and a sample JSON payload for the request body. Ensure you replace placeholder values with your actual API credentials and order details. ```curl curl -X POST "https://api.bitget.com/api/v3/trade/place-strategy-order" \ -H "ACCESS-KEY:your apiKey" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:zh-CN" \ -H "Content-Type: application/json" \ -d '{ "category": "usdt-futures","symbol": "BTCUSDT","posSide": "long","stopLoss": "99000","takeProfit": "100800","clientOid": "121211212122"}' ``` -------------------------------- ### Get Subaccount List Request Example (cURL) Source: https://github.com/sebastianganser/bitget_api/blob/main/broker/subaccount/Get-Subaccount-List.md This example demonstrates how to make an HTTP GET request to the Bitget API to retrieve a list of subaccounts. It includes necessary headers for authentication and content type. ```curl curl "https://api.bitget.com/api/v2/broker/account/subaccount-list" \ -H "ACCESS-KEY:your apiKey" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:zh-CN" \ -H "Content-Type: application/json" ``` -------------------------------- ### Order Channel Push Data Example (JSON) Source: https://github.com/sebastianganser/bitget_api/blob/main/spot/websocket/private/Order-Channel.md This JSON illustrates the push data format for order events received through the Bitget API's order channel. It includes details about order status, fills, and timestamps. ```json { "action": "snapshot", "arg": { "instType": "SPOT", "channel": "orders", "instId": "BTCUSDT" }, "data": [ { "instId": "BTCUSDT", "orderId": "1", "clientOid": "1", "size": "8.0000", "newSize": "500.0000", "notional": "8.000000", "orderType": "market", "force": "gtc", "side": "buy", "fillPrice": "26256.0", "tradeId": "1", "baseVolume": "0.0003", "fillTime": "1695797773286", "fillFee": "-0.00000018", "fillFeeCoin": "BTC", "tradeScope": "T", "accBaseVolume": "0.0003", "priceAvg": "26256.0", "status": "partially_filled", "cTime": "1695797773257", "uTime": "1695797773326", "stpMode": "cancel_taker", "feeDetail": [ { "feeCoin": "BTC", "fee": "-0.00000018" } ], "enterPointSource": "WEB" } ], "ts": 1695797773370 } ``` -------------------------------- ### Get Sub Deposit Records using cURL Source: https://github.com/sebastianganser/bitget_api/blob/main/uta/account/deposit/Get-Sub-Deposit-Records.md This snippet demonstrates how to make an HTTP POST request to the Bitget API to retrieve sub-account deposit records. It includes the endpoint, required headers for authentication and content type, and example query parameters for filtering by sub-account UID, start time, and end time. ```bash curl "https://api.bitget.com/api/v3/account/sub-deposit-records?subUid=4234324223&startTime=1700561435000&endTime=1703153435933" \ -H "ACCESS-KEY:*******" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ``` -------------------------------- ### Get History Orders Request Example (cURL) Source: https://github.com/sebastianganser/bitget_api/blob/main/spot/trade/Get-History-Orders.md This example demonstrates how to make a GET request to the Bitget API to retrieve historical orders. It includes necessary headers for authentication and parameters for filtering the order history. ```curl curl "https://api.bitget.com/api/v2/spot/trade/history-orders?symbol=BTCUSDT&startTime=1659036670000&endTime=1659076670000&limit=20" \ -H "ACCESS-KEY:*******" \ -H "ACCESS-SIGN:*" \ -H "ACCESS-PASSPHRASE:*" \ -H "ACCESS-TIMESTAMP:1659076670000" \ -H "locale:en-US" \ -H "Content-Type: application/json" ```