Subscribes/Unsubscribes to futures tickers 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:futures:tickers:cme",
{
"symbol": "METK3"
}
]
}
Param | Type | Description |
---|---|---|
symbol | string | The asset instrument. |
Response
{
"jsonrpc": "2.0",
"method": "subscription",
"params": {
"subscription": "bx30tx7s1o6wmykuae7kn3gn09b8jjysioy41l5302fp7fwfejwlh2r8fn90ctaq",
"result": {
"exchange": "CME",
"symbol": "METK3",
"exchangeTimestamp": 1683119093401,
"exchangeTimestampNanoseconds": 100089,
"receivedTimestamp": 1683119093451,
"receivedTimestampNanoseconds": 0,
"sentTime": "2023-05-03T13:04:53.401190064Z",
"tradingStatus": "ReadyToTrade",
"instrument": {
"definitionSource": "E",
"exchangeMic": "XCME",
"id": "6321",
"marketSegmentId": "74",
"periodCode": "202305",
"productCode": "MET",
"productGroup": "EZ",
"productType": "FUT",
"symbol": "METK3",
"putOrCall": "",
"strikePrice": "",
"underlyingSymbol": ""
},
"askLevel": [
{
"lastUpdateTime": "2023-05-03T13:04:53.401100089Z",
"orderCnt": 4,
"price": "185150",
"qty": 31
}
],
"bidLevel": [
{
"lastUpdateTime": "2023-05-03T13:04:53.401100089Z",
"orderCnt": 4,
"price": "185000",
"qty": 45
}
]
}
}
}
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:tickers:cme", { "symbol": "METK3" } ],
id: 1,
}));
});
ws.on('message', data => {
console.log(JSON.stringify(JSON.parse(data), null, 2));
});