Protocol Usage
JSON
Standard JSON
Query:
https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json?apikey="your_api_key_token"&cmd=getmsg&msgtype=OptionNbboQuote&pkey=SPX-NMS-EQT-2024-03-15-4550-C
Response:
in case we want to show any error response
Framed JSON
SpiderRock JSON with protobuf-like header. The framing header is a fixed length (14 bytes) and in the form: \r\nJMMMMMLLLLLL, where J is the protocol [J = framed json, P = protobuf], MMMMM is the message number (zero padded), and LLLLLL is the message length (zero padded).
Query:
https://mlink-live.nms.saturn.spiderrockconnect.com/rest/jsonf?apikey="your_api_key"&cmd=getmsg&msgtype=OptionNbboQuote&pkey=SPX-NMS-EQT-2024-03-15-4550-C
Response:
Protobuf
Google’s mechanism for serializing structured data, generally more efficient for processing higher bandwidth, lower-latency applications. See compilation notes below for usages. See above Framed JSON for header information.
Query:
https://mlink-live.nms.saturn.spiderrockconnect.com/rest/proto?apikey="your_api_key"&cmd=getmsg&msgtype=OptionNbboQuote&pkey=SPX-NMS-EQT-2024-03-15-4550-C
Response:
Unlimited editors available under the Startup Plan
Compiling SR proto files
.proto
files exist in SRMLink/proto_files
- spiderrock_common.proto
- All Token .proto files for SpiderRock specific messages
Both of these files need to be compiled to use protobuf with MLink.
- To compile, first install the compiler, download the package and follow the instructions in the README.
- Then, run the compiler, specifying your application’s source directory (the current directory is used by default), the destination directory (where you want the generated code to go), and the path to your .proto file.
For python, using python_out:
In your specified destination, this will generate N .py files:
- spiderrock_common_pb2.py
- ”Specific message”_pb2.py