Chilkat Online Tools

VBScript / Binance spot API / 24hr Ticker Price Change Statistics

Back to Collection Items

Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set outFile = fso.CreateTextFile("output.txt", True)

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

set http = CreateObject("Chilkat_9_5_0.Http")

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

set sbResponseBody = CreateObject("Chilkat_9_5_0.StringBuilder")
success = http.QuickGetSb("https://domain.com/api/v3/ticker/24hr",sbResponseBody)
If (success = 0) Then
    outFile.WriteLine(http.LastErrorText)
    WScript.Quit
End If

outFile.WriteLine("Response status code = " & http.LastStatus)
outFile.WriteLine(sbResponseBody.GetAsString())

outFile.Close

Curl Command

curl -X GET
	-H "Content-Type: application/json"
https://domain.com/api/v3/ticker/24hr

Postman Collection Item JSON

{
  "name": "24hr Ticker Price Change Statistics",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Content-Type",
        "type": "text",
        "value": "application/json"
      }
    ],
    "url": {
      "raw": "{{url}}/api/v3/ticker/24hr",
      "host": [
        "{{url}}"
      ],
      "path": [
        "api",
        "v3",
        "ticker",
        "24hr"
      ],
      "query": [
        {
          "key": "symbol",
          "value": "BNBUSDT",
          "description": "Trading symbol, e.g. BNBUSDT",
          "disabled": true
        },
        {
          "key": "symbols",
          "value": "",
          "disabled": true
        },
        {
          "key": "type",
          "value": "BNBUSDT",
          "description": "Supported values: FULL or MINI.\nIf none provided, the default is FULL",
          "disabled": true
        }
      ]
    },
    "description": "24 hour rolling window price change statistics. Careful when accessing this with no symbol.\n\n- If the symbol is not sent, tickers for all symbols will be returned in an array.\n\nWeight(IP):\n- `1` for a single symbol;\n- `40` when the symbol parameter is omitted;"
  },
  "response": [
  ]
}