CQG WebAPI

WebAPI, our flagship API, is a data and trading enterprise API offered via an Application Service Provider (ASP) model. Implemented with cutting-edge technologies, it provides access to:

      Streaming Level 1 and Level 2 data.

      High-quality data servers for historical tick, intraday bar, and daily bar data.

      Unified exchange gateways for order execution, account summary, order history, and post-trade analysis.

Technology

The user interface is based on Google’s protocol buffers. For general information on how Google protocol buffers work, visit protobuf.dev.

WebAPI uses secure WebSockets technology for data delivery. More information can be found here:

      Wiki: WebSocket

      Wiki: TLS

Using Google protobufs and secure WebSockets eliminates the API’s dependency on development language. It also removes WebAPI-powered applications from operational environment usage for deployment.

Workflow

Customers connect to CQG’s distributed server architecture to pass the authorization process and access market data and order routing. After the successful connection, the API layer is then available for data and trade routing on all preconfigured accessible markets.

Protocol

Here is the primary reference for the interface. It includes extensive comments and explanations as well as specific documentation necessary to construct client messages and interpret server messages.

For demo environment: Download.

For production environment: Download.

Note: Demo environment receives protocol updates earlier.

Getting Access And Testing

You can access everything that is supported by the API’s protocol via CQG’s fully simulated environment.

We require a formal conformance test before any API-powered application can connect to our production environment.

The conformance testing document can be found here.

Connection Information:

 

Server

wss://demoapi.cqg.com

Port

443

PrivateLabel

WebAPITest

ClientID

WebAPITest

ClientVersion

(defined by user for versioning)

Contact apihelp@cqg.com or fill out and send the API Information Request Form to start the application.

Prototester

Prototester allows manually create and send WebAPI protobuf messages.

Basic API Example

If you are just getting started with the WebAPI, you may find it helpful to study the basic sample code packages below. Here you will find comments regarding special concepts necessary to working efficiently with the interface. Each sample module demonstrates all the necessary steps to accomplishing its basic function; e.g., all modules include the functions for connecting to the server and logging in with user credentials.

Note: these samples stop short of recommending best practices for error handling or memory management.

      Python basic samples

      JavaScript Algo samples