Chilkat Online Tools

VB6 / Binance spot API / Compressed/Aggregate Trades List

Back to Collection Items

' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.

Dim http As New ChilkatHttp
Dim success As Long

Dim queryParams As New ChilkatJsonObject
success = queryParams.UpdateString("symbol","BNBUSDT")

http.SetRequestHeader "Content-Type","application/json"

Dim resp As ChilkatHttpResponse
Set resp = http.QuickRequestParams("GET","https://domain.com/api/v3/aggTrades",queryParams)
If (http.LastMethodSuccess = 0) Then
    Debug.Print http.LastErrorText
    Exit Sub
End If

Debug.Print resp.StatusCode
Debug.Print resp.BodyStr

Curl Command

curl -G -d "symbol=BNBUSDT"
	-H "Content-Type: application/json"
https://domain.com/api/v3/aggTrades

Postman Collection Item JSON

{
  "name": "Compressed/Aggregate Trades List",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Content-Type",
        "type": "text",
        "value": "application/json"
      }
    ],
    "url": {
      "raw": "{{url}}/api/v3/aggTrades?symbol=BNBUSDT",
      "host": [
        "{{url}}"
      ],
      "path": [
        "api",
        "v3",
        "aggTrades"
      ],
      "query": [
        {
          "key": "symbol",
          "value": "BNBUSDT",
          "description": "Trading symbol, e.g. BNBUSDT"
        },
        {
          "key": "fromId",
          "value": "",
          "description": "Trade id to fetch from. Default gets most recent trades.",
          "disabled": true
        },
        {
          "key": "startTime",
          "value": "",
          "description": "UTC timestamp in ms",
          "disabled": true
        },
        {
          "key": "endTime",
          "value": "",
          "description": "UTC timestamp in ms",
          "disabled": true
        },
        {
          "key": "limit",
          "value": "500",
          "description": "Default 500; max 1000.",
          "disabled": true
        }
      ]
    },
    "description": "Get compressed, aggregate trades. Trades that fill at the time, from the same order, with the same price will have the quantity aggregated.\n- If `startTime` and `endTime` are sent, time between startTime and endTime must be less than 1 hour.\n- If `fromId`, `startTime`, and `endTime` are not sent, the most recent aggregate trades will be returned.\n\nWeight(IP): 1"
  },
  "response": [
  ]
}