# Search Stock

The API searches for the desired stock by company name, NSE symbol, or BSE code. It returns details such as the company code, name, listed exchanges with their statuses, NSE symbol or BSE code, market capitalization, industry, and more.

**Endpoint**

```
https://connects.torusdigital.com/api/v1/stocks?query={query}&page=1&limit=10
```

#### **Request Parameter**

<table><thead><tr><th width="120">Name</th><th width="126">Mandatory</th><th>Description</th></tr></thead><tbody><tr><td>query</td><td>Y</td><td>Search query (company name, NSE symbol or BSE code)</td></tr><tr><td>page</td><td>N</td><td>Page number by default 1</td></tr><tr><td>limit</td><td>N</td><td>Result count per page default 10</td></tr></tbody></table>

**Request**

{% tabs %}
{% tab title="curl" %}
{% code title="cURL" overflow="wrap" lineNumbers="true" %}
```javascript
curl -X 'GET' \
  'https://connects.torusdigital.com/api/v1/stocks?query=<query>&page=1&limit=10' \
  -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/stocks?query=<query>&page=1&limit=10")
  .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/stocks?query=<query>&page=1&limit=10"
	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/stocks?query=<query>&page=1&limit=10",
  "method": "GET",
  "timeout": 0,
  "headers": {
    "Content-Type": "application/json"
  },
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
```
{% endcode %}
{% endtab %}
{% endtabs %}

**Response**

```json
[
  {
    "type": "STK",
    "co_code": 5400,
    "bsecode": "532540",
    "nsesymbol": "TCS",
    "companyname": "Tata Consultancy Services Ltd",
    "companyshortname": "TCS",
    "categoryname": "Company",
    "isin": "INE467B01029",
    "bsegroup": "A",
    "mcap": 1632553.45,
    "mcaptype": "Large Cap",
    "displaytype": "SOFTWARE",
    "sectorcode": "00000034",
    "sectorname": "IT - Software",
    "industrycode": "00000072",
    "industryname": "Computers - Software - Large",
    "bselistedflag": "Y",
    "nselistedflag": "Y",
    "BSEStatus": "Active",
    "NSEStatus": "Active"
  }
]
```

**Response Parameters**

<table><thead><tr><th width="220">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>type</td><td>Type of security (e.g., "STK" for stock).</td></tr><tr><td>co_code</td><td>Unique company code identifier.</td></tr><tr><td>bsecode</td><td>BSE (Bombay Stock Exchange) code for the company.</td></tr><tr><td>nsesymbol</td><td>NSE (National Stock Exchange) symbol for the company.</td></tr><tr><td>companyname</td><td>Full name of the company.</td></tr><tr><td>companyshortname</td><td>Shortened name of the company.</td></tr><tr><td>categoryname</td><td>Category name indicating the type of entity (e.g., "Company").</td></tr><tr><td>isin</td><td>International Securities Identification Number (ISIN) for the company's stock.</td></tr><tr><td>bsegroup</td><td>Group classification on the BSE (e.g., "A" group).</td></tr><tr><td>mcap</td><td>Market capitalization of the company in crores (or appropriate unit).</td></tr><tr><td>mcaptype</td><td>Market capitalization classification (e.g., "Large Cap", "Mid Cap").</td></tr><tr><td>displaytype</td><td>Type of industry or sector (e.g., "SOFTWARE").</td></tr><tr><td>sectorcode</td><td>Unique sector code identifying the sector the company belongs to.</td></tr><tr><td>sectorname</td><td>Name of the sector (e.g., "IT - Software").</td></tr><tr><td>industrycode</td><td>Unique code for the industry to which the company belongs.</td></tr><tr><td>industryname</td><td>Name of the industry (e.g., "Computers - Software - Large").</td></tr><tr><td>bselistedflag</td><td>Flag indicating if the company is listed on BSE ("Y" for yes, "N" for no).</td></tr><tr><td>nselistedflag</td><td>Flag indicating if the company is listed on NSE ("Y" for yes, "N" for no).</td></tr><tr><td>BSEStatus</td><td>Status of the company's listing on BSE (e.g., "Active").</td></tr><tr><td>NSEStatus</td><td>Status of the company's listing on NSE (e.g., "Active").</td></tr></tbody></table>
