Query parameters

Query parameters are a set of key/value pairs (not case-sensitive):

NameParameterDescription
cmdcc=“command” - the type of command, see list below
msgTypemtmt=“message type” - either the string or numeric label of an SR Data Object class
pkeypkpk=“primary key” - a string representation of the primary key of a specific SR Data Object instance
limitll=“limit” - a number between 1 and 10,000 and acts to limit the number of messages in the response body
secretsecretsecret=“secret” - the client-supplied API Password (if any) [only used with getapikey]
viewvv=“view clause” - a string in the form of “field1 field2 field3”
whereww= “where clause” - a string in the form “field1:eq:value” or “(field1:ne:value1 & field1:ne:value2)
orderorder“(optional) order clause eg. (bidsize:DESC or bidexch:ASC or bidprice:DESC:ABS or askprice:ASC:ABS (default is unordered; default is faster)”

Commands

CommandDescriptionParameters
getapikeycreates/updates MLink API keysecret
getmsgtypesreturns all available message typesview, where
getschemareturns a single message schemamsgType, view
getmsgreturns a single message by PrimaryKeymsgType, pkey, view
getmsgsreturns all available messages for a message typemsgtype, pkey, limit, view, where, order
getaggregatereturns summarized or aggregated data based on specified criteriamsgtype, group, measure
getcountreturns the count of records for a message typemsgType, where

Comparison Symbols

“WHERE” clauses can contain the following comparison symbols:

  • :gt: is greater than
  • :ge: is greater than or equal to
  • :lt: is less than
  • :le: is less than or equal to
  • :eq: is equal
  • :ne: is not equal
  • %26 is an AND statement
  • | is an OR statement
  • :sw: is starts with
  • :ew: is ends with
  • :cv: is contains values
  • :nv: is does not contain value
  • :cb: is contained between (two dates for instance) separated by #

getAggregate

“getAggregate” takes in both group and measure with a msgType:

  • Group types can be the following; examples:

    • Numeric Quantile: { "cmd", "getaggregate" }, { "msgtype", "OptionNbboQuote" }, { "group", "bidprice:Q:9" }, { "measure", "bidprice" }

    • Numeric Range: { "cmd", "getaggregate" },{ "msgtype", "OptionNbboQuote" },{ "group", "bidprice:RANGE:3" }, { "measure", "bidprice" }

    • DateTimeRange: { "cmd", "getaggregate" }, { "msgtype", "OptionPrint" },{ "group", $"timestamp:TIMEHIST:3#STARTDATE#ENDDATE" },{ "measure", "prtprice" }

    • String Top N: { "cmd", "getaggregate" }, { "msgtype", "OptionNbboQuote" }, { "group", "bidexch:top:3" }, { "measure", "bidprice|askprice|bidsize|asksize" }

  • You can set measureTypes in group parameters such that: { "cmd", "getaggregate" }, { "msgtype", "OptionNbboQuote" }, { "group", "bidexch:top:3:asksize:max" }, { "measure", "bidprice|askprice|bidsize|asksize"}

Note that measureTypes can be of cnt, min, max, sum, avg