DataFlex / Binance spot API / Rolling window price change statistics
Back to Collection Items
Use ChilkatAx-win32.pkg
Procedure Test
Handle hoHttp
Boolean iSuccess
Variant vSbResponseBody
Handle hoSbResponseBody
String sTemp1
Integer iTemp1
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Get Create (RefClass(cComChilkatHttp)) To hoHttp
If (Not(IsComObjectCreated(hoHttp))) Begin
Send CreateComObject of hoHttp
End
Send ComSetRequestHeader To hoHttp "Content-Type" "application/json"
Get Create (RefClass(cComChilkatStringBuilder)) To hoSbResponseBody
If (Not(IsComObjectCreated(hoSbResponseBody))) Begin
Send CreateComObject of hoSbResponseBody
End
Get pvComObject of hoSbResponseBody to vSbResponseBody
Get ComQuickGetSb Of hoHttp "https://domain.com/api/v3/ticker" vSbResponseBody To iSuccess
If (iSuccess = False) Begin
Get ComLastErrorText Of hoHttp To sTemp1
Showln sTemp1
Procedure_Return
End
Get ComLastStatus Of hoHttp To iTemp1
Showln "Response status code = " iTemp1
Get ComGetAsString Of hoSbResponseBody To sTemp1
Showln sTemp1
End_Procedure
Curl Command
curl -X GET
-H "Content-Type: application/json"
https://domain.com/api/v3/ticker
Postman Collection Item JSON
{
"name": "Rolling window price change statistics",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"url": {
"raw": "{{url}}/api/v3/ticker",
"host": [
"{{url}}"
],
"path": [
"api",
"v3",
"ticker"
],
"query": [
{
"key": "symbol",
"value": "BNBUSDT",
"description": "Trading symbol, e.g. BNBUSDT",
"disabled": true
},
{
"key": "symbols",
"value": "",
"description": "Either symbol or symbols must be provided\nExamples of accepted format for the symbols parameter: [\"BTCUSDT\",\"BNBUSDT\"] or %5B%22BTCUSDT%22,%22BNBUSDT%22%5D.\n\nThe maximum number of symbols allowed in a request is 100.",
"disabled": true
},
{
"key": "windowSize",
"value": "",
"description": "Defaults to 1d if no parameter provided.\nSupported windowSize values:\n1m,2m....59m for minutes\n1h, 2h....23h - for hours\n1d...7d - for days.\n\nUnits cannot be combined (e.g. 1d2h is not allowed)",
"disabled": true
},
{
"key": "type",
"value": "",
"description": "Supported values: FULL or MINI.\nIf none provided, the default is FULL",
"disabled": true
}
]
},
"description": "The window used to compute statistics is typically slightly wider than requested windowSize.\n\nopenTime for /api/v3/ticker always starts on a minute, while the closeTime is the current time of the request. As such, the effective window might be up to 1 minute wider than requested.\n\nE.g. If the closeTime is 1641287867099 (January 04, 2022 09:17:47:099 UTC) , and the windowSize is 1d. the openTime will be: 1641201420000 (January 3, 2022, 09:17:00 UTC)\n\nWeight(IP): 2 for each requested symbol regardless of windowSize.\n\nThe weight for this request will cap at 100 once the number of symbols in the request is more than 50."
},
"response": [
]
}