> ## Documentation Index
> Fetch the complete documentation index at: https://gb.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# REST Examples

#### Obtain your session Key (first needs UserName, PassWord, and MFA):

```
https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json?
cmd=logon&user=USERNAME&pw=PASSWORD&pin=MFA_CODE
```

#### Get all messages available:

```
https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json?
apikey="your_api_key_token"&cmd=getmsgtypes
```

#### Get field definitions for a message:

```
https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json?
apikey="your_api_key_token"&cmd=getschema&msgtype=OptionNbboQuote
```

#### Filtering for an Option Key:

```
https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json?
apikey="your_api_key_token"&cmd=getmsgs&msgtype=OptionNbboQuote&
where=okey:eq:SPX-NMS-EQT-2024-03-15-4550-C
```

#### Filtering for a Ticker Key:

```
https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json?
apikey="your_api_key_token"&cmd=getmsgs&msgtype=StockBookQuote&
where=ticker:eq:AAPL-NMS-EQT
```

or

```
https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json?
apikey="your_api_key_token"&cmd=getmsgs&msgtype=OptionNbboQuote&
where=okey.tk:eq:AAPL
```

#### Filtering by a View:

```
https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json?
apikey="your_api_key_token"&cmd=getmsgs&msgtype=OptionNbboQuote&
view=okey|bidprice|askprice
```

#### Complex filtering:

```
https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json?
apikey="your_api_key_token"&cmd=getmsgs&msgtype=OptionNbboQuote&
where=(bidsize:eq:1%26asksize:eq:1)|(bidsize:eq:10%26asksize:eq:1)&
view=okey|bidprice|askprice|asksize|bidsize
```

#### Complex Primary Keys:

```
https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json?
apikey="your_api_key_token"&cmd=getmsg&msgtype=LiveSurfaceCurve&
pkey=AAPL-NMS-EQT-2023-12-01|Live
```

Note that in this example the pkey is a repeater with en Expiry Key + SurfaceType
Simple getAggregate:

```
https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json?
apikey="your_api_key_token"&cmd=getaggregate&msgtype=OptionNbboQuote&
measure=bidprice|askprice|bidsize|asksize
```

#### GetAggregate by Bid Exchange:

```
https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json?
apikey="your_api_key_token"getaggregate&msgtype=OptionNbboQuote&
group=bidexch&measure=bidprice|askprice|bidsize|asksize
```

#### GetAggregate by Bid Exchange Top3:

```
https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json?
apikey="your_api_key_token"&cmd=getaggregate&msgtype=OptionNbboQuote&
group=bidexch:top:3&measure=bidprice|askprice|bidsize|asksize
```

#### GetAggregate by bidPrice Range:

```
https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json?
apikey="your_api_key_token"&cmd=getaggregate&msgtype=OptionNbboQuote&
group=bidprice:RANGE:3&measure=bidprice
```

#### GetAggregate complex:

```
https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json?
apikey="your_api_key_token"&cmd=getaggregate&msgtype=OptionPrint&
group=timestamp:TRANGE:3&measure=prtsize&
where=timestamp:cb:value1#value2
```
