Skip to content

Instruments

Download the locally stored instrument master for every exchange or for one exchange. This is the only v1 market-data resource that returns CSV as an alternative to JSON.

Endpoint

http
GET /api/v1/instruments?apikey=<key>&exchange=NFO&format=json

Query Parameters

ParameterRequiredValuesDefault
apikeyYesTradeboard API key-
exchangeYes in practiceAny exchange accepted by VALID_EXCHANGES-
formatNojson, csvjson

exchange is declared optional in InstrumentsSchema, but the handler always passes the query value through, and an absent parameter arrives as null. The field does not set allow_none, so marshmallow rejects it with {"exchange": ["Field may not be null."]} and HTTP 400. Always send exchange. The "download every exchange in one call" path exists in the service but is currently unreachable through this route.

The route ignores query parameters it does not recognize, so a stray parameter is harmless.

Response Fields

Each item in data carries exactly these keys, in this order, and the CSV column order matches:

FieldDescription
symbolTradeboard standard symbol
brsymbolBroker-specific symbol
nameUnderlying or instrument name
exchangeTradeboard exchange code
brexchangeBroker-specific exchange code
tokenBroker instrument token
expiryExpiry date for derivatives
strikeStrike price
lotsizeLot size
instrumenttypeInstrument type
tick_sizeTick size

There is no freeze_qty on this resource; use Symbol or Search when you need it.

JSON Example

bash
curl --get 'http://127.0.0.1:5000/api/v1/instruments' \
  --data-urlencode 'apikey=<your_app_apikey>' \
  --data-urlencode 'exchange=NFO' \
  --data-urlencode 'format=json'
json
{
  "status": "success",
  "message": "Found 1 instruments",
  "data": [
    {
      "symbol": "NIFTY30JUL2625000CE",
      "brsymbol": "NIFTY26JUL25000CE",
      "name": "NIFTY",
      "exchange": "NFO",
      "brexchange": "NFO",
      "token": "12345",
      "expiry": "30-JUL-26",
      "strike": 25000,
      "lotsize": 65,
      "instrumenttype": "CE",
      "tick_size": 0.05
    }
  ]
}

The exact symbols, broker symbols, token types, and row count depend on the active broker's downloaded master contract.

CSV Example

bash
curl --get 'http://127.0.0.1:5000/api/v1/instruments' \
  --data-urlencode 'apikey=<your_app_apikey>' \
  --data-urlencode 'exchange=NSE' \
  --data-urlencode 'format=csv' \
  --output instruments_NSE.csv

CSV responses use Content-Type: text/csv and a download filename of instruments_<exchange>.csv (or instruments_all.csv).

Errors

StatusCondition
400Invalid exchange or format, or either apikey or exchange omitted (both arrive as null and fail schema validation)
403API key is invalid
500Instrument database query failed

The service also has a 401 "API key is required" branch, but the schema rejects a missing apikey with 400 first, so 401 is not reachable through this route.

When format=csv, errors are returned as text/plain with the message as the body rather than as a JSON object. The HTTP status code is the same.

Back to: API documentation