NSE and BSE Movers API: Most Active, Top Gainers and Losers, or Price Shockers?
Forty rows came back from four calls: ten from the BSE most-active list, ten from the NSE most-active list, and the ten top gainers and ten top losers from the trending list. Counted by ticker string they are 36 symbols. Counted by company they are 31, and 23 of those companies appear in exactly one list. Reliance Industries turns up in three. The lists overlap far less than their names suggest, and each answers a different question. The Indian Stock Exchange API serves them as five parameter-free GET operations.
Lay the lists side by side and look for the same company
Eight companies appeared in more than one list in that live check:
| Company | BSE most active | NSE most active | Trending |
|---|---|---|---|
| Reliance Industries | RELI.BO | RELI.NS | loser |
| HDFC Bank | HDBK.BO | HDBK.NS | |
| ITC | ITC.BO | ITC.NS | |
| Tata Steel | TISC.BO | TISC.NS | |
| Jio Financial Services | JIOF.BO | JIOF.NS | |
| Infosys | INFY.NS | loser | |
| Bharti Airtel | BRTI.NS | loser | |
| Eternal | ETEA.NS | loser |
None of the ten gainers appeared anywhere else. Every list uses the same URL pattern with a different operation id:
curl 'https://api.opendata-api.com/api/project/indian-stock-exchange-api/nse-most-active?key=YOUR_API_KEY'
Query keys end up in shell history and proxy logs, so use your own only in an authorized environment. Read the HTTP status first, then the gateway's code, message and data; the list sits inside data, and HTTP 200 alone does not prove success.
Volume, percent move or shock: three questions, three lists
| Question | Operation | Ranked by | Checked live |
|---|---|---|---|
| Which stocks trade the most shares? | bse-most-active, nse-most-active | volume, highest first, per exchange | yes, 10 rows each |
| Which stocks moved the most in percent? | get-trending-stocks | percent_change, both directions | yes, 10 and 10 |
| Which stocks jumped away from their own recent average? | price-shockers | a deviation from an average price | no, documented only |
Volume and percent move are different filters. Infosys fell 3.43 percent on about 15.6 million shares, so it sits on both the NSE volume list and the losers list. State Bank of India rose 1.24 percent on 11.0 million shares and was a top gainer, yet that is below the 12.7 million that held tenth place on the volume list. Nine of the ten NSE volume leaders were down, so a most-active list is not a gainers list. Every most-active row carried volume as an integer.
The documented price shocker sample carries averagePrice, noOfDaysForAverage and deviation, which suggests a move against a recent average. The definition is not published, so do not present it as a formal signal.
NSE and BSE leaderboards are separate markets with separate tickers
BSE rows end in .BO and NSE rows in .NS, and the part before the dot is a short code rather than the symbol traders type: Tata Steel is TISC, Samvardhana Motherson is SAMD. Keep the returned string as the identifier. The two lists also rank different pools of trading: Reliance showed 2,297,453 shares on BSE and 21,864,319 on NSE, and HDFC Bank 1,225,163 against 28,533,222. Even the BSE leader, Suzlon Energy at 6.2 million shares, would sit below the NSE list's tenth place. Percent change differs too: Reliance was down 3.46 percent on BSE and 3.19 percent on NSE. Most-active rows carry no timestamp, so store your own request time with each list, and do not add the two volumes together unless that sum is what you mean to report.
trending nests two lists, and the live count is ten per side
The get-trending-stocks description promises the top 3. The live response nested top_gainers and top_losers under trending_stocks, ten rows each. Gainers began with the largest positive percent_change (4.43) and losers with the most negative (-3.43). The documented sample rows are BSE, but all twenty live rows had exchange_type NSI and codes ending in .NS. Loop over whatever arrives instead of hard-coding a count.
Every value in a trending row was a string, and the key names differ from the most-active rows. One trimmed row:
{"company_name": "Infosys", "ric": "INFY.NS", "ticker_id": "S0003032",
"percent_change": "-3.43", "volume": "15631325",
"exchange_type": "NSI", "date": "2026-10-28", "time": "09:44:59"}
ric holds the same string the most-active lists call ticker, so it is the join column; ticker_id is an opaque identifier that appears nowhere else. Convert strings before sorting. These rows carry their own date and time, the only freshness signal any of these lists offers. Infosys shows 15,631,325 shares here and 15,632,521 on the NSE volume list: separate snapshots, so never join on equal volumes.
Price shockers and 52-week lists depend on the market clock
fetch-52-week-high-low-data is documented to return an empty list when the market is closed. An empty body outside trading hours is an expected state, not a failure and not a reason to retry in a loop. Neither this list nor the price shockers list was verified in the live check, so treat both shapes as documented rather than proven:
- 52-week:
BSE_52WeekHighLowandNSE_52WeekHighLow, each withhigh52Weekandlow52Weekarrays ofticker,company,priceand the 52-week level. - Price shockers: a flat array in the documentation, but an object with
BSE_PriceShocker(empty) andNSE_PriceShockerin the stored sample, rows keyed bydisplayNameandric, values as strings.
Handle both price shocker shapes, poll inside Indian market hours and keep the last non-empty list afterwards. APIs for similar apps can be requested via the contact page, and private source-code deployment is available.
Merge on a normalized company key and flag where each name appears
The lists spell the same two facts differently:
| List | Container | Company name | Code |
|---|---|---|---|
| Most active | root array | company | ticker |
| Trending | trending_stocks.top_gainers, top_losers | company_name | ric |
| Price shockers (sample) | BSE_PriceShocker, NSE_PriceShocker | displayName | ric |
| 52-week (documented) | high52Week, low52Week per exchange | company | ticker |
Use the text before the last dot of the code as the company key, so RELI.BO and RELI.NS meet. In the check, the stems matched for all five companies shared across exchanges, and the names matched for all eight shared companies. Names still vary in form (trending shows "Larsen & Toubro Ltd"), so compare lowercased names with "ltd" and "limited" removed, and flag a key whose names disagree instead of merging it silently. Then add one label per source list. A key labelled nse-active and loser is a heavy-volume faller.
One script, one membership table
Save this as movers.py, set OPENDATA_API_KEY in the environment and run python movers.py volume, move, shock, yearly or all. Each question makes only the requests it needs: volume makes two, move one, all five. The script never prints the key-bearing URL and records an empty list as a state instead of an error.
"""Poll only the Indian market lists a question needs, then print who appears where."""
import json
import os
import sys
from datetime import datetime, timezone
import requests
BASE = "https://api.opendata-api.com/api/project/indian-stock-exchange-api/"
KEY = os.environ["OPENDATA_API_KEY"] # never hard-code or print the key
QUESTIONS = {
"volume": ["bse-most-active", "nse-most-active"],
"move": ["get-trending-stocks"],
"shock": ["price-shockers"],
"yearly": ["fetch-52-week-high-low-data"],
}
QUESTIONS["all"] = [op for ops in list(QUESTIONS.values()) for op in ops]
def fetch(op):
# Raise short errors so the key-bearing URL never reaches logs.
try:
resp = requests.get(BASE + op, params={"key": KEY}, timeout=60)
body = resp.json() if resp.status_code == 200 else {}
except (requests.RequestException, ValueError) as exc:
raise RuntimeError(type(exc).__name__) from None
if resp.status_code != 200:
raise RuntimeError(f"HTTP {resp.status_code}")
if not isinstance(body, dict) or str(body.get("code")) != "200":
raise RuntimeError("gateway business failure")
data = body.get("data")
if isinstance(data, str): # a bare-array body can arrive as JSON text
try:
data = json.loads(data)
except ValueError:
pass
return data
def pairs(data, path, name_key, code_key):
"""Yield (company, code) from the list reached by walking dict keys in path."""
for key in path:
data = data.get(key) if isinstance(data, dict) else None
for row in data if isinstance(data, list) else []:
if isinstance(row, dict) and isinstance(row.get(name_key), str) and isinstance(row.get(code_key), str):
yield row[name_key], row[code_key]
def extract(op, data):
"""Map one response to {list label: [(company, code), ...]}."""
if op.endswith("most-active"):
return {op.replace("most-", ""): list(pairs(data, (), "company", "ticker"))}
if op == "get-trending-stocks":
return {label: list(pairs(data, ("trending_stocks", key), "company_name", "ric"))
for label, key in (("gainer", "top_gainers"), ("loser", "top_losers"))}
if op == "price-shockers" and isinstance(data, list): # the documented flat array
return {"shock": list(pairs(data, (), "company", "ticker"))}
out = {}
for ex in ("bse", "nse"):
if op == "price-shockers": # the stored sample object
out[f"{ex}-shock"] = list(pairs(data, (f"{ex.upper()}_PriceShocker",), "displayName", "ric"))
else: # 52-week lists: highs and lows apart, per exchange
for side in ("high", "low"):
out[f"{ex}-{side}"] = list(pairs(data, (f"{ex.upper()}_52WeekHighLow", f"{side}52Week"),
"company", "ticker"))
return out
def norm(name):
return " ".join(w for w in name.lower().split() if w not in ("ltd", "limited"))
def main(question):
where, names = {}, {}
for op in QUESTIONS[question]:
stamp = datetime.now(timezone.utc).strftime("%H:%M:%SZ")
try:
lists = extract(op, fetch(op))
except RuntimeError as exc:
print(f"{op}: request failed ({exc})")
continue
for label, rows in lists.items():
print(f"{label}: {len(rows)} rows at {stamp}" + ("" if rows else " (empty, not a failure)"))
for company, code in rows:
stem = code.rsplit(".", 1)[0] # RELI.BO and RELI.NS share RELI
where.setdefault(stem, set()).add(label)
names.setdefault(stem, {})[norm(company)] = company
print(f"{len(where)} companies")
for stem in sorted(where, key=lambda s: (-len(where[s]), s)):
flag = " CHECK: names differ" if len(names[stem]) > 1 else ""
print(f"{stem:6} {next(iter(names[stem].values())):34} {', '.join(sorted(where[stem]))}{flag}")
if __name__ == "__main__":
if len(sys.argv) != 2 or sys.argv[1] not in QUESTIONS:
sys.exit("usage: python movers.py volume|move|shock|yearly|all")
main(sys.argv[1])