# Market Status

The Market Status API endpoint retrieves the current status of various market types and segments for specified exchanges, providing detailed information about their operational state. This ensures clients can track and respond to market conditions in real-time.

**Endpoint**

{% code title="Base URL" overflow="wrap" fullWidth="false" %}

```
https://connects.torusdigital.com/api/v1/market/status
```

{% endcode %}

#### Header Parameters <a href="#header-parameters" id="header-parameters"></a>

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

#### **Request Parameter**

<table><thead><tr><th width="122">Name</th><th width="94">Value</th><th width="157">Mandatory</th><th>Description</th></tr></thead><tbody><tr><td>source</td><td>N</td><td>Y</td><td>Source of the request (e.g., "N")</td></tr></tbody></table>

#### **Request**

{% tabs %}
{% tab title="curl" %}
{% code title="cURL" overflow="wrap" %}

```javascript
curl --location 'https://connects.torusdigital.com/api/v1/market/status' \
--header 'Authorization: Bearer {{token}}' \
--header 'Content-Type: application/json' \
--data '{
    "source": "N"
}'
```

{% endcode %}
{% endtab %}

{% tab title="Java" %}
{% code title="Java-Unirest" fullWidth="false" %}

```java
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.post("https://connects.torusdigital.com/api/v1/market/status")
  .header("Authorization", "Bearer {{token}}")
  .header("Content-Type", "application/json")
  .body("{\n    \"source\": \"N\"\n}")
  .asString();
```

{% endcode %}
{% endtab %}

{% tab title="Go" %}
{% code title="Go-Native" overflow="wrap" fullWidth="true" %}

```go
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "https://connects.torusdigital.com/api/v1/market/status"
  method := "POST"
  payload := strings.NewReader(`{
    "source": "N"
  }`)

  client := &http.Client{}
  req, err := http.NewRequest(method, url, payload)
  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Authorization", "Bearer {{token}}")
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

{% endcode %}
{% endtab %}

{% tab title="JavaScript" %}
{% code title="JavaScript-jQuery" overflow="wrap" %}

```javascript
var settings = {
  "url": "https://connects.torusdigital.com/api/v1/market/status",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": "Bearer {{token}}",
    "Content-Type": "application/json"
  },
  "data": JSON.stringify({
    "source": "N"
  }),
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
```

{% endcode %}
{% endtab %}
{% endtabs %}

**Response**

{% tabs %}
{% tab title="200" %}
{% code overflow="wrap" lineNumbers="true" fullWidth="true" %}

```json
{
    "status": "success",
    "message": "Success",
    "data": [
        {
            "EMM_MKT_TYPE_NO": "2",
            "EMM_STATUS": "OPEN",
            "EMM_EXM_EXCH_ID": "BSE",
            "MARKET_TYPE": "OL",
            "EMM_MKT_DESCRIPTION": "AUCTION",
            "EMM_EXCH_SEG": "C"
        },
        {
            "EMM_MKT_TYPE_NO": "3",
            "EMM_STATUS": "CLOSE",
            "EMM_EXM_EXCH_ID": "NSE",
            "MARKET_TYPE": "SP",
            "EMM_MKT_DESCRIPTION": "SPOT",
            "EMM_EXCH_SEG": "E"
        }
    ]
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

&#x20;   **Response Parameter**

<table><thead><tr><th width="359">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>MARKET_TYPE</td><td>Market type, which can be NL (Normal), OL (Odd Lot), SP (Spot), AU (Auction), A1 (Auction 1), A2 (Auction 2), MS (Morning Session), ES (Evening Session), or SS (Special Session)</td></tr><tr><td>EMM_MARKET_TYPE_NO</td><td>Corresponding code for Market_type.</td></tr><tr><td>EMM_EXM_EXCH_ID</td><td>Exchange ID where the market operates (NSE, BSE,)</td></tr><tr><td>EMM_EXCH_SEG</td><td>Segment of the exchange (Equity, Currency, Mutual Funds, Derivatives)</td></tr><tr><td>EMM_STATUS</td><td>Current status of the market, which can be OPEN, CLOSE, PREOPEN, or POSTCLOSE</td></tr></tbody></table>
