Chilkat Online Tools

C / Binance spot API / Compressed/Aggregate Trades List

Back to Collection Items

#include <C_CkHttp.h>
#include <C_CkJsonObject.h>
#include <C_CkHttpResponse.h>

void ChilkatSample(void)
    {
    HCkHttp http;
    BOOL success;
    HCkJsonObject queryParams;
    HCkHttpResponse resp;

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

    http = CkHttp_Create();

    queryParams = CkJsonObject_Create();
    CkJsonObject_UpdateString(queryParams,"symbol","BNBUSDT");

    CkHttp_SetRequestHeader(http,"Content-Type","application/json");

    resp = CkHttp_QuickRequestParams(http,"GET","https://domain.com/api/v3/aggTrades",queryParams);
    if (CkHttp_getLastMethodSuccess(http) == FALSE) {
        printf("%s\n",CkHttp_lastErrorText(http));
        CkHttp_Dispose(http);
        CkJsonObject_Dispose(queryParams);
        return;
    }

    printf("%d\n",CkHttpResponse_getStatusCode(resp));
    printf("%s\n",CkHttpResponse_bodyStr(resp));
    CkHttpResponse_Dispose(resp);


    CkHttp_Dispose(http);
    CkJsonObject_Dispose(queryParams);

    }

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": [
  ]
}