Instrument Searchโ
API to search for instruments across exchanges and segments. This API provides a comprehensive search functionality to find instruments based on free text query, exchanges, instrument types, segments, expiry keywords and ATM offset. Results are paginated for efficient data retrieval.
Key Featuresโ
Free Text Search: Search by symbol, name, strike price or instrument type with support for partial matches.
Multiple Filters: Filter results by exchanges (
NSE,BSE,MCX), segments (EQ,FO,CURR, etc.), and instrument types (PE,CE, etc.)Expiry Filtering: Filter derivative instruments by expiry keywords or specific expiry dates as below:
Type Details Weekly keywords current_week,this_week,near_week,weekly,next_week,far_weekMonthly keywords current_month,this_month,near_month,monthly,next_month,far_monthDate format yyyy-MM-dd(e.g.2025-10-30,2025-11-27)ATM Search: Search for ATM instruments by specifying the atm_offset to express relative distance from ATM.
For example:
Suppose Nifty is at 24,500 and the strike interval is 50.
Usequery=NIFTY,instrument_types=CEorPE, andexpiry(e.g.current_week).
With atm_offset=0 you get options at the ATM strike (24,500).
With atm_offset=2 you get options two strikes above ATM (24,600).
With atm_offset=-2 you get options two strikes below ATM (24,400).Pagination: Control result size with page number and records per page parameters.
- This is an alternative way to get Instrument details instead of using the Instruments JSON files. And also the response is same as the Instrument JSON files.
- For comma-separated lists (exchanges, segments, instrument_types), do not include spaces between values.
- Search is case-insensitive and supports partial matches for symbol, name, and short name. Since its a free text search, results might not always be accurate.
- To improve search performance, use more specific filter parameters like exchanges, segments and expiry.
What may not work well with free text search ?โ
The following types of query values may not work well or may return unexpected results:
- Very generic or single-character queries: A single letter or digit (e.g.
1,A) may match too many instruments or behave unpredictably. Use exchanges, segments, or instrument_types to narrow results. - Numeric-only (e.g. strike only): A query like
24000without a symbol may match many option strikes across underlyings. Prefer including the symbol (e.g.NIFTY 24000) or use expiry and instrument_types to filter. - Multiple underlyings in one query: e.g.
RELIANCE NIFTYmay not be interpreted as two symbols. Use one symbol per request or make separate calls. - Identifiers not in search scope: Search matches on symbol, name and short name only. Other fields (e.g. ISIN, exchange_token) are not searchable via query; use Instrument JSON files to look up by those fields if needed.
- Special characters: Unusual punctuation or symbolic characters in query may not improve matching. Prefer alphanumeric characters and spaces.
Requestโ
curl --location 'https://api.upstox.com/v2/instruments/search?query=Reliance&expiry=current_month&atm_offset=0&page_number=1&records=20' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'
Additional samples in various languages are available in the Sample Code section on this page.
Query Parametersโ
| Name | Type | Required | Description |
|---|---|---|---|
| query | string | true | Free text search with a maximum of 50 characters (e.g. RELIANCE, RELIANCE CE 1500, RELIANCE 28 Oct 2025) |
| exchanges | string | false | Comma-separated list of exchanges (e.g. NSE,BSE,MCX) Each exchange value must be one of: [ ALL, NSE, BSE, MCX] Default: ALL |
| segments | string | false | Comma-separated list of segments (e.g. EQ,FO,CURR,COMM) Each segment value must be one of: [ ALL, EQ, FO, CURR, COMM, INDEX, OPT, FUT] Default: ALL |
| instrument_types | string | false | Comma-separated list of instrument types (e.g. CE,PE,A) Each instrument type value must be either an option type [ CE, PE] or an instrument series such as [A, X] etc. |
| expiry | string | false | Comma-separated list of expiry keywords or expiry dates. Expiry keywords for weekly/monthly (see Key Features) or Use specific dates in format yyyy-MM-dd (e.g. 2025-10-30,2025-11-27), or. |
| atm_offset | integer | false | Relative distance from ATM when searching options. 0 = ATM, positive value โ strikes above ATM (e.g. 2 = ATM + 2 strikes) negative โ strikes below ATM (e.g. -2 = ATM โ 2 strikes). if no expiry is provided, then by default current week options are searched for the given atm_offset. |
| page_number | integer | false | Page number for pagination (starting from 1) Default: 1 |
| records | integer | false | Number of records per page Default: 10, Maximum: 30 |
- 200
- 4XX
Response Bodyโ
- EQ
- Futures
- Options
- INDEX
{
"name": "RELIANCE INDUSTRIES LTD",
"segment": "NSE_EQ",
"exchange": "NSE",
"isin": "INE002A01018",
"instrument_key": "NSE_EQ|INE002A01018",
"exchange_token": "2885",
"trading_symbol": "RELIANCE",
"short_name": "Reliance Industries",
"tick_size": 10.0,
"lot_size": 1,
"instrument_type": "EQ",
"freeze_quantity": 100000.0,
"qty_multiplier": 1,
"security_type": "NORMAL"
}
Field Description
| Field Name | Type | Description |
|---|---|---|
| segment | string | Segment to which the instrument is associated. Possible values: NSE_EQ, NSE_INDEX, NSE_FO, NCD_FO, BSE_EQ, BSE_INDEX, BSE_FO, BCD_FO, MCX_FO, NSE_COM |
| name | string | The name of the equity. |
| exchange | string | Exchange to which the instrument is associated. Possible values: NSE, BSE, MCX |
| isin | string | The International Securities Identification Number. |
| instrument_type | string | The instrument types for NSE are present at NSE India and for BSE are present at BSE India. |
| instrument_key | string | The unique identifier used across Upstox APIs for instrument identification. For the regex pattern applicable to this field, see the Field Pattern Appendix. |
| lot_size | number | The size of one lot of the equity. |
| freeze_quantity | number | The maximum quantity that can be frozen. |
| exchange_token | string | The exchange-specific token for the equity. |
| tick_size | number | The minimum price movement of the equity. |
| trading_symbol | string | Trading symbol of the instrument. |
| short_name | string | A shorter or abbreviated name of the equity. |
| security_type | string | Identifies the classification or status of a security within the market. Valid security types can be found in the Security Type Appendix |
| qty_multiplier | number | Quantity multiplier for the instrument. |
{
"name": "RELIANCE INDUSTRIES LTD",
"segment": "NSE_FO",
"exchange": "NSE",
"expiry": "2025-10-28",
"weekly": false,
"instrument_key": "NSE_FO|52509",
"exchange_token": "52509",
"trading_symbol": "RELIANCE FUT 28 OCT 25",
"tick_size": 10.0,
"lot_size": 500,
"instrument_type": "FUT",
"freeze_quantity": 20000.0,
"underlying_key": "NSE_EQ|INE002A01018",
"underlying_type": "EQUITY",
"underlying_symbol": "RELIANCE",
"strike_price": 0.0,
"qty_multiplier": 1,
"minimum_lot": 500
}
Field Description
| Field Name | Type | Description |
|---|---|---|
| weekly | boolean | Indicates if the future is weekly. |
| segment | string | Segment to which the instrument is associated. Possible values: NSE_EQ, NSE_INDEX, NSE_FO, NCD_FO, BSE_EQ, BSE_INDEX, BSE_FO, BCD_FO, MCX_FO, NSE_COM |
| name | string | The name of the future. |
| exchange | string | Exchange to which the instrument is associated. Possible values: NSE, BSE, MCX |
| expiry | date | The expiry date of the future. |
| instrument_type | string | The type of the future instrument. Possible values: FUT |
| underlying_symbol | string | The symbol of the underlying asset. |
| instrument_key | string | The unique identifier used across Upstox APIs for instrument identification. For the regex pattern applicable to this field, see the Field Pattern Appendix. |
| lot_size | number | The size of one lot of the future. |
| freeze_quantity | number | The maximum quantity that can be frozen. |
| exchange_token | string | The exchange-specific token for the future. |
| minimum_lot | number | The minimum lot size for the future. |
| underlying_key | string | The instrument_key for the underlying asset. |
| tick_size | number | The minimum price movement of the future. |
| underlying_type | string | The type of the underlying asset. Possible values: COM, INDEX, EQUITY, CUR, IRD |
| trading_symbol | string | The symbol used for trading the future. Format: <underlying_symbol> FUT <expiry in dd MMM yy> |
| qty_multiplier | number | Quantity multiplier for the instrument. |
{
"name": "RELIANCE INDUSTRIES LTD",
"segment": "NSE_FO",
"exchange": "NSE",
"expiry": "2025-10-28",
"weekly": false,
"instrument_key": "NSE_FO|120971",
"exchange_token": "120971",
"trading_symbol": "RELIANCE 1400 CE 28 OCT 25",
"tick_size": 5.0,
"lot_size": 500,
"instrument_type": "CE",
"freeze_quantity": 20000.0,
"underlying_key": "NSE_EQ|INE002A01018",
"underlying_type": "EQUITY",
"underlying_symbol": "RELIANCE",
"strike_price": 1400.0,
"qty_multiplier": 1,
"minimum_lot": 500
}
Field Description
| Field Name | Type | Description |
|---|---|---|
| weekly | boolean | Indicates if the option is weekly. |
| segment | string | The market segment of the option. Possible values: NSE_EQ, NSE_INDEX, NSE_FO, NCD_FO, BSE_EQ, BSE_INDEX, BSE_FO, BCD_FO, MCX_FO, NSE_COM |
| name | string | The name of the option. |
| exchange | string | Exchange to which the instrument is associated. Possible values: NSE, BSE, MCX |
| expiry | date | The expiry date of the option. |
| instrument_type | string | The type of the option instrument. Possible values: CE, PE |
| underlying_symbol | string | The symbol of the underlying asset. |
| instrument_key | string | The unique identifier used across Upstox APIs for instrument identification. For the regex pattern applicable to this field, see the Field Pattern Appendix. |
| strike_price | number | The strike price for the option. |
| lot_size | number | The size of one lot of the option. |
| freeze_quantity | number | The maximum quantity that can be frozen. |
| exchange_token | string | The exchange-specific token for the option. |
| minimum_lot | number | The minimum lot size for the option. |
| underlying_key | string | The instrument_key for the underlying asset. |
| tick_size | number | The minimum price movement of the option. |
| underlying_type | string | The type of the underlying asset. Possible values: COM, INDEX, EQUITY, CUR, IRD |
| trading_symbol | string | The symbol used for trading the option. Format: <underlying_symbol> <strike_price> <CE/PE> <expiry in dd MMM yy> |
| qty_multiplier | number | Quantity multiplier for the instrument. |
{
"name": "Nifty 50",
"segment": "NSE_INDEX",
"exchange": "NSE",
"instrument_key": "NSE_INDEX|Nifty 50",
"exchange_token": "26000",
"trading_symbol": "NIFTY",
"instrument_type": "INDEX"
}
Field Descriptionโ
| Field Name | Type | Description |
|---|---|---|
| segment | string | Segment to which the instrument is associated. Possible values: NSE_EQ, NSE_INDEX, NSE_FO, NCD_FO, BSE_EQ, BSE_INDEX, BSE_FO, BCD_FO, MCX_FO, NSE_COM |
| name | string | The name of the index. |
| exchange | string | Exchange to which the instrument is associated. Possible values: NSE, BSE, MCX |
| instrument_type | string | The type of the option instrument. Possible values: INDEX |
| instrument_key | string | The unique identifier used across Upstox APIs for instrument identification. For the regex pattern applicable to this field, see the Field Pattern Appendix. |
| exchange_token | number | The numerical identifier issued by the exchange representing the instrument. |
| trading_symbol | string | Trading symbol for the index. |
Error codesโ
| Error code | Description |
|---|---|
| UDAPI1169 | Query parameter cannot be empty. - Search query must be provided |
| UDAPI1170 | Query parameter length exceeds limit. - Search query exceeds maximum character limit |
| UDAPI1171 | Invalid exchanges. - One or more specified exchanges are invalid |
| UDAPI1172 | Invalid segments. - One or more specified segments are invalid |
| UDAPI1173 | Page records exceeds limit. - Requested page size is too large |
| UDAPI1174 | Page number must be greater than or equal to 1. - Page number must be at least 1 |
| UDAPI1175 | Invalid expiry. - One or more specified expiry are invalid |
Sample Codeโ
- Curl
- Python
- Node.js
- Java
- PHP
curl --location 'https://api.upstox.com/v2/instruments/search?query=RELIANCE&exchanges=NSE&segments=FO&instrument_types=CE,PE&expiry=current_month&atm_offset=0&page_number=1&records=20' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {your_access_token}'
import requests
url = 'https://api.upstox.com/v2/instruments/search'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {your_access_token}'
}
params = {
'query': 'RELIANCE',
'exchanges': 'NSE',
'segments': 'FO',
'instrument_types': 'CE,PE',
'expiry': 'current_month',
'atm_offset': 0,
'page_number': 1,
'records': 20
}
response = requests.get(url, headers=headers, params=params)
print(response.status_code)
print(response.json())
const axios = require('axios');
const url = 'https://api.upstox.com/v2/instruments/search';
const headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {your_access_token}'
};
const params = {
query: 'RELIANCE',
exchanges: 'NSE',
segments: 'FO',
instrument_types: 'CE,PE',
expiry: 'current_month',
atm_offset: 0,
page_number: 1,
records: 20
};
axios.get(url, { headers, params })
.then(response => {
console.log(response.status);
console.log(response.data);
})
.catch(error => {
console.error('Error:', error.message);
});
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) {
String url = "https://api.upstox.com/v2/instruments/search?query=RELIANCE&exchanges=NSE&segments=FO&instrument_types=CE,PE&expiry=current_month&atm_offset=0&page_number=1&records=20";
String acceptHeader = "application/json";
String authorizationHeader = "Bearer {your_access_token}";
HttpClient httpClient = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Content-Type", "application/json")
.header("Accept", acceptHeader)
.header("Authorization", authorizationHeader)
.GET()
.build();
try {
HttpResponse<String> response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println("Status Code: " + response.statusCode());
System.out.println("Response Body: " + response.body());
} catch (Exception e) {
System.err.println("Error: " + e.getMessage());
}
}
}
<?php
$url = 'https://api.upstox.com/v2/instruments/search?query=RELIANCE&exchanges=NSE&segments=FO&instrument_types=CE,PE&expiry=current_month&atm_offset=0&page_number=1&records=20';
$acceptHeader = 'application/json';
$authorizationHeader = 'Bearer {your_access_token}';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Accept: ' . $acceptHeader,
'Authorization: ' . $authorizationHeader,
));
$response = curl_exec($ch);
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo "Status Code: " . $status_code . PHP_EOL;
echo "Response Body: " . $response . PHP_EOL;
?>