> For the complete documentation index, see [llms.txt](https://heytorus.gitbook.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://heytorus.gitbook.io/market/market-status.md).

# 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>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://heytorus.gitbook.io/market/market-status.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
