Subscribes/Unsubscribes to futures open interest data for CME.
Make sure you're connected to this subscription: wss://ws.web3api.io/cme. You must specify the instrument symbol.
CME Authorization
You must have a valid license directly with CME to consume CME data via Amberdata's Websockets. Please contact your Amberdata Account Executive if you have any questions.
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "subscribe",
"params": [
"market:futures:open_interest:cme",
{
"symbol": "METH4"
}
]
}
Param | Type | Description |
---|---|---|
symbol | string | The asset instrument. |
Response
{
"jsonrpc": "2.0",
"method": "subscription",
"params": {
"subscription": "bx30tx7s1o6wmykuae7kn3gn09b8jjysioy41l5302fp7fwfejwlh2r8fn90ctaq",
"result": {
"exchange": "CME",
"symbol": "METH4",
"exchangeTimestamp": "1683077259286",
"exchangeTimestampNanoseconds": "129153",
"receivedTimestamp": "1683077259460",
"receivedTimestampNanoseconds": "295",
"sentTime": "null",
"tradeStatistics": {
"settlementPrice": "null",
"settlementPriceDate": "null",
"settlementPriceTimestamp": "null",
"settlementFinal": "null",
"settlementActual": "null",
"settlementRounded": "null",
"openInterest": "null",
"openInterestDate": "null",
"openInterestTimestamp": "null",
"clearedVolume": "0",
"clearedVolumeDate": "2023-05-02",
"clearedVolumeTimestamp": "2023-05-03T01:27:39.286129153Z"
},
"instrument": {
"definitionSource": "E",
"exchangeMic": "XCME",
"id": "53075",
"marketSegmentId": "74",
"periodCode": "202403",
"productCode": "MET",
"productGroup": "EZ",
"productType": "FUT",
"symbol": "METH4"
}
}
}
}
Example
const WebSocket = require('ws');
const ws = new WebSocket('wss://ws.web3api.io/cme', {headers: {x-api-key:'<api_key>'}});
ws.on('open', () => {
ws.send(JSON.stringify({
jsonrpc: '2.0',
method: 'subscribe',
params : [ "market:futures:open_interest:cme", { "symbol": "METH4" } ],
id: 1,
}));
});
ws.on('message', data => {
console.log(JSON.stringify(JSON.parse(data), null, 2));
});