On this page
Nothing in this API works until you can name an instrument the way it expects. There are two identifiers, they are used in different places, and both come from the same source.
Two identifiers, two jobs
| Trading symbol | Contract token | |
|---|---|---|
| Field name | tsym | token (tk on the WebSocket) |
| Looks like | RELIANCE-EQ | 2885 |
| Used for | Placing, modifying and cancelling orders; margin calculations | Quotes, security info, chart data, and all WebSocket subscriptions |
| Stable? | Within a contract's life | Within a contract's life. Refresh daily. |
| Where from | The TradingSymbol column, or tsym from Search Scrips | The Token column, or token from the same response |
RELIANCE-EQ looks like a pattern you could generate, and for NSE equities it nearly is. Then you meet NIFTY30DEC26C26000, ZYDUSLIFE29DEC26P1640 and COPPER21JAN27P1500, each following a different scheme per segment.
Always take the symbol from the symbol master or from a Search Scrips response.
The symbol master files
7 zipped CSV files, one per segment, covering NSE, BSE and MCX across cash, derivatives, commodity and currency. Together they are the authoritative list of every tradable contract - 193,349 rows.
They need no token, no account and no rate-limit budget. A plain GET is enough, which makes them the one part of this API you can explore before you have credentials at all.
| Segment | Download | Zipped | Unzipped | Rows |
|---|---|---|---|---|
| NSE - cash and indices | https://api.infinn.in/NSE_symbols.txt.zip | 98 KB | 408 KB | 9,955 |
| BSE - cash | https://api.infinn.in/BSE_symbols.txt.zip | 120 KB | 500 KB | 12,931 |
| NSE - equity derivatives | https://api.infinn.in/NFO_symbols.txt.zip | 682 KB | 6124 KB | 82,887 |
| BSE - equity derivatives | https://api.infinn.in/BFO_symbols.txt.zip | 370 KB | 2846 KB | 40,378 |
| NSE - commodity | https://api.infinn.in/NCOM_symbols.txt.zip | 176 KB | 1589 KB | 21,566 |
| MCX - commodity | https://api.infinn.in/MCX_symbols.txt.zip | 131 KB | 1125 KB | 14,755 |
| NSE - currency | https://api.infinn.in/CDS_symbols.txt.zip | 95 KB | 842 KB | 10,877 |
Every URL, size, row count and column name on this page was read off the live archives on 2026-10-08 - each returned HTTP 200 with Content-Type: application/zip and held a single comma-separated .txt file with a header row.
Infinn publishes no schema for these files, so tools/check_symbols.py re-downloads every one of them on each build and re-asserts the layout. If a column moves, the build fails rather than the page quietly going wrong.
What is inside them
Five layouts, not one
This is the part that costs people a day. There is no single schema. The 7 files use five different column layouts, and the differences are not additive - you cannot assume a derivatives file is a cash file plus three columns.
| Layout | Files | Named columns | How it differs |
|---|---|---|---|
| Cash | NSE BSE | 7 | No expiry, no strike. Instrument carries the series - EQ, INDEX, BE and so on. |
| Equity & commodity derivatives | NFO NCOM | 10 | Adds Expiry, OptionType and StrikePrice to the cash layout. |
| BSE derivatives | BFO | 9 | Like the above but with no OptionType column, and the strike is called Strike. |
| MCX | MCX | 11 | GNGD is inserted fourth, shifting every later column by one. |
| Currency | CDS | 12 | Precision and Multiplier are inserted fourth and fifth, shifting every later column by two. |
Four separate traps, each of which produces plausible-looking wrong data rather than an error:
- MCX inserts
GNGDfourth, shifting every later column by one. - CDS inserts
PrecisionandMultiplierfourth and fifth, shifting every later column by two. - BFO has no
OptionTypecolumn, and names the strikeStrikerather thanStrikePrice. - Every header ends with a trailing comma, so splitting it yields one more field than there are columns - and on CDS the data rows do not have that trailing comma, so its header has 13 fields where its rows have 12.
A positional parser applied to all of them will put trading symbols in the symbol column on MCX, strikes in the expiry column on CDS, and crash or mis-key on BFO.
The header lines, verbatim
# NSE_symbols.txt.zip
Exchange,Token,LotSize,Symbol,TradingSymbol,Instrument,TickSize,
# BSE_symbols.txt.zip
Exchange,Token,LotSize,Symbol,TradingSymbol,Instrument,TickSize,
# NFO_symbols.txt.zip
Exchange,Token,LotSize,Symbol,TradingSymbol,Expiry,Instrument,OptionType,StrikePrice,TickSize,
# BFO_symbols.txt.zip
Exchange,Token,LotSize,Symbol,TradingSymbol,Expiry,Instrument,Strike,TickSize,
# NCOM_symbols.txt.zip
Exchange,Token,LotSize,Symbol,TradingSymbol,Expiry,Instrument,OptionType,StrikePrice,TickSize,
# MCX_symbols.txt.zip
Exchange,Token,LotSize,GNGD,Symbol,TradingSymbol,Expiry,Instrument,OptionType,StrikePrice,TickSize,
# CDS_symbols.txt.zip
Exchange,Token,LotSize,Precision,Multiplier,Symbol,TradingSymbol,Expiry,Instrument,OptionType,StrikePrice,TickSize,Real rows
Exchange,Token,LotSize,Symbol,TradingSymbol,Instrument,TickSize,
NSE,26000,1,Nifty 50,NIFTY INDEX,INDEX,0,
NSE,26009,1,Nifty Bank,NIFTY BANK,INDEX,0,
NSE,2885,1,RELIANCE,RELIANCE-EQ,EQ,0.1,
NSE,3045,1,SBIN,SBIN-EQ,EQ,0.05,Exchange,Token,LotSize,Symbol,TradingSymbol,Expiry,Instrument,OptionType,StrikePrice,TickSize,
NFO,151104,900,ZYDUSLIFE,ZYDUSLIFE29DEC26P1640,29-DEC-2026,OPTSTK,PE,1640,0.05,
NFO,35000,30,BANKNIFTY,BANKNIFTY29DEC26C69400,29-DEC-2026,OPTIDX,CE,69400,0.05,
NFO,61751,900,ZYDUSLIFE,ZYDUSLIFE23NOV26F,23-NOV-2026,FUTSTK,XX,-0.01,0.1,Exchange,Token,LotSize,GNGD,Symbol,TradingSymbol,Expiry,Instrument,OptionType,StrikePrice,TickSize,
MCX,587232,2500,1,COPPER,COPPER21JAN27P1500,21-JAN-2027,OPTFUT,PE,1500,0.01,
MCX,583133,100,1,CRUDEOIL,CRUDEOIL17NOV26P11650,17-NOV-2026,OPTFUT,PE,11650,0.1,
MCX,574825,100,0.1,SILVER100,SILVER10030OCT26,30-OCT-2026,FUTCOM,XX,0,1,Exchange,Token,LotSize,Precision,Multiplier,Symbol,TradingSymbol,Expiry,Instrument,OptionType,StrikePrice,TickSize,
CDS,17274,1,4,1000,USDJPY,USDJPY29DEC26P141,29-DEC-2026,OPTCUR,PE,141,0.01
CDS,13298,1,4,1000,USDINR,USDINR13NOV26F,13-NOV-2026,FUTCUR,XX,-1e-07,0.0025Exchange,Token,LotSize,Symbol,TradingSymbol,Expiry,Instrument,Strike,TickSize,
BFO,1130873,150,INALOPT,INDIGO26OCT4200CE,29-OCT-2026,OPTSTK,4200,0.05,
BFO,1162208,350,AATLOPT,APLAPOLLO26DEC1960CE,31-DEC-2026,OPTSTK,1960,0.05,| Column | Present in | Meaning |
|---|---|---|
Exchange | all | The exchange code. Send it as exch. |
Token | all | Numeric contract token. Use it for quotes, chart data and every WebSocket subscription. |
LotSize | all | Minimum tradable multiple. 1 for cash equities. |
Precision | CDS only | Decimal places. Fourth column in the currency file only. |
Multiplier | CDS only | Contract multiplier, 1000 throughout the currency file. Fifth column, currency only. |
GNGD | MCX only | Fourth column in the MCX layout. Infinn publishes no expansion of the name. Values seen include 1, 0.1 and 100, which track the contract's quotation unit. |
Symbol | all | The underlying's name, e.g. RELIANCE. Not orderable on its own. |
TradingSymbol | all | The exact contract identifier. This is what you send as tsym. |
Expiry | derivatives | dd-MMM-yyyy, e.g. 29-DEC-2026. |
Instrument | all | The contract class. The values differ per segment - see the table below. |
OptionType | derivatives except BFO | CE for a call, PE for a put, XX on a futures row. |
StrikePrice | derivatives except BFO | Strike. On a futures row it holds a per-segment sentinel, not a price. |
Strike | BFO only | The BSE derivatives file's name for the strike column. |
TickSize | all | The price step. An order price must be a whole multiple of it. |
A futures row has no strike, and says so three different ways
On a futures contract there is no strike and no call/put. Every file still has the columns, so they are filled with a sentinel - and the sentinel is different in each file.
| File | OptionType | StrikePrice | Futures rows |
|---|---|---|---|
NFO | XX | -0.01 | 671 |
MCX | XX | 0 | 169 |
CDS | XX | -1e-07 | 129 |
In Python, int("-1e-07") raises ValueError and Decimal("-1e-07") succeeds with a non-zero value. A parser that reads the strike column numerically will either crash on the currency file or quietly record a strike of nearly zero on 129 futures contracts.
Branch on Instrument starting with FUT, and do not read the strike at all for those rows.
What Instrument actually contains
The values differ per file, and there are more of them than the Infinn documentation's enumerations suggest. Counted on 2026-10-08:
| File | Instrument values present, with counts |
|---|---|
NSE | SG 4328, EQ 2685, N0 1037, SM 474, BE 239, GS 135, ST 105, N1 101, MF 99, INDEX and others |
BSE | F 6642, B 1876, X 1137, G 1124, A 702, XT 455, M 402, T 222, MT 154 and others |
NFO | OPTSTK 69872, OPTIDX 12344, FUTSTK 653, FUTIDX 18 |
BFO | OPTSTK 32214, OPTIDX 6222, FUTSTK 1261, FUTIDX 24, and 13: on 657 malformed rows |
NCOM | OPTFUT 20244, OPTBLN 1174, FUTBLN 56, FUTENR 52, FUTBAS 40 |
MCX | OPTFUT 14586, FUTCOM 163, FUTIDX 6 |
CDS | OPTCUR 10748, FUTCUR 129 |
BFO has 1,295 rows with a 17-digit token
Token length in BFO_symbols.txt is bimodal, and there is nothing in between:
6 digits 10,544 rows
7 digits 28,539 rows
17 digits 1,295 rows <-- every other file tops out at 9Those 1,295 are two different things, and only one of them is broken.
They carry an expiry with no year and the literal string 13: where the instrument type belongs:
BFO,72059750111514823,1600,TAMOOPT,TMPV,26-DEC,13:,0.14,0.22,
BFO,72059780176285380,700,ICICOPT,ICICIBANK,26-OCT,13:,0.14,0.22,
BFO,72059857485697308,500,RELIOPT,RELIANCE,26-OCT,13:,0.14,0.22,
BFO,72059793061187521,400,INFYOPT,INFY,26-DEC,13:,0.14,0.22,The parser below rejects any row whose expiry is not dd-MMM-yyyy, which removes exactly these 657 and nothing else.
Valid expiry, valid instrument type, but the same 17-digit token - and a trading symbol naming two months:
BFO,72060325637130436,1975,BPCLFUT,BPCLOCTDEC26,29-OCT-2026,FUTSTK,0,0.05,
BFO,72071290688634884,12000,SAGLFUT,SAGILITYNOVDEC26,26-NOV-2026,FUTSTK,0,0.05,
BFO,863548,2425,ZOMAFUT,ETERNAL26OCTFUT,29-OCT-2026,FUTSTK,0,0.05,BPCLOCTDEC26 spans October and December; the well-formed row beneath it, ETERNAL26OCTFUT, is a single-month future with an ordinary 6-digit token.
Documentation information not available. Infinn publishes nothing about these rows, the 17-digit token format, or whether such a token can be used for quotes and subscriptions at all. The naming suggests calendar spreads, but that is an inference from the symbol text and nothing confirms it. The parser below keeps them and flags them, so you can decide; do not assume the token works until you have tried it.
Downloading and parsing them
"""Download and index the Infinn symbol master files.
No credentials: these archives are public. Run it once a day before the
market opens -- they are republished overnight and contract lists change
with every expiry.
Everything below was written against the real files. The four things that
make this harder than it looks:
1. FIVE column layouts, not one. MCX inserts GNGD fourth; CDS inserts
Precision and Multiplier fourth and fifth; BFO has no OptionType and
calls the strike "Strike". So: index by header name, never by
position.
2. Every header ends with a trailing comma, which csv.DictReader turns
into an empty-string fieldname. On CDS the data rows do NOT have that
comma, so its header has 13 fields and its rows 12 -- DictReader
copes, but only because we drop the blank key.
3. 657 BFO rows are corrupt: year-less expiries and "13:" as the
instrument type. Rejected here. A further 638 have a valid expiry
but a 17-digit token where every other row in every file has 6 to 9
digits; they are kept and flagged, because Infinn documents nothing
about them.
4. A futures row has no strike. The placeholder differs per file:
-0.01 on NFO, 0 on MCX, -1e-07 on CDS. Never parse it as a number.
"""
import csv
import io
import re
import zipfile
import requests
BASE = "https://api.infinn.in"
SEGMENTS = ["NSE", "BSE", "NFO", "BFO", "NCOM", "MCX", "CDS"]
# dd-MMM-yyyy. Anything else in an expiry column is a corrupt row.
EXPIRY = re.compile(r"^\d{2}-[A-Z]{3}-\d{4}$")
def download(segment):
"""Fetches one archive and yields its rows as dicts keyed by header."""
url = f"{BASE}/{segment}_symbols.txt.zip"
response = requests.get(url, timeout=120)
response.raise_for_status()
with zipfile.ZipFile(io.BytesIO(response.content)) as archive:
name = archive.namelist()[0] # exactly one member per zip
with archive.open(name) as handle:
text = io.TextIOWrapper(handle, encoding="utf-8")
for row in csv.DictReader(text):
# Drop the empty-string key the trailing comma creates.
yield {k.strip(): (v or "").strip()
for k, v in row.items() if k and k.strip()}
def to_record(row):
"""One contract, with the per-file differences flattened away."""
instrument = row.get("Instrument", "")
is_future = instrument.startswith("FUT")
expiry = row.get("Expiry", "")
if expiry and not EXPIRY.match(expiry):
return None # the malformed BFO rows
# BFO calls it Strike; everyone else calls it StrikePrice. On a
# futures row whatever is there is a sentinel, not a price.
strike = row.get("StrikePrice") or row.get("Strike") or ""
return {
"exch": row["Exchange"],
"tsym": row["TradingSymbol"],
"token": row["Token"],
"symbol": row.get("Symbol", ""),
"lot_size": int(row.get("LotSize") or 1),
# 0 for indices, which are not tradable.
"tick_size": float(row.get("TickSize") or 0),
"instrument": instrument,
"expiry": expiry,
# XX on a futures row, so normalise it to None.
"option_type": None if is_future else (row.get("OptionType") or None),
"strike": None if (is_future or not strike) else strike,
# Currency only.
"multiplier": row.get("Multiplier"),
# 17 digits where every other row has 6 to 9. Undocumented; the
# symbols look like calendar spreads. Flagged, not dropped.
"unusual_token": len(row["Token"]) > 10,
}
def build_index():
"""Returns lookups by (exchange, tsym) and by (exchange, token)."""
by_symbol, by_token = {}, {}
for segment in SEGMENTS:
kept = rejected = flagged = 0
for row in download(segment):
record = to_record(row)
if record is None:
rejected += 1
continue
kept += 1
flagged += bool(record["unusual_token"])
by_symbol[(record["exch"], record["tsym"])] = record
by_token[(record["exch"], record["token"])] = record
notes = []
if rejected:
notes.append(f"{rejected} corrupt rows rejected")
if flagged:
notes.append(f"{flagged} with an undocumented 17-digit token")
suffix = f" ({', '.join(notes)})" if notes else ""
print(f"{segment:<5} {kept:>6} contracts{suffix}")
return by_symbol, by_token
if __name__ == "__main__":
by_symbol, by_token = build_index()
print()
print(by_symbol[("NSE", "RELIANCE-EQ")])This is what it actually prints. The output below was produced by extracting this exact code from this page and running it - see tools/check_symbols.py, which does the same thing on every build.
NSE 9955 contracts
BSE 12931 contracts
NFO 82887 contracts
BFO 39721 contracts (657 corrupt rows rejected, 638 with an undocumented 17-digit token)
NCOM 21566 contracts
MCX 14755 contracts
CDS 10877 contracts
{'exch': 'NSE', 'tsym': 'RELIANCE-EQ', 'token': '2885', 'symbol': 'RELIANCE',
'lot_size': 1, 'tick_size': 0.1, 'instrument': 'EQ', 'expiry': '',
'option_type': None, 'strike': None, 'multiplier': None,
'unusual_token': False}TradingSymbol | Token | Symbol | Instrument | LotSize | TickSize |
|---|---|---|---|---|---|
RELIANCE-EQ | 2885 | RELIANCE | EQ | 1 | 0.1 |
SBIN-EQ | 3045 | SBIN | EQ | 1 | 0.05 |
NIFTY INDEX | 26000 | Nifty 50 | INDEX | 1 | 0 |
NIFTY BANK | 26009 | Nifty Bank | INDEX | 1 | 0 |
Validating an order against the master
Two checks prevent the majority of Error Occurred : 2 "invalid input" rejections, and both need only the symbol master.
from decimal import Decimal
def validate(order, instrument):
"""Raises if the order would be rejected for lot size or tick size.
Catching these locally turns an opaque server rejection into a precise
message you can show the user.
"""
problems = []
# --- Lot size -----------------------------------------------------------
# Equities have a lot size of 1, so this is a no-op for them. Derivatives
# must be an exact multiple.
lot = instrument["lot_size"]
qty = int(order["qty"])
if lot > 1 and qty % lot != 0:
nearest = max(lot, (qty // lot) * lot)
problems.append(
f"Quantity {qty} is not a multiple of the lot size {lot}. "
f"Try {nearest} or {nearest + lot}."
)
# --- Tick size ----------------------------------------------------------
# Decimal, not float: 1402.30 % 0.10 in binary floating point does not
# reliably give zero, and would reject valid prices.
tick = Decimal(str(instrument["tick_size"]))
price = Decimal(str(order["prc"]))
if tick > 0 and price > 0 and price % tick != 0:
down = (price // tick) * tick
problems.append(
f"Price {price} is not a multiple of the tick size {tick}. "
f"Try {down} or {down + tick}."
)
if problems:
raise ValueError(" ".join(problems))
# validate({"qty": "1", "prc": "1402.33"}, reliance)
# -> ValueError: Price 1402.33 is not a multiple of the tick size 0.1.
# Try 1402.3 or 1402.4.1402.30 % 0.10 in binary floating point is approximately 0.0999999, not zero - so a float-based check rejects prices that are perfectly valid. Decimal in Python, decimal in C#, BigDecimal in Java. In JavaScript, work in integer paise: Math.round(price * 100) % Math.round(tick * 100).
The files or the search endpoint?
| Symbol master files | Search Scrips endpoint | |
|---|---|---|
| Best for | Bulk resolution, validation, option chains, anything programmatic | A user typing into a search box |
| Cost | 8 downloads per day, about 1.6 MB compressed. No token, no rate limit, no account at all. | One API request per lookup, against the rate limit |
| Gives you | Every contract, with lot size, tick size, expiry, strike and option type | Matching contracts. The documented sample returns only exch, token and tsym. |
| Freshness | As of the daily publication | Live |
| Rate limited | no | yes |
When to refresh
The files are republished each day. Contract lists change constantly: options expire weekly, new strikes are added as the underlying moves, and futures roll monthly.
A stale cache produces rejections on contracts that no longer exist, and - worse - silently misses contracts that were added today.
Indices
Indices appear in the cash files with Instrument = INDEX and a TickSize of 0, because they are not tradable. You subscribe to them for their value.
| Index | Exchange | Token | Subscription key |
|---|---|---|---|
| Nifty 50 | NSE | 26000 | NSE|26000 |
| Nifty Bank | NSE | 26009 | NSE|26009 |
| India VIX | NSE | 26017 | NSE|26017 |
| Nifty Fin Services (FINNIFTY) | NSE | 26037 | NSE|26037 |
Get Index List returns the same information from the API if you prefer not to parse the file.