FII Activity Dataโ
API for retrieving Foreign Institutional Investor (FII) activity for a specified market segment and interval. It accepts the data type, interval, and an optional start date, and returns buy/sell amounts, contracts, open interest, and long/short position breakdowns across index futures, stock futures, and options segments. 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/fii?data_type=NSE_FO%7CSTOCK_FUTURES&data_type=NSE_FO%7CINDEX_OPTIONS&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. Accepts a single value or a comma-separated list. Full values listed 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 values โ pass one or more segments to retrieve activity data for each independently:
NSE_FO|INDEX_FUTURESNSE_FO|STOCK_FUTURESNSE_FO|INDEX_OPTIONSNSE_FO|STOCK_OPTIONSNSE_EQ|CASH
Responses
- 200
- 4XX
Response bodyโ
{
"status": "success",
"data": {
"NSE_FO|STOCK_FUTURES": [
{
"time_stamp": 1777487400000,
"buy_amount": 23109.75,
"sell_amount": 24642.52,
"buy_contracts": 353981,
"sell_contracts": 384079,
"oi_contracts": 7245154,
"oi_amount": 452650.0,
"total_long_contracts": 4021980,
"total_short_contracts": 3223174,
"total_call_long_contracts": 0,
"total_put_long_contracts": 0,
"total_call_short_contracts": 0,
"total_put_short_contracts": 0
},
{
"time_stamp": 1777401000000,
"buy_amount": 21593.35,
"sell_amount": 21252.58,
"buy_contracts": 327164,
"sell_contracts": 318686,
"oi_contracts": 7237618,
"oi_amount": 456065.1,
"total_long_contracts": 4033261,
"total_short_contracts": 3204357,
"total_call_long_contracts": 0,
"total_put_long_contracts": 0,
"total_call_short_contracts": 0,
"total_put_short_contracts": 0
}
],
"NSE_FO|INDEX_OPTIONS": [
{
"time_stamp": 1777487400000,
"buy_amount": 797967.36,
"sell_amount": 794438.53,
"buy_contracts": 5094129,
"sell_contracts": 5072195,
"oi_contracts": 1995796,
"oi_amount": 313760.14,
"total_long_contracts": 0,
"total_short_contracts": 0,
"total_call_long_contracts": 351772,
"total_put_long_contracts": 715640,
"total_call_short_contracts": 572110,
"total_put_short_contracts": 356275
},
{
"time_stamp": 1777401000000,
"buy_amount": 579943.55,
"sell_amount": 583822.61,
"buy_contracts": 3659192,
"sell_contracts": 3683793,
"oi_contracts": 1776287,
"oi_amount": 281482.39,
"total_long_contracts": 0,
"total_short_contracts": 0,
"total_call_long_contracts": 293574,
"total_put_long_contracts": 653116,
"total_call_short_contracts": 509632,
"total_put_short_contracts": 319965
}
]
}
}
| 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 FII 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 value is not one of the accepted segments. |
| 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 FII dataโ
- Curl
- Python
- Node.js
- Java
- PHP
curl --location 'https://api.upstox.com/v2/market/fii?data_type=NSE_FO%7CSTOCK_FUTURES&data_type=NSE_FO%7CINDEX_OPTIONS&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/fii'
params = [
('data_type', 'NSE_FO|STOCK_FUTURES'),
('data_type', 'NSE_FO|INDEX_OPTIONS'),
('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/fii';
const params = new URLSearchParams([
['data_type', 'NSE_FO|STOCK_FUTURES'],
['data_type', 'NSE_FO|INDEX_OPTIONS'],
['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/fii"
+ "?data_type=NSE_FO%7CSTOCK_FUTURES"
+ "&data_type=NSE_FO%7CINDEX_OPTIONS"
+ "&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
$query = http_build_query([
'data_type' => ['NSE_FO|STOCK_FUTURES', 'NSE_FO|INDEX_OPTIONS'],
'interval' => '1D',
], '', '&', PHP_QUERY_RFC3986);
$url = 'https://api.upstox.com/v2/market/fii?' . $query;
$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...