Skip to main content

Search Instruments

Take care

This API allows you to search through a large dataset of financial instruments, which might return extensive results if filters are not that strict. Use the provided parameters and pagination to refine your search and manage the results effectively.

The /searchInstrument API facilitates searching across a wide range of financial instruments, including options, equities, futures, and commodities from various exchanges like NSE, BSE, BCD, MCX, CDS, and NFO. The total number of instruments available is approximately 100,000. Designed to efficiently fetch instrument details based on your specified criteria. Whether you're seeking specific trading symbols, filtering by exchange, or employing fuzzy search patterns, our API offers flexibility and precision to enhance your searching experience.

Request Body Schema

Payload Structure:

{
"filterRequest": {},
"searchPatterns": {},
"paginationDetails": {}
}

Full Payload Schema

{
"type": "object",
"properties": {
"filterRequest": {
"type": "object",
"properties": {
"instrument_token": {
"type": "array",
"items": {
"type": "integer"
}
},
"tradingsymbol": {
"type": "array",
"items": {
"type": "string"
}
},
"exchange": {
"type": "array",
"items": {
"type": "string"
}
},
"name": {
"type": "array",
"items": {
"type": "string"
}
},
"instrument_type": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"searchPatterns": {
"type": "object",
"properties": {
"tradingsymbol": {
"type": "string"
},
"expiryRange": {
"type": "object",
"properties": {
"low": {
"type": "string"
},
"high": {
"type": "string"
}
}
}
}
},
"paginationDetails": {
"type": "object",
"properties": {
"offset": {
"type": "integer"
},
"limit": {
"type": "integer"
}
}
}
}
}

Usage Guidelines: All fields in the payload are optional, allowing for tailored searches based on your specific requirements. Combine multiple values for fields like exchange to shorten your search scope effectively. Leverage fuzzy search patterns and expiry range specifications to refine your search results efficiently. Utilize pagination details to navigate through large datasets seamlessly, ensuring optimal performance.

Filter Request:

  1. instrument_token: Utilize instrument tokens provided by our API to fetch detailed instrument information effortlessly.
  2. exchange_token: Leverage exchange tokens from our API to retrieve additional instrument details efficiently.
  3. tradingsymbol: Specify the trading symbol you're interested in to retrieve relevant instrument details.
  4. exchange: Filter instruments by exchange, supporting options like NSE, BSE, BCD, MCX, CDS, and NFO.
  5. instrument_type: Define the instrument type (e.g., Call Option (CE), Put Option (PE), Futures (FUT), Equity (EQ)) across which you want to search.
  6. segment: Search across various segments such as BCD-OPT, BCD-FUT, BCD, BSE, INDICES, CDS-OPT, CDS-FUT, MCX-FUT, MCX-OPT, NFO-OPT, NFO-FUT, and NSE, to precisely target your instrument search.

Search Patterns:

  1. tradingsymbol: Employ fuzzy search patterns to enhance your search experience. Simply provide a partial trading symbol like "RELIA" to retrieve relevant matches such as "RELIANCE."
  2. expiryRange: Specify an expiry range to focus on options or futures expiring within your required timelines effortlessly.

Pagination Details:

  1. offset: Skip a specified number of results to navigate through large datasets effectively.
  2. limit: Define the number of results to be returned, facilitating streamlined retrieval of relevant instrument details.

Response Body Schema

{
"type": "object",
"properties": {
"instruments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"instrument_token": {
"type": "integer"
},
"exchange_token": {
"type": "string"
},
"tradingsymbol": {
"type": "string"
},
"name": {
"type": "string"
},
"last_price": {
"type": "string"
},
"expiry": {
"type": "string"
},
"strike": {
"type": "string"
},
"tick_size": {
"type": "string"
},
"lot_size": {
"type": "string"
},
"instrument_type": {
"type": "string"
},
"segment": {
"type": "string"
},
"exchange": {
"type": "string"
}
}
}
},
"totalCount": {
"type": "integer"
}
}
}

Examples

Example 1: Search by exact trading Symbol

Example 1.1: Search for reliance

import { searchInstruments } from "@stockseyes/market-pulse";
const searchInstrumentResponse = await searchInstruments(
{
"filterRequest": {
"tradingsymbol": ["RELIANCE"]
},
"searchPatterns": {},
"paginationDetails": {
"offset": 0,
"limit": 5
}
}
)
Response
{
"instruments": [
{
"instrument_token": 128083204,
"exchange_token": "500325",
"tradingsymbol": "RELIANCE",
"name": "RELIANCE INDUSTRIES",
"last_price": "0",
"expiry": "",
"strike": "0",
"tick_size": "0.05",
"lot_size": "1",
"instrument_type": "EQ",
"segment": "BSE",
"exchange": "BSE"
},
{
"instrument_token": 738561,
"exchange_token": "2885",
"tradingsymbol": "RELIANCE",
"name": "RELIANCE INDUSTRIES",
"last_price": "0",
"expiry": "",
"strike": "0",
"tick_size": "0.05",
"lot_size": "1",
"instrument_type": "EQ",
"segment": "NSE",
"exchange": "NSE"
}
],
"totalCount": 2
}

Example 2: Search by fuzzy trading Symbol

// TODO: Add more examples