Skip to main content
Version: Upcoming

Schema: OptionPositionRecordV5 (ID: 4805)

OptionPositionRecords are live risk records that contain start-of-day positions and all subsequent executions, including executions reported as done away.

These records are published by a CoreRiskServer and represent the position and risk markup detail for a single option series.

New records are published immediately when a position changes and about once per minute if no position has changed.

Note that all records for a single underlier are published simultaneously and records for the same chain should have consistent marks.

METADATA

AttributeValue
Topic4740-risk-v5
MLink TokenClientRisk
SRSE ProductSRRisk

Note: The symbol = next to a field number indicates that it is a primary key.

BODY

#FieldTypeDefault ValueComment
10=okeyOptionKeyends with '$n' if an MH allocation fraction (n = 1-N) [MMH segment number]
11=accntstring(16)
12=tradeDateDateKey
13=riskSessionenum : RiskSessionRegular
14=clientFirmstring(16)SR assigned client firm
100riskServerCodestring(6)
103aggGroupstring(16)SR assigned agg group
106fkeyExpiryKeyunderlying future (if written on a future)
109tickerTickerKeyunderlying ticker
112exTypeenum : ExerciseType
115multihedgeenum : Multihedge
118multihedgeSourceTickerKeyMH Ticker Key (starts with '_') (if exists)
121multihedgePVRatiofloatpv multiplier (fraction of underlier value (uPerCn x uPrc) / SUM(uPerCn x uPrc) associated with this fragment
124optionTypeenum : OptionType
127cashOnExfloatcash on settlement (multihedge)
130strikeRatiofloatstrike ratio
133uPrcRatiofloatstock price multiplier
136underliersPerCnintunderliers per contract
139underlierTypeenum : UnderlierTypetype of underlier (affects $greek calculations)
142tickValuefloat$NLV value of a single tick change in display premium (pointValue = tickValue / tickSize)
145pointValuefloat$NLV value of a single point change in display premium (pointValue = tickValue / tickSize)
148pointCurrencyenum : Currency
151priceFormatenum : PriceFormatoption price display format code
154uPriceFormatenum : PriceFormatunderlier price display format code
157uPrcdoublecurrent underlier price (any market session) (persists if market closed/halted)
161spotUPrcdoublecurrent underlier spot price
163uBiddoublecurrent underlier bid (any market session) (zero if market closed/halted)
166uAskdoublecurrent underlier ask (any market session) (zero if market closed/halted)
167uMarkdoublecurrent underlier mark (usually mid market) (freezes at SR CloseMarkTime)
169uMarkSourceenum : UMarkSource
172optBidfloatcurrent option market bid (any market session) (zero if market closed/halted)
175optAskfloatcurrent option market ask (any market session) (zero if market closed/halted)
181optMidMarkdoublecurrent option mark (mid market) (freezes at SR CloseMarkTime)
184optVolMarkdoublecurrent option mark (volatility surface) (freezes at SR CloseMarkTime)
187uOpnMarkdoublestart-of-day SR underlier mark (rotated from prior day record) [corp action adjusted]
190optOpnVolMarkdoublestart-of-day SR vol mark [corp action adjusted]
193optOpnMidMarkdoublestart-of-day SR mid mark [corp action adjusted]
196optOpnClrMarkdoublestart-of-day clearing mark [should be corp action adjusted]
199optOpnPosPrvintstart-of-day SR contract position (rotated from prior day record) [corp action adjusted]
202optOpnPosClrintstart-of-day CKR contract position (supplied by client/clearing firm via clearing position load) [should be corp action adjusted]
204optOpnPosintstart of period contract position (effective; can be from either CLR or SR)
205optOpnPosSrcenum : PositionSourcestart of period position source
208cnBotintnumber of contracts bot today
211cnSldintnumber of contracts sld today
217cnOpenedintnumber of contracts opened today
220cnClosedintnumber of contracts closed today
607cnPendCmplBotintnumber of contracts bot today (but pending completion)
608cnPendCmplSldintnumber of contracts sld today (but pending completion)
222edgeOpenedfloatedge from opening trades (model #1)
223edgeClosedfloatedge from closing trades (model #1)
229trdDeltafloatdeltas from trades (fixed at the time of trade)
232trdGammafloatgamma from trades (fixed at the time of trade)
235trdDeltaMnyfloatdeltas x uPrc from trades (fixed at the time of trade)
237optMnyBotdoublesum of settle cash for all buy executions
238optMnySlddoublesum of settle cash for all sell executions
241dayPnlfloat
244dnDayPnlfloat
247opnPnlMidMarkfloat
250opnPnlVolMarkfloat
253opnPnlClrMarkfloat
256cnNetOpnPosintopening position (cnOpnPos) net of reversals/conversions
259cnNetCurPosintcurrent position (cnOpnPos + cnBot - cnSld) net of reversals/conversions
262cnAtmEquivfloatcurrent position (atm equivalent contracts: (cnNetPos * ve / atmVega)
265betafloatbeta (usually beta to SPX; see AccountConfig.betaSource)
268betaSourceenum : BetaSource
271divDaysshortdays to the next dividend (0 = exDate is today, -1 = exDate is yesterday)
274hedgeDeltaRuleenum : HedgeDeltaRuleHedgeDelta Source (IVol = use SR implied surface (sticky strike), IvS = use SR surface (sticky delta), TVol = use user supplied theo surface (sticky strike), TvS = use user supplied theo surface and atm veSlope (sticky delta)) [AccountConfig.hedgeDelta]
277binaryDaysfloathedgeDelta = -1.0,-0.5,0,+0.5,+1.0 if less than binary days to expiration;usually [0.0 - 2.0]
280daysshortdays to expiration
283yearsfloatyears to expiration
286ratefloatglobal rate to expiration (pricing)
289sdivfloatcontinuous stock div (pricing)
292ddivfloatpresent value of discrete dividends (pricing)
295dadjfloatdadj frational dividend value; 1.0 except for some multihedge roots
298atmVolfloatlive surface atm volatility
301atmVegafloatlive surface atm vega
304smnyfloatoption moneyness
307iVolfloatsurface volatility
310iVolSrcenum : MarkSource
311kAdjfloatadjusted strike
313defloatdelta;(dOpx / dUPrc)
316gafloatgamma;(dDelta / dUPrc)
319thfloattheta;(dOpx / dTime)
322vefloatvega;(dOpx / dVol)
325vofloatvolga (SR surface)
328vafloatvanna (SR surface)
331rhfloatrho;(dOpx / dRate)
334phfloatphi;(dOpx / dSDiv)
337deDecayfloatdelta decay, charm, delta bleed; (dDelta/dTime)
340errbytecomputation error code (if any)
343veSlopefloativol correlation (veSlope = dVol / dUPrc) [can be either SR surface veSlope or client theo veSlope]
346hedgeDefloathedge delta (either ivol or tvol based;follows binary rules)
349hedgeGafloathedge gamma (either ivol or tvol based;follows binary rules)
352srSlopefloativol correlation (srSlope = dVol / dUPrc) [always SR surface veSlope]
355isBinaryenum : YesNohedge delta/gamma has switched to 'binary'
358premOvParfloatpremium over parity for the option position
361xdefloatxdelta (C: +0.5 - de, P: -0.5 - de)
364loBoundfloatminimum no-arb opx (zero volatility given sdiv/ddiv/years/rate)
367su90floatunderlier up 90%, sticky delta
370sd90floatunderlier dn 90%, sticky delta
373su50floatunderlier up 50%, sticky delta
376sd50floatunderlier dn 50%, sticky delta
379su15floatunderlier up 15%, sticky delta
382sd15floatunderlier dn 15%, sticky delta
385su10floatunderlier up 10%, sticky delta
388sd10floatunderlier dn 10%, sticky delta
391su06floatunderlier up 6%, sticky delta
394sd08floatunderlier dn 8%, sticky delta
397su05floatunderlier up 5%, sticky delta
400sd05floatunderlier dn 5%, sticky delta
403su1efloatunderlier up 1x implied earn move, vol ramp out, delta-neutral
406sd1efloatunderlier dn 1x implied earn move, vol ramp out, delta-neutral
409su2efloatunderlier up 2x implied earn move, vol ramp out, delta-neutral
412sd2efloatunderlier dn 2x implied earn move, vol ramp out, delta-neutral
415earnfloatvol earn ramp out (no underlier move)
418cashfloatunderlier up 30%, vol = 0.10, 6mn deal close
421theoModelstring(16)theo model #1
424tVolfloattheo volatility
427tOpxfloattheo price
430tBOpnPxfloattheo buy/open price
433tSOpnPxfloattheo sell/open price
436tBClsPxfloattheo buy/close price
439tSClsPxfloattheo sell/close price
442tDefloattheo delta
445tGafloattheo gamma
448tErrbytetheo vol error code (TheoError)
451theoModel2string(16)theo model #2 (used for edge markup)
454tVol2floattheo volatility (model #2)
457tOpx2floattheo price (model #2)
460tErr2bytetheo vol error code (model #2)
463yearsPrfloat
466ratePrfloat
469sdivPrfloat
472ddivPrfloat
475iVolPrfloatprior period surface volatility
476kAdjPrfloatprior period (adjusted) strike
478dePrfloat
481gaPrfloat
484thPrfloat
487vePrfloat
490rhPrfloat
493phPrfloat
496voPrfloat
499vaPrfloat
502errPrbyteprior period computation error code (if any)
505veSlopePrfloatprior period veSlope
508hedgeDePrfloatprior period hedge delta
511tVolPrfloatprior period theo volatility (theoModel)
514tOpxPrfloatprior period theo price
517tDePrfloatprior period theo delta
520tVolPr2floatprior period theo volatility (theoModel#2)
523tOpxPr2floatprior period theo price
526tDePr2floatprior period theo delta
529xdePrfloat
532marginUDnVDnfloatAggregate RiskSlide: uPrc dn, vol dn
535marginUDnVUpfloatAggregate RiskSlide: uPrc dn, vol up
538marginUUpVDnfloatAggregate RiskSlide: uPrc up, vol dn
541marginUUpVUpfloatAggregate RiskSlide: uPrc up, vol up
544opnPnlDefloatopen position * mult * hedgeDe * dUPrc
547opnPnlGafloatopen position * mult * 0.5 * optGamma * dUPrc * dUPrc
550opnPnlThfloatopen position * mult * optTheta * dTime
553opnPnlVefloatopen position * mult * optVega * dVol
556opnPnlVofloatopen position * mult * 0.5 * optVolga * dVol * dVol
559opnPnlVafloatopen position * mult * optVanna * dVol * dUPrc
562opnPnlSlfloatopen position * mult * vol/uPrc * slope * optVega * dUPrc
565opnPnlRatefloatopen position * mult * optRho * dRate
568opnPnlSDivfloatopen position * mult * optPhi * dSDv
571opnPnlDDivfloatopen position * mult * optPhi * dDDv
574opnPnlSvfloatopen position * mult * (SR Vol Pnl - opnPnlDe)
577opnPnlErrfloatunattributed pnl: SR Vol Pnl - opnPnlDe - opnPnlGa - opnPnlTh - opnPnlVe - opnPnlRat - opnPnlSDiv - opnPnlDDiv
580shBotC0inthypothetical shares bot (~1/minute intervals)
583shSldC0inthypothetical shares sld
586shMnyC0floathypothetical money
589shBotC1inthypothetical shares bot (~10/minute intervals)
592shSldC1inthypothetical shares sld
595shMnyC1floathypothetical money
598markErrCodesflag : MarkErrorCode
601exValuefloatearly exercise value (amLimit - bsPrice)
604riskAlertenum : AlertCode
609numExecutionsintnumber of included SpdrParentExecution records
610maxExecDttmDateTimemaximum activity dttm of execution records included in this option risk summary
613timestampDateTime

Get Schema API Call

import requests 

# Replace with your desired MLINK URL
MLINK_PROD_URL = 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json'

# Replace with your MLINK API Key
API_KEY = 'XXXX-XXXX-XXXX-XXXX'

# Replace with your desired MsgType.
MSG_TYPE = 'OptionPositionRecordV5'

# Request Parameters for Get Schema Of The MsgType
params = {
# Required Parameters
"apiKey": API_KEY,
"cmd": 'getschema',
"msgType": MSG_TYPE,
}

response = requests.get(MLINK_PROD_URL, params=params)

Get Msg API Call

import requests 

# Replace with your desired MLINK URL
MLINK_PROD_URL = 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json'

# Replace with your MLINK API Key
API_KEY = 'XXXX-XXXX-XXXX-XXXX'

# Replace with your desired MsgType.
MSG_TYPE = 'OptionPositionRecordV5'

# Replace with your pkey value for getting the specific message desired
PKEY = 'ReplaceThisValueForTheQueryToWork'

# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned.
VIEW = 'riskServerCode|aggGroup|fkey|ticker|exType|multihedge|multihedgeSource|multihedgePVRatio|optionType|cashOnEx|strikeRatio|uPrcRatio|underliersPerCn|underlierType|tickValue|pointValue|pointCurrency|priceFormat|uPriceFormat|uPrc|spotUPrc|uBid|uAsk|uMark|uMarkSource|optBid|optAsk|optMidMark|optVolMark|uOpnMark|optOpnVolMark|optOpnMidMark|optOpnClrMark|optOpnPosPrv|optOpnPosClr|optOpnPos|optOpnPosSrc|cnBot|cnSld|cnOpened|cnClosed|cnPendCmplBot|cnPendCmplSld|edgeOpened|edgeClosed|trdDelta|trdGamma|trdDeltaMny|optMnyBot|optMnySld|dayPnl|dnDayPnl|opnPnlMidMark|opnPnlVolMark|opnPnlClrMark|cnNetOpnPos|cnNetCurPos|cnAtmEquiv|beta|betaSource|divDays|hedgeDeltaRule|binaryDays|days|years|rate|sdiv|ddiv|dadj|atmVol|atmVega|smny|iVol|iVolSrc|kAdj|de|ga|th|ve|vo|va|rh|ph|deDecay|err|veSlope|hedgeDe|hedgeGa|srSlope|isBinary|premOvPar|xde|loBound|su90|sd90|su50|sd50|su15|sd15|su10|sd10|su06|sd08|su05|sd05|su1e|sd1e|su2e|sd2e|earn|cash|theoModel|tVol|tOpx|tBOpnPx|tSOpnPx|tBClsPx|tSClsPx|tDe|tGa|tErr|theoModel2|tVol2|tOpx2|tErr2|yearsPr|ratePr|sdivPr|ddivPr|iVolPr|kAdjPr|dePr|gaPr|thPr|vePr|rhPr|phPr|voPr|vaPr|errPr|veSlopePr|hedgeDePr|tVolPr|tOpxPr|tDePr|tVolPr2|tOpxPr2|tDePr2|xdePr|marginUDnVDn|marginUDnVUp|marginUUpVDn|marginUUpVUp|opnPnlDe|opnPnlGa|opnPnlTh|opnPnlVe|opnPnlVo|opnPnlVa|opnPnlSl|opnPnlRate|opnPnlSDiv|opnPnlDDiv|opnPnlSv|opnPnlErr|shBotC0|shSldC0|shMnyC0|shBotC1|shSldC1|shMnyC1|markErrCodes|exValue|riskAlert|numExecutions|maxExecDttm|timestamp'

# Replace with your desired where clause.
# a string in the form "field1:eq:valuse" or "(field1:ne:value1 & field1:ne:value2)
# "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 '$'
WHERE = 'accnt:eq:ExampleString'

# Request Parameters for getmsg Of The MsgType
params = {
# Required Parameters
"apiKey": API_KEY,
"cmd": 'getmsg',
"pkey": PKEY,
"msgType": MSG_TYPE,
# Optional Parameters
"view": VIEW,
"where": WHERE
}

response = requests.get(MLINK_PROD_URL, params=params)

Get Msgs API Call

import requests 

# Replace with your desired MLINK URL
MLINK_PROD_URL = 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json'

# Replace with your MLINK API Key
API_KEY = 'XXXX-XXXX-XXXX-XXXX'

# Replace with your desired MsgType.
MSG_TYPE = 'OptionPositionRecordV5'

# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned
VIEW = 'riskServerCode|aggGroup|fkey|ticker|exType|multihedge|multihedgeSource|multihedgePVRatio|optionType|cashOnEx|strikeRatio|uPrcRatio|underliersPerCn|underlierType|tickValue|pointValue|pointCurrency|priceFormat|uPriceFormat|uPrc|spotUPrc|uBid|uAsk|uMark|uMarkSource|optBid|optAsk|optMidMark|optVolMark|uOpnMark|optOpnVolMark|optOpnMidMark|optOpnClrMark|optOpnPosPrv|optOpnPosClr|optOpnPos|optOpnPosSrc|cnBot|cnSld|cnOpened|cnClosed|cnPendCmplBot|cnPendCmplSld|edgeOpened|edgeClosed|trdDelta|trdGamma|trdDeltaMny|optMnyBot|optMnySld|dayPnl|dnDayPnl|opnPnlMidMark|opnPnlVolMark|opnPnlClrMark|cnNetOpnPos|cnNetCurPos|cnAtmEquiv|beta|betaSource|divDays|hedgeDeltaRule|binaryDays|days|years|rate|sdiv|ddiv|dadj|atmVol|atmVega|smny|iVol|iVolSrc|kAdj|de|ga|th|ve|vo|va|rh|ph|deDecay|err|veSlope|hedgeDe|hedgeGa|srSlope|isBinary|premOvPar|xde|loBound|su90|sd90|su50|sd50|su15|sd15|su10|sd10|su06|sd08|su05|sd05|su1e|sd1e|su2e|sd2e|earn|cash|theoModel|tVol|tOpx|tBOpnPx|tSOpnPx|tBClsPx|tSClsPx|tDe|tGa|tErr|theoModel2|tVol2|tOpx2|tErr2|yearsPr|ratePr|sdivPr|ddivPr|iVolPr|kAdjPr|dePr|gaPr|thPr|vePr|rhPr|phPr|voPr|vaPr|errPr|veSlopePr|hedgeDePr|tVolPr|tOpxPr|tDePr|tVolPr2|tOpxPr2|tDePr2|xdePr|marginUDnVDn|marginUDnVUp|marginUUpVDn|marginUUpVUp|opnPnlDe|opnPnlGa|opnPnlTh|opnPnlVe|opnPnlVo|opnPnlVa|opnPnlSl|opnPnlRate|opnPnlSDiv|opnPnlDDiv|opnPnlSv|opnPnlErr|shBotC0|shSldC0|shMnyC0|shBotC1|shSldC1|shMnyC1|markErrCodes|exValue|riskAlert|numExecutions|maxExecDttm|timestamp'

# Replace with your desired where clause.
# a string in the form "field1:eq:value" or "(field1:ne:value1 & field1:ne:value2)
# "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 '$'
WHERE = 'accnt:eq:ExampleString'

# Replace with your desired limit of how many messages you receive. The default limit is 500
LIMIT = 500

# Order clause eg. "(field1:DESC | field1:ASC | field2:DESC:ABS | field2:ASC:ABS" (default is unordered; default is faster)
ORDER = 'riskServerCode:ASC'

# Request Parameters for getmsgs Of The MsgType
params = {
# Required Parameters
"apiKey": API_KEY,
"cmd": 'getmsgs',
"msgType": MSG_TYPE,
# Optional Parameters
"view": VIEW,
"where": WHERE,
"limit": LIMIT,
"order": ORDER
}

response = requests.get(MLINK_PROD_URL, params=params)

Get Aggregate API Call

import requests 

# Replace with your desired MLINK URL
MLINK_PROD_URL = 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json'

# Replace with your MLINK API Key
API_KEY = 'XXXX-XXXX-XXXX-XXXX'

# Replace with your desired MsgType.
MSG_TYPE = 'OptionPositionRecordV5'

# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'riskServerCode|aggGroup|fkey|ticker|exType|multihedge|multihedgeSource|multihedgePVRatio|optionType|cashOnEx|strikeRatio|uPrcRatio|underliersPerCn|underlierType|tickValue|pointValue|pointCurrency|priceFormat|uPriceFormat|uPrc|spotUPrc|uBid|uAsk|uMark|uMarkSource|optBid|optAsk|optMidMark|optVolMark|uOpnMark|optOpnVolMark|optOpnMidMark|optOpnClrMark|optOpnPosPrv|optOpnPosClr|optOpnPos|optOpnPosSrc|cnBot|cnSld|cnOpened|cnClosed|cnPendCmplBot|cnPendCmplSld|edgeOpened|edgeClosed|trdDelta|trdGamma|trdDeltaMny|optMnyBot|optMnySld|dayPnl|dnDayPnl|opnPnlMidMark|opnPnlVolMark|opnPnlClrMark|cnNetOpnPos|cnNetCurPos|cnAtmEquiv|beta|betaSource|divDays|hedgeDeltaRule|binaryDays|days|years|rate|sdiv|ddiv|dadj|atmVol|atmVega|smny|iVol|iVolSrc|kAdj|de|ga|th|ve|vo|va|rh|ph|deDecay|err|veSlope|hedgeDe|hedgeGa|srSlope|isBinary|premOvPar|xde|loBound|su90|sd90|su50|sd50|su15|sd15|su10|sd10|su06|sd08|su05|sd05|su1e|sd1e|su2e|sd2e|earn|cash|theoModel|tVol|tOpx|tBOpnPx|tSOpnPx|tBClsPx|tSClsPx|tDe|tGa|tErr|theoModel2|tVol2|tOpx2|tErr2|yearsPr|ratePr|sdivPr|ddivPr|iVolPr|kAdjPr|dePr|gaPr|thPr|vePr|rhPr|phPr|voPr|vaPr|errPr|veSlopePr|hedgeDePr|tVolPr|tOpxPr|tDePr|tVolPr2|tOpxPr2|tDePr2|xdePr|marginUDnVDn|marginUDnVUp|marginUUpVDn|marginUUpVUp|opnPnlDe|opnPnlGa|opnPnlTh|opnPnlVe|opnPnlVo|opnPnlVa|opnPnlSl|opnPnlRate|opnPnlSDiv|opnPnlDDiv|opnPnlSv|opnPnlErr|shBotC0|shSldC0|shMnyC0|shBotC1|shSldC1|shMnyC1|markErrCodes|exValue|riskAlert|numExecutions|maxExecDttm|timestamp'

# Replace with fields you want to see aggregated. A "|" separated list of fields should be provided
GROUP = 'exType|multihedge|optionType|underlierType|pointCurrency|priceFormat|uPriceFormat|uMarkSource|optOpnPosSrc|betaSource|hedgeDeltaRule|iVolSrc|isBinary|riskAlert'

# Replace with your desired where clause.
# a string in the form "field1:eq:value" or "(field1:ne:value1 & field1:ne:value2)
# "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 '$'
WHERE = 'accnt:eq:ExampleString'

# Request Parameters for getaggregate Of The MsgType
params = {
# Required Parameters
"apiKey": API_KEY,
"cmd": 'getaggregate',
"msgType": MSG_TYPE,
"measure": MEASURE,
"group": GROUP,
# Optional Parameters
"where": WHERE,
}

response = requests.get(MLINK_PROD_URL, params=params)

Get Count API Call

import requests 

# Replace with your desired MLINK URL
MLINK_PROD_URL = 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json'

# Replace with your MLINK API Key
API_KEY = 'XXXX-XXXX-XXXX-XXXX'

# Replace with your desired MsgType.
MSG_TYPE = 'OptionPositionRecordV5'

# Replace with your desired where clause.
# a string in the form "field1:eq:value" or "(field1:ne:value1 & field1:ne:value2)
# "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 '$'
WHERE = 'accnt:eq:ExampleString'

# Request Parameters for getCount Of The MsgType
params = {
# Required Parameters
"apiKey": API_KEY,
"cmd": 'getcount',
"msgType": MSG_TYPE,
# Optional Parameters
"where": WHERE,
}

response = requests.get(MLINK_PROD_URL, params=params)