DII Activity Dataโ
API for retrieving Domestic Institutional Investor (DII) activity data. It accepts the data type, interval, and an optional start date, and returns buy/sell amounts for domestic institutional flows in the equities market. Data is available from 1st April 2026 onwards.
- Daily (
1D) โ up to 30 trading days of data per request. - Monthly (
1M) โ up to 12 months of data per request (data collection started from 1st April 2026; the available range will grow as more months are recorded).
Requestโ
curl --location 'https://api.upstox.com/v2/market/dii?data_type=NSE_EQ%7CCASH&interval=1D' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'
For additional samples in various languages, please refer to the Sample code section on this page.
Query Parametersโ
| Name | Required | Description |
|---|---|---|
| data_type | true | Market segment. Only accepted value is NSE_EQ cash segment โ see full value below. |
| interval | true | Data interval. Accepted values: 1D (daily), 1M (monthly). |
| from | false | Start date for the data range in YYYY-MM-DD format. |
Accepted data_type value โ DII data is currently available only for the NSE equity cash segment:
NSE_EQ|CASH
Responses
- 200
- 4XX
Response bodyโ
{
"status": "success",
"data": {
"NSE_EQ|CASH": [
{
"time_stamp": 1746633600000,
"buy_amount": 8523456789.0,
"sell_amount": 7234567890.5,
"buy_contracts": 0,
"sell_contracts": 0,
"oi_contracts": 0,
"oi_amount": 0.0,
"total_long_contracts": 0,
"total_short_contracts": 0,
"total_call_long_contracts": 0,
"total_put_long_contracts": 0,
"total_call_short_contracts": 0,
"total_put_short_contracts": 0
}
]
}
}
| Name | Type | Description |
|---|---|---|
| status | string | Outcome of the request. Typically success for successful operations. |
| data | object | Map of data_type key to an array of DII activity records. |
| data[key][].time_stamp | integer | Unix timestamp of the record in milliseconds. |
| data[key][].buy_amount | number | Total buy value in INR. |
| data[key][].sell_amount | number | Total sell value in INR. |
| data[key][].buy_contracts | integer | Number of contracts bought. |
| data[key][].sell_contracts | integer | Number of contracts sold. |
| data[key][].oi_contracts | integer | Open interest in number of contracts. |
| data[key][].oi_amount | number | Open interest value in INR. |
| data[key][].total_long_contracts | integer | Total long contracts held. |
| data[key][].total_short_contracts | integer | Total short contracts held. |
| data[key][].total_call_long_contracts | integer | Total long call option contracts. |
| data[key][].total_put_long_contracts | integer | Total long put option contracts. |
| data[key][].total_call_short_contracts | integer | Total short call option contracts. |
| data[key][].total_put_short_contracts | integer | Total short put option contracts. |
Error codesโ
| Error code | Description |
|---|---|
| UDAPI1198 | Invalid data_type โ The data_type parameter is invalid. DII supports only the NSE equity cash segment. |
| UDAPI1199 | Invalid interval โ The interval value must be 1D or 1M. |
| UDAPI1200 | Invalid from date format โ The from parameter must be in YYYY-MM-DD format. |
Sample Codeโ
Get DII dataโ
- Curl
- Python
- Node.js
- Java
- PHP
curl --location 'https://api.upstox.com/v2/market/dii?data_type=NSE_EQ%7CCASH&interval=1D' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'
import requests
url = 'https://api.upstox.com/v2/market/dii'
params = {
'data_type': 'NSE_EQ|CASH',
'interval': '1D'
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {your_access_token}'
}
response = requests.get(url, params=params, headers=headers)
print(response.text)
const axios = require('axios');
const url = 'https://api.upstox.com/v2/market/dii';
const params = {
data_type: 'NSE_EQ|CASH',
interval: '1D'
};
const headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {your_access_token}'
};
axios.get(url, { params, headers })
.then(response => console.log(response.data))
.catch(error => console.error(error));
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://api.upstox.com/v2/market/dii"
+ "?data_type=NSE_EQ%7CCASH"
+ "&interval=1D";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.header("Authorization", "Bearer {your_access_token}")
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
<?php
$url = 'https://api.upstox.com/v2/market/dii?'
. http_build_query([
'data_type' => 'NSE_EQ|CASH',
'interval' => '1D',
]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Accept: application/json',
'Authorization: Bearer {your_access_token}',
]);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Curl error: ' . curl_error($ch);
}
curl_close($ch);
echo $response;
?>
Loading...