Subscribes/Unsubscribes to futures trade 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:trades:cme",
{
"symbol": "ETHK3"
}
]
}
Param | Type | Description |
---|---|---|
symbol | string | The asset instrument. |
Response
{
"jsonrpc": "2.0",
"method": "subscription",
"params": {
"subscription": "b5tyryvt3br9pe3bieehz96hvqyzxnmyqk5r9w9hnhx1rigl0s2wtmrqjnla87vx",
"result": {
"exchange": "CME",
"symbol": "ETHK3",
"exchangeTimestamp": 1683119217913,
"exchangeTimestampNanoseconds": 175727,
"receivedTimestamp": 1683119218018,
"receivedTimestampNanoseconds": 464,
"sentTime": "null",
"tradeSummary": {
"aggressorSide": "1",
"mdTradeEntryId": "1733858",
"tradePrice": "185000",
"tradeQty": "1",
"tradeOrderCount": "2",
"tradeUpdateAction": "NEW",
"orderQty": {
"orderId": "2",
"lastOrdQty": "1"
}
},
"instrument": {
"definitionSource": "E",
"exchangeMic": "XCME",
"id": "7245",
"marketSegmentId": "74",
"periodCode": "202305",
"productCode": "ETH",
"productGroup": "FUT",
"productType": "EZ",
"symbol": "ETHK3",
"putOrCall": "",
"strikePrice": "",
"underlyingSymbol": ""
}
}
}
}
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:trades:cme", { "symbol": "ETHK3" } ],
id: 1,
}));
});
ws.on('message', data => {
console.log(JSON.stringify(JSON.parse(data), null, 2));
});