# Company Basic Detail

This API retrieves detailed stock information for a company by its name. It returns the company's BSE and NSE symbols, market capitalization type, industry, and stock price details, including the latest closing price, percentage change, and price difference for both BSE and NSE exchanges.

**Note:** Pass `companySlug` from Search Stock API.

**Endpoint:**

```
https://connects.torusdigital.com/api/v1/stocks/{companySlug}
```

#### **Request Parameter**

<table><thead><tr><th width="181">Name</th><th width="130">Mandatory</th><th>Description</th></tr></thead><tbody><tr><td>companySlug</td><td>Y</td><td>The name of the companySlug for which the stock information is being retrieved.</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/{companySlug}' \
  -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/{companySlug}")
  .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/{companySlug}"
	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/{companySlug}",
  "method": "GET",
  "timeout": 0,
  "headers": {
    "Content-Type": "application/json"
  },
};

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

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

**Response**

```json
{
  "bseSymbol": "532540",
  "cocode": 5400,
  "companyName": "Tata Consultancy Services Ltd",
  "date": "2024-09-16T15:38:39",
  "exchanges": [
    "BSE",
    "NSE"
  ],
  "industryName": "Computers - Software - Large",
  "isin": "INE467B01029",
  "mcapType": "Large Cap",
  "nseSymbol": "TCS",
  "price": {
    "BSE": {
      "changePer": -0.2045441981314611,
      "close": 4513,
      "diff": -9.25
    },
    "NSE": {
      "changePer": -0.20673948613630133,
      "close": 4513.25,
      "diff": -9.350000000000364
    }
  }
}
```

**Response Parameters**

<table><thead><tr><th width="246">Parameter</th><th>Description</th></tr></thead><tbody><tr><td>bseSymbol</td><td>The BSE symbol of the company.</td></tr><tr><td>cocode</td><td>Unique identifier for the company.</td></tr><tr><td>companyName</td><td>Full name of the company.</td></tr><tr><td>date</td><td>The date and time of the stock information retrieval in ISO 8601 format.</td></tr><tr><td>exchanges</td><td>The stock exchanges where the company is listed (e.g., BSE, NSE).</td></tr><tr><td>industryName</td><td>The industry to which the company belongs.</td></tr><tr><td>isin</td><td>The International Securities Identification Number (ISIN) for the company’s stock.</td></tr><tr><td>mcapType</td><td>Market capitalization classification (e.g., "Large Cap").</td></tr><tr><td>nseSymbol</td><td>The NSE symbol of the company.</td></tr><tr><td>price</td><td>Contains the latest stock price information for both BSE and NSE exchanges or either one if listed.</td></tr><tr><td>Exchange (NSE or BSE)</td><td>Contains price change based on exchange</td></tr><tr><td>changePer</td><td>The percentage change in the stock price on NSE/BSE.</td></tr><tr><td>close</td><td> The closing price of the stock on NSE/BSE.</td></tr><tr><td>diff</td><td>The difference between the current and previous prices on NSE/BSE.</td></tr></tbody></table>
