A few contracts streaming together?

How does one request multiple contracts together?

{“symbol”: “ABC”}
{“symbol”: “EFG”}

does not seem to work.
Also is there a mapping between contractID and name? (ES == 2345678)
Thanks.

You’d have to send multiple getChart requests from the Market Data socket you are connected to. One for each contract. Then you’d need to filter the responses, most likely by contractId, or realtimeId from the getChart response.

Yes, there is a mapping between contractId and name. You can use /contract/find?name=ABCx1 or /contract/item?id=2345678 based on what information you have. You can use /product/find?name=ABC to get the product information for a given symbol as well.

The method I’ve described assumes you use the REST API to make those requests, but you could adapt those requests to our websocket protocol quite easily (eg. contract/find\n8\nname=ABCx1). You can read about the websocket request protocol here.