Back to Collection Items
LOCAL loHttp
LOCAL lnSuccess
LOCAL loQueryParams
LOCAL loResp
* This example assumes the Chilkat API to have been previously unlocked.
* See Global Unlock Sample for sample code.
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Http')
loHttp = CreateObject('Chilkat.Http')
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.JsonObject')
loQueryParams = CreateObject('Chilkat.JsonObject')
loQueryParams.UpdateString("pair","")
loQueryParams.UpdateString("contractType","ALL")
loQueryParams.UpdateString("period","5m")
loHttp.SetRequestHeader("Content-Type","application/json")
loResp = loHttp.QuickRequestParams("GET","https://domain.com/futures/data/openInterestHist",loQueryParams)
IF (loHttp.LastMethodSuccess = 0) THEN
? loHttp.LastErrorText
RELEASE loHttp
RELEASE loQueryParams
CANCEL
ENDIF
? STR(loResp.StatusCode)
? loResp.BodyStr
RELEASE loResp
RELEASE loHttp
RELEASE loQueryParams
Curl Command
curl -G -d "pair="
-d "contractType=ALL"
-d "period=5m"
-H "Content-Type: application/json"
https://domain.com/futures/data/openInterestHist
Postman Collection Item JSON
{
"name": "Open Interest Statistics",
"request": {
"method": "GET",
"header": [
{
"key": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"url": {
"raw": "{{url}}/futures/data/openInterestHist?pair=&contractType=ALL&period=5m",
"host": [
"{{url}}"
],
"path": [
"futures",
"data",
"openInterestHist"
],
"query": [
{
"key": "pair",
"value": ""
},
{
"key": "contractType",
"value": "ALL",
"description": "ALL,CURRENT_QUARTER,NEXT_QUARTER"
},
{
"key": "period",
"value": "5m",
"description": "\"5m\",\"15m\",\"30m\",\"1h\",\"2h\",\"4h\",\"6h\",\"12h\",\"1d\""
},
{
"key": "limit",
"value": "",
"description": "Default 30,Max 500",
"disabled": true
},
{
"key": "startTime",
"value": "",
"disabled": true
},
{
"key": "endTime",
"value": "",
"disabled": true
}
]
},
"description": "Get present open interest of a specific symbol."
},
"response": [
]
}