Subscribes/Unsubscribes to options 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 connect with your Amberdata Account Executive if you have any questions.
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "subscribe",
"params": [
"market:options:tickers:cme",
{
"symbol": "W2AK3 C29750"
}
]
}
Param | Type | Description |
---|---|---|
symbol | string | The asset instrument. |
Response
{
"jsonrpc": "2.0",
"method": "subscription",
"params": {
"subscription": "4r062vndbef0b4prtt7q40jszi2riz7zxlrtwt37gxnvedr1svsnzkhup2hvvtr6",
"result": {
"exchange": "CME",
"symbol": "W2AK3 C29750",
"exchangeTimestamp": 1683119627555,
"exchangeTimestampNanoseconds": 590879,
"receivedTimestamp": 1683119627617,
"receivedTimestampNanoseconds": 748,
"sentTime": "2023-05-03T13:13:47.555677767Z",
"tradingStatus": "ReadyToTrade",
"instrument": {
"definitionSource": "E",
"exchangeMic": "XCME",
"id": "525633",
"marketSegmentId": "74",
"periodCode": "202305",
"productCode": "W2A",
"productGroup": "B1",
"productType": "OOF",
"symbol": "W2AK3 C29750",
"putOrCall": "Call",
"strikePrice": "29750000000000",
"underlyingSymbol": "MBTK3"
},
"askLevel": [
{
"lastUpdateTime": "2023-05-03T13:13:47.555590879Z",
"orderCnt": 1,
"price": "270",
"qty": 134
}
],
"bidLevel": [
{
"lastUpdateTime": "2023-05-03T13:13:47.555590879Z",
"orderCnt": 1,
"price": "235",
"qty": 100
}
]
}
}
}
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:options:tickers:cme", { "symbol": "W2AK3 C29750" } ],
id: 1,
}));
});
ws.on('message', data => {
console.log(JSON.stringify(JSON.parse(data), null, 2));
});