# Monthly/Yearly Returns

This API provides market return predictions for various time horizons: 1 month, 6 months, 1 year and 3 years. It returns forecasted values and percentage changes for these periods, helping users assess potential market trends and make informed investment decisions.

**Note:** `cocode` can be obtained from the Search Stock or Company Basic Detail API.

**Endpoint**

```
https://connects.torusdigital.com/api/v1/returns/{exchange}/{cocode}/{reportType}
```

**Request Parameter**

<table><thead><tr><th width="181">Name</th><th width="126">Mandatory</th><th>Description</th></tr></thead><tbody><tr><td>exchange</td><td>Y</td><td>The stock exchange for which the returns are being retrieved (e.g., "NSE", "BSE").</td></tr><tr><td>cocode</td><td>Y</td><td>The unique company code identifier.</td></tr><tr><td>reportType</td><td>Y</td><td>The type of report to retrieve. Report type (S - Single or C - Consolidated)</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/returns/{exchange}/{cocode}/{reportType}' \
  -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/returns/{exchange}/{cocode}/{reportType}")
  .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/returns/{exchange}/{cocode}/{reportType}"
	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/returns/{exchange}/{cocode}/{reportType}",
  "method": "GET",
  "timeout": 0,
  "headers": {
    "Content-Type": "application/json"
  },
};

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

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

**Response**

```json
{
  "1monthReturns": -0.44000733345555154,
  "6monthReturns": 3.5932920590326516,
  "1yearReturns": 27.61434766818348,
  "3yearReturns": 32.12901684597961
}
```

**Response Parameters**

<table><thead><tr><th width="174">Parameters</th><th>Description</th></tr></thead><tbody><tr><td>1monthReturns</td><td>Predicted percentage return for the next month.</td></tr><tr><td>6monthReturns</td><td>Predicted percentage return for the next 6 months.</td></tr><tr><td>1yearReturns</td><td>Predicted percentage return for the next year.</td></tr><tr><td>3yearReturns</td><td>Predicted percentage return for the next 3 years.</td></tr></tbody></table>
