# Indices List

The API retrieves index data for major stock indices such as NIFTY, BANKNIFTY, FINNIFTY, SENSEX, and BANKEX. It provides key information about these indices, including their current values, percentage changes, and other relevant market data.

**Endpoint**

```
https://connects.torusdigital.com/api/v1/indices
```

**Request**

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

```javascript
curl -X 'GET' \
  'https://connects.torusdigital.com/api/v1/indices' \
  -H 'accept: application/json'
```

{% 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/indices")
  .header("Content-Type", "application/json")
  .asString();
```

{% endcode %}
{% endtab %}

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

```go
package main

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

func main() {
	url := "https://connects.torusdigital.com/api/v1/indices"
	method := "GET"

	client := &http.Client{}
	req, err := http.NewRequest(method, url, nil)

	if err != nil {
		fmt.Println(err)
		return
	}
	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" lineNumbers="true" %}

```javascript
var settings = {
  "url": "https://connects.torusdigital.com/api/v1/indices",
  "method": "GET",
  "timeout": 0,
  "headers": {
    "Content-Type": "application/json"
  },
};

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

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

**Response**

```json
[
  {
    "code": 20559,
    "exchange": "NSE",
    "name": "Nifty50",
    "price": 25383.75,
    "priceChange": 27.25,
    "changePercent": 0.10746751326089958
  },
  {
    "code": 26753,
    "exchange": "NSE",
    "name": "BankNifty",
    "price": 52153.15,
    "priceChange": 215.09999999999854,
    "changePercent": 0.41414723887400184
  },
  {
    "code": 41384,
    "exchange": "NSE",
    "name": "FINNifty",
    "price": 23989.85,
    "priceChange": 10.299999999999272,
    "changePercent": 0.0429532664291001
  },
  {
    "code": 20558,
    "exchange": "BSE",
    "name": "Sensex",
    "price": 82988.78,
    "priceChange": 97.83999999999651,
    "changePercent": 0.11803461270917727
  },
  {
    "code": 23998,
    "exchange": "BSE",
    "name": "BANKEX",
    "price": 58908.78,
    "priceChange": 179.22999999999593,
    "changePercent": 0.30471384399961077
  }
]
```

**Response Parameter**

<table><thead><tr><th width="164">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>code</td><td>Unique identifier for the index.</td></tr><tr><td>exchange</td><td>The stock exchange where the index is listed (e.g., "NSE", "BSE").</td></tr><tr><td>name</td><td>The name of the index (e.g., "Nifty50", "BankNifty").</td></tr><tr><td>price</td><td>The current value or price of the index.</td></tr><tr><td>priceChange</td><td>The absolute change in the index value compared to the previous close.</td></tr><tr><td>changePercent</td><td>The percentage change in the index value compared to the previous close.</td></tr></tbody></table>


---

# Agent Instructions: 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:

```
GET https://heytorus.gitbook.io/historical-data/indices-list.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
