Skip to content
Skip to Content
DalalOSdocs

Recipe

Money flow monitor

Follow what foreign and domestic institutions did in the market, by sector, and in F&O. What you may do with the data is set by the terms.

What you will build

A page with the market-wide FII and DII flow, the sector split, the futures and options positions by participant, and the large deals in one company.

Before you start

  • An API key on a plan that includes the REST API. Create one on the keys page of your dashboard and set it as DALALOS_API_KEY.
  • Credits: each call costs credits from your plan. The limits say how many calls a run makes. Plans and credits are on Plans, credits and errors.
  • A date window.
  • One company for the large-deals step.

Step 1: Market-wide FII/DII flow

Read the daily net buying or selling of FIIs and DIIs in the cash market (ordinary buying and selling of shares, apart from F&O), across the whole market. Use from and to to set the dates. Each entry in results has a trade_date, fii_net and dii_net (with the buying and selling figures behind them). Amounts are in rupees crore.

GET /market-fii-dii-flow has the parameters, the errors and a box to send the call.

Market-wide FII/DII flow
curl -H "Authorization: Bearer $DALALOS_API_KEY" "https://mcp.dalalos.in/v1/market-fii-dii-flow?from=2026-11-01&to=2026-11-26"
{
  "status": "success",
  "data": {
    "from": "2026-11-01",
    "to": "2026-11-26",
    "segment": "cash",
    "count": 18,
    "results": [
      {
        "trade_date": "2026-11-02",
        "segment": "cash",
        "fii_buy": 16499.46,
        "fii_sell": 13384.78,
        "fii_net": 3114.68,
        "dii_buy": 14988.48,
        "dii_sell": 15380.68,
        "dii_net": -392.2,
        "source": "nse"
      },
      {
        "trade_date": "2026-11-03",
        "segment": "cash",
        "fii_buy": 20970.51,
        "fii_sell": 14133.7,
        "fii_net": 6836.81,
        "dii_buy": 16723.91,
        "dii_sell": 20402.76,
        "dii_net": -3678.85,
        "source": "nse"
      }
    ]
  },
  "cached_at": "2026-11-26T14:52:01+00:00",
  "source": "nse",
  "stale": false,
  "error": null,
  "reason_code": null,
  "data_age_seconds": 86750.174,
  "as_of": "2026-11-26"
}

Saved answer. Run on 2026-11-27, answered 200. Lists show their first item in full; the other items and long text are shortened. A call you make now gets the current answer.

Step 2: Sector-wise FPI investment (NSDL)

Read FPI (foreign portfolio investor, the registered name for an FII) investment by sector, from both depositories, published fortnightly. Use this for the sector view: it covers more than the daily sector route. Each entry in results has a period_end, a sector and net_inr_cr.

GET /fpi/sectors has the parameters, the errors and a box to send the call.

Sector-wise FPI investment (NSDL)
curl -H "Authorization: Bearer $DALALOS_API_KEY" "https://mcp.dalalos.in/v1/fpi/sectors?from=2026-08-01&instrument=equity"
{
  "status": "success",
  "data": {
    "from": "2026-08-01",
    "to": "2026-11-27",
    "sector": null,
    "instrument": "equity",
    "count": 175,
    "latest_period_end": "2026-11-15",
    "periods": [
      {
        "period_start": "2026-08-01",
        "period_end": "2026-08-15",
        "taxonomy": "bse_common",
        "discrepancies": []
      },
      {
        "period_start": "2026-08-16",
        "period_end": "2026-08-31",
        "taxonomy": "bse_common",
        "discrepancies": []
      }
    ],
    "coverage_note": "Sourced from NSDL's Fortnightly Sector-wise FPI Investment data, which covers every FPI across both depositories (NSDL and CDSL). Figures are as NSDL publish…",
    "results": [
      {
        "period_start": "2026-08-01",
        "period_end": "2026-08-15",
        "taxonomy": "bse_common",
        "sector": "Financial Services",
        "row_kind": "sector",
        "parent_sector": null,
        "instrument": "equity",
        "net_inr_cr": 6535,
        "net_usd_mn": 685,
        "auc_inr_cr": 2108866,
        "auc_usd_mn": 220994
      },
      {
        "period_start": "2026-08-01",
        "period_end": "2026-08-15",
        "taxonomy": "bse_common",
        "sector": "Automobile and Auto Components",
        "row_kind": "sector",
        "parent_sector": null,
        "instrument": "equity",
        "net_inr_cr": 4405,
        "net_usd_mn": 462,
        "auc_inr_cr": 557414,
        "auc_usd_mn": 58413
      }
    ]
  },
  "cached_at": "2026-11-18T15:03:02+00:00",
  "source": "nsdl",
  "stale": false,
  "error": null,
  "reason_code": null,
  "data_age_seconds": 777266.941,
  "as_of": "2026-11-15"
}

Saved answer. Run on 2026-11-27, answered 200. The data in it was collected on 2026-11-18, not on the run date. Lists show their first item in full; the other items and long text are shortened. A call you make now gets the current answer.

Step 3: F&O participant-wise OI/volume

Read the futures and options positions of each kind of participant, such as FIIs and DIIs. Use days for the window. Each entry in results has a trade_date, a client_type, and its volume and oi (open interest).

GET /fo-participant-activity has the parameters, the errors and a box to send the call.

F&O participant-wise OI/volume
curl -H "Authorization: Bearer $DALALOS_API_KEY" "https://mcp.dalalos.in/v1/fo-participant-activity?days=30"
{
  "status": "success",
  "data": {
    "days": 30,
    "count": 105,
    "results": [
      {
        "trade_date": "2026-11-26",
        "client_type": "TOTAL",
        "volume": {
          "fut_idx_long": 85986,
          "fut_idx_short": 85986,
          "fut_stk_long": 1003123,
          "fut_stk_short": 1003123,
          "opt_idx_call_long": 32882419,
          "opt_idx_put_long": 30120571,
          "opt_idx_call_short": 32882419,
          "opt_idx_put_short": 30120571,
          "opt_stk_call_long": 3294485,
          "opt_stk_put_long": 1681568,
          "opt_stk_call_short": 3294485,
          "opt_stk_put_short": 1681568,
          "total_long": 69068152,
          "total_short": 69068152
        },
        "oi": {
          "fut_idx_long": 278305,
          "fut_idx_short": 278305,
          "fut_stk_long": 7413005,
          "fut_stk_short": 7413005,
          "opt_idx_call_long": 4329396,
          "opt_idx_put_long": 4638142,
          "opt_idx_call_short": 4329396,
          "opt_idx_put_short": 4638142,
          "opt_stk_call_long": 2210129,
          "opt_stk_put_long": 1490947,
          "opt_stk_call_short": 2210129,
          "opt_stk_put_short": 1490947,
          "total_long": 20359924,
          "total_short": 20359924
        }
      },
      {
        "trade_date": "2026-11-26",
        "client_type": "Pro",
        "volume": {
          "fut_idx_long": 26276,
          "fut_idx_short": 19941,
          "fut_stk_long": 311911,
          "fut_stk_short": 325984,
          "opt_idx_call_long": 15548142,
          "opt_idx_put_long": 14431696,
          "opt_idx_call_short": 15544788,
          "opt_idx_put_short": 14358264,
          "opt_stk_call_long": 2037000,
          "opt_stk_put_long": 1166156,
          "opt_stk_call_short": 2020894,
          "opt_stk_put_short": 1154932,
          "total_long": 33521181,
          "total_short": 33424803
        },
        "oi": {
          "fut_idx_long": 35510,
          "fut_idx_short": 28838,
          "fut_stk_long": 652953,
          "fut_stk_short": 357327,
          "opt_idx_call_long": 855079,
          "opt_idx_put_long": 1055678,
          "opt_idx_call_short": 804342,
          "opt_idx_put_short": 868162,
          "opt_stk_call_long": 707266,
          "opt_stk_put_long": 719175,
          "opt_stk_call_short": 1004492,
          "opt_stk_put_short": 643617,
          "total_long": 4025661,
          "total_short": 3706778
        }
      }
    ]
  },
  "cached_at": "2026-11-26T14:59:01+00:00",
  "source": "nse-fo-participant-activity",
  "stale": false,
  "error": null,
  "reason_code": null,
  "data_age_seconds": 86306.98
}

Saved answer. Run on 2026-11-27, answered 200. Lists show their first item in full; the other items and long text are shortened. A call you make now gets the current answer.

Step 4: Bulk/block deals

Read the bulk and block deals reported for one company. Use deal_type and days to narrow them. Each entry in deals has a deal_date, deal_type, client_name, quantity and price.

GET /stocks/{q}/bulk-block-deals has the parameters, the errors and a box to send the call.

Bulk/block deals for RELIANCE
curl -H "Authorization: Bearer $DALALOS_API_KEY" "https://mcp.dalalos.in/v1/stocks/RELIANCE/bulk-block-deals?days=1825&limit=10"
{
  "status": "success",
  "data": {
    "isin": "INE002A01018",
    "nse_symbol": "RELIANCE",
    "name": "Reliance Industries Limited",
    "days": 1825,
    "deal_type": null,
    "count": 2,
    "deals": [
      {
        "deal_date": "2026-10-08",
        "deal_type": "block",
        "client_name": "PI OPPORTUNITIES AIF V LLP",
        "buy_sell": "BUY",
        "quantity": 2040212,
        "price": 1176,
        "remarks": null
      },
      {
        "deal_date": "2026-10-08",
        "deal_type": "block",
        "client_name": "PIONEER INVESTMENT FUND SCHEME II",
        "buy_sell": "SELL",
        "quantity": 2040212,
        "price": 1176,
        "remarks": null
      }
    ]
  },
  "cached_at": "2026-10-08T00:00:00+00:00",
  "source": "nse-bulk-block-deals",
  "stale": true,
  "error": null,
  "reason_code": null,
  "data_age_seconds": 4373981.395
}

Saved answer. Run on 2026-11-27, answered 200. The data in it was collected on 2026-10-08, not on the run date. The API marked it stale ("stale": true): it answered from its last stored copy because a newer one was not available. A call you make now gets the current answer.

The full script

Python 3 with the requests package. It reads your key from DALALOS_API_KEY, waits once when the API asks it to slow down, stops with a plain message on 401, 402 and 403, and prints what it reads.

money_flow_monitor.py
import json
import os
import sys
import time

import requests

BASE = "https://mcp.dalalos.in/v1"
HEADERS = {"Authorization": "Bearer " + os.environ["DALALOS_API_KEY"]}


def call(method, path, **kwargs):
    """One request. Waits once on a 429. Stops with a plain message on 401, 402 and 403."""
    for attempt in range(2):
        response = requests.request(method, BASE + path, headers=HEADERS, timeout=30, **kwargs)
        if response.status_code == 429 and attempt == 0:
            time.sleep(float(response.headers.get("Retry-After", "2")))
            continue
        break
    if response.status_code == 401:
        sys.exit("401: the key is missing or not valid. Create one at https://dalalos.in/dashboard/keys")
    if response.status_code == 402:
        sys.exit("402: the monthly credits are used up.")
    if response.status_code == 403:
        sys.exit("403: this plan does not include the REST API.")
    response.raise_for_status()
    return response.json()


def show(title, answer, limit=1200):
    print("==", title)
    print(json.dumps(answer, indent=2)[:limit])


from datetime import date, timedelta

COMPANY = "RELIANCE"  # one company for the large deals
end = date.today()
start = end - timedelta(days=26)

flow = call("GET", "/market-fii-dii-flow", params={"from": start.isoformat(), "to": (end - timedelta(days=1)).isoformat()})
for row in flow["data"]["results"]:
    print(row["trade_date"], "FII net", row["fii_net"], "DII net", row["dii_net"], "(Rs crore)")

fpi = call("GET", "/fpi/sectors", params={"instrument": "equity"})["data"]
print("FPI equity by sector, latest period ending", fpi["latest_period_end"])
for row in fpi["results"]:
    if row["period_end"] == fpi["latest_period_end"]:
        print(" ", row["sector"], row["net_inr_cr"], "(Rs crore)")

participants = call("GET", "/fo-participant-activity", params={"days": 30})["data"]["results"]
show("futures and options by participant, latest row", participants[:1], limit=600)

deals = call("GET", f"/stocks/{COMPANY}/bulk-block-deals", params={"days": 365, "limit": 10})["data"]["deals"]
print(COMPANY, "bulk and block deals in the last year:", len(deals))
for deal in deals:
    print(" ", deal["deal_date"], deal["deal_type"], deal["client_name"], deal["quantity"], "at", deal["price"])

Run it on a schedule

Runs at 20:30 on weekdays, after the exchanges publish the day's figures.

crontab
30 20 * * 1-5 python3 /path/to/money_flow_monitor.py

Limits

  • A run makes four calls, each charged in credits from your plan.
  • /fii-dii/sectors and /stocks/{q}/fii-flow read one depository (CDSL), which stopped publishing those figures in March 2025, so they return history only. This recipe uses the fortnightly sector route, which covers both depositories and is current.
  • The daily flow routes can answer for a day only after the exchange publishes it. A day with no figures is left out.
  • An empty answer is a 200 with reason_code no_data. Check for it before drawing a chart.

Extend it

  • Add GET /stocks/{q}/fii-flow for the daily FII flow in one company up to March 2025, when its source stopped.
  • Add GET /fo-ban-list for the securities in the F&O ban today.
  • More routes: FII, DII and F&O flows.
  • More routes: Who owns a company.

KEEP EXPLORING