Margin Trading Facility API
Free, key-less, CORS-enabled JSON API for India's NSE Margin Trading Facility book — fetched directly from NSE's own daily disclosure files. No sign-up, no rate limit enforced (please cache rather than polling faster than every few minutes — NSE itself only republishes once per trading day).
License & attribution (required)
This API is free to use, including commercially, under CC BY 4.0 — provided that anywhere you display or redistribute this data, you credit "Margin Trading Facility" with a visible, clickable link back to https://margintradingfacility.com. A footer line like "MTF data via Margin Trading Facility" linking to this site satisfies that condition.
Endpoints
/api/latestWhole-market NSE MTF book: total outstanding, change vs. ~1 month ago, fresh exposure/liquidation for the latest trading day, plus a recent daily series.
curl https://margintradingfacility.com/api/latest/api/stocks?limit=50Per-stock MTF book, NSE close price, and 7D/30D change windows for the largest funded stocks. Omit limit to get the default top ~150.
curl "https://margintradingfacility.com/api/stocks?limit=50"/api/stock/{ticker}Full detail for one stock: current book, rank, 1D/1W/1M/3M/6M change windows, and a ~3-month price-vs-book series. 404 if the ticker isn't currently MTF-funded.
curl https://margintradingfacility.com/api/stock/RELIANCE/api/sectorsMTF book aggregated by sector (manually-classified — NSE's own files don't carry a sector field), with 1D/1W/1M change.
curl https://margintradingfacility.com/api/sectors/api/openapi.jsonMachine-readable OpenAPI 3.1 spec for all of the above.
curl https://margintradingfacility.com/api/openapi.jsonConventions
- All money is in INR crore (1 crore = 10,000,000) unless stated otherwise.
- "7D"/"30D" etc. mean N NSE trading sessions, not calendar days.
- Every response includes a
metaobject with the license and attribution text — keep it, or reproduce it, wherever you surface this data. - CORS is enabled on every endpoint (
Access-Control-Allow-Origin: *), so you can call this directly from browser JavaScript. - This service keeps no database — everything is recomputed from NSE's own archived files on each request, which only go back roughly a year.