Overview
Introduction
Binary Market Data combines RESTful APIs with Socket.IO–based streaming to deliver high-performance real-time market feeds. It offers fast, reliable data essential for building responsive stock-market and trading platforms. Designed for efficiency, it ensures low latency, low bandwidth consumption, and a robust streaming experience, enabling seamless real-time market visualization and analytics.
API Environment URLs
Libraries and SDKs
Symphony provides ready-to-use client libraries and SDKs in multiple languages. These libraries simplify authentication, request handling, and integration with Symphony APIs.
Symphony Python Library
Obtain Your API Credentials
How to Get Access to XTS Binary Marketdata API Services
To access XTS Binary Marketdata API services, you need a public key. Follow these steps:
-
Register on the Broker’s API Dashboard
- - Visit your broker’s API dashboard page.
- - Register yourself as an API user.
-
Verify Your Email
- - After registration, you’ll receive a verification link via email.
- - Click the link to validate your email ID.
- - You will be redirected to the login page.
-
Subscribe to the API Service
- - Log in to the API dashboard: https://developers.symphonyfintech.in/dashboard
- - Select Binary Marketdata API subscription and provide the required details.
- - Wait for an approval email from the broker’s support team.
-
Receive Your API Keys
- - Once approved, you’ll get an email containing your appKey and secretKey.
- - Keep these keys safe for future use.
-
Important Notes
- - Only One session is allowed per appKey–secretKey combination.
- - Do not share your keys with others.
- - If you suspect your keys are compromised, log in to the API dashboard and regenerate new keys then update them in your source code or configuration.
How To Access XTS Binary Marketdata API Services
RegisterAuthentication Token Requirement
For all API requests except the login API, an authentication token must be included in the request header.
-
The token is generated only after a successful user login .
-
It remains valid for 24 hours from the time of generation. .
-
After the validity period, the token will expire and must be refreshed by logging in again.
Headers: Content-Type: application/json authorization: eyJ1c2VySUQiOiJSVVBFU0giLCJpYXQiOjE1NTIxMjIwOTEsImV4cCI6MTU1MjIwODQ5MX0
Request & Response Structure
All GET and DELETE request parameters go as query parameters, and POST and PUT parameters as form-encoded. The user has to input an authorization in the header for every request. All request parameters as application/json parameters. Responses from the API will be in JSON
Successful request:
HTTP/1.1 200 OK Content-Type: application/json { "type": "success", "code": "status code", "description": "description message", "result": {} }
All responses from the API server are JSON with the content-type application/json unless explicitly stated otherwise. A successful 200 OK response always has a JSON response body with a status key with the value success. The result key contains the full response payload.
Failed request:
HTTP/1.1 400 Server Error Content-Type: application/json { "type": "error", "code": "error code", "description": "error message" }
Error Handling
Common HTTP error codes
| Code | Error Description |
|---|---|
| 400 | Missing or bad request parameters or values |
| 404 | Request resource was not found |
| 429 | Too many requests to the API (rate limiting) |
| 500 | Something unexpected went wrong |
Enums with Numeric Constants
Each Enum now includes its corresponding numeric constant for easier mapping in client applications.
1. ExchangeSegments
| Enum Name | Numeric Code | Description |
|---|---|---|
| NSECM | 1 |
The equity cash segment of NSE where stocks of listed companies are traded for delivery or intraday. |
| NSEFO | 2 |
Derivatives segment of NSE where equity futures, index futures, and options contracts are traded. |
| NSECD | 3 |
Currency trading segment at NSE for exchange-traded currency futures and options (USD/INR, EUR/INR, etc.) |
| NSECO | 4 |
The commodity derivatives segment of NSE where agricultural and non-agricultural commodities are traded via futures and options contracts. |
| BSECM | 11 |
Cash/equity segment of BSE, the oldest stock exchange in Asia, where stocks are bought and sold. |
| BSEFO | 12 |
Derivatives segment of BSE offering equity derivatives, index derivatives, and stock futures/options. |
| BSECD | 13 |
Currency derivatives platform of BSE that allows trading in exchange-listed currency futures and options. |
| MCXFO | 51 |
Derivatives trading segment of MCX for commodities such as gold, silver, crude oil, natural gas, and agricultural products. |
| NCDEX | 21 |
A leading exchange focused on agricultural commodity futures like soybean, chana, guar, and other agri-products. |
2. MarketType
| Enum Name | Numeric Code | Description |
|---|---|---|
| Normal | 1 |
Regular trading segment where standard lot sizes apply and continuous trading happens. |
| Oddlot | 2 |
Trading of quantities less than the standard lot size (e.g., 1 share when lot size is 10). |
| Retaildebt | 3 |
Segment meant for retail investors to trade debt instruments like bonds, NCDs, and G-Secs. |
| Auction | 4 |
Special session used for buy-in / sell-out when obligations are not met (e.g., short delivery). |
| CallAuction1 | 5 |
First call auction session where orders are collected, matched, and executed at a single equilibrium price. |
| CallAuction2 | 6 |
Second call auction session, usually used for price discovery, illiquid stocks, or special scenarios. |
3. InstrumentType
| Enum Name | Numeric Code | Description |
|---|---|---|
| Futures | 1 |
Derivative contracts to buy or sell an asset at a fixed price on a future date. |
| Options | 2 |
Derivative contracts giving the right (not obligation) to buy or sell an asset at a specified price before/on expiry. |
| Spread | 4 |
A strategy instrument representing simultaneous buy & sell of related contracts (e.g., calendar or inter-commodity spreads). |
| Equity | 8 |
Ownership instruments representing shares of a company. |
| Spot | 16 |
Instruments traded for immediate settlement (cash/spot market). |
| PreferenceShares | 32 |
Shares with fixed dividend priority over equity shares but limited/no voting rights. |
| Debentures | 64 |
Debt instruments issued by companies to raise capital, typically with fixed interest. |
| Warrants | 128 |
Instruments giving the right to buy equity shares at a predetermined price within a specified time. |
| Miscellaneous | 256 |
Instruments that do not fall into standard categories or are exchange-defined special cases. |
| MutualFund | 512 |
Investment vehicles that pool money from investors to invest in diversified assets. |
4. XTS Message Code
| Enum Name | Numeric Code | Description |
|---|---|---|
| TouchLineEvent | 1501 |
Provides top-of-book data — best bid price & quantity and best ask price & quantity. |
| MarketDepthEvent | 1502 |
Delivers order book depth data (multiple bid/ask levels beyond the touchline). |
| CandleDataEvent | 1505 |
Supplies OHLCV candle data for a specified interval (e.g., 1m, 5m, daily). |
| OpenInterestEvent | 1510 |
Publishes open interest changes for derivative instruments, indicating active positions. |
5. Exchange Trading Session
| Enum Name | Numeric Code | Description |
|---|---|---|
| PreOpenStart | 0 |
The pre-open session has started. Order entry/modification allowed for price discovery. |
| PreOpenEnd | 1 |
The pre-open session has ended. Orders are frozen and matched. |
| NormalStart | 2 |
Regular market trading sessions have started (continuous trading). |
| NormalEnd | 4 |
The regular market trading session has ended. No new trades allowed. |
| PostClosingStart | 8 |
Post-closing session has started (trade confirmation, reporting, limited actions). |
| PostClosingEnd | 16 |
The post-closing session has ended. |
| Closed | 32 |
The market is fully closed (no trading activity). |
| None | 256 |
None above this. |
6. Exchange Market Type
| Enum Name | Numeric Code | Description |
|---|---|---|
| Normal | 1 |
Regular trading segment where standard lot sizes apply and continuous trading happens. |
| OddLot | 2 |
Trading of quantities less than the standard lot size (e.g., 1 share when lot size is 10). |
| RetailDebt | 3 |
Segment meant for retail investors to trade debt instruments like bonds, NCDs, G-Secs. |
| Auction | 4 |
Special session used for buy-in / sell-out when obligations are not met (e.g., short delivery). |
| CallAuction1 | 5 |
First call auction session where orders are collected, matched, and executed at a single equilibrium price. |
| CallAuction2 | 6 |
Second call auction session, usually used for price discovery, illiquid stocks, or special scenarios. |
7. CallAuction Type
| Enum Name | Numeric Code | Description |
|---|---|---|
| NonCallAuction | 0 |
Regular non-call auction trading where orders are matched continuously (price–time priority). |
| PreOpen | 1 |
Pre-open session used for order collection and price discovery before normal market opens. |
| IPOPreOpen | 2 |
Special pre-open session for IPOs, used to discover opening price on the listing day. |
| RelistPreOpen | 3 |
Pre-open session for re-listed securities (e.g., after suspension, merger, restructuring). |
| Illiquid | 4 |
Market segment for illiquid securities, often traded via call auctions to improve price discovery. |
| SME | 5 |
Market segment for Small and Medium Enterprises, with distinct trading and settlement rules. |
| SCAS | 6 |
Special Call Auction Session used in exceptional cases such as volatility control, surveillance actions, or regulatory intervention. |
8. BookType
| Enum Name | Numeric Code | Description |
|---|---|---|
| None | 0 |
No specific order book type applicable. |
| Regular | 1 |
Standard continuous trading order book for normal market orders. |
| SpecialTerms | 2 |
Orders executed under special settlement or contract terms defined by the exchange. |
| StopLoss | 3 |
Order book for stop-loss / trigger-based orders, activated when trigger price is hit. |
| Negotiated | 4 |
Book for privately negotiated trades reported to the exchange. |
| OddLot | 5 |
Order book for odd-lot quantities (less than normal lot size). |
| Spot | 6 |
Book for spot market trades with immediate or short settlement. |
| Auction | 7 |
Book used during auction sessions (buy-in, sell-out, surveillance auctions). |
| CallAuction1 | 11 |
First call the auction order book for price discovery. |
| CallAuction2 | 12 |
Second call auction order book for subsequent matching. |
9. OptionType
| Enum Name | Numeric Code | Description |
|---|---|---|
| CA | 1 |
Corporate Action — events initiated by a company that impact securities. |
| PA | 2 |
Product Action / Portfolio Action — exchange or system-driven actions affecting instruments or positions. |
| CE | 3 |
Call Option — option giving the right to buy the underlying at the strike price on expiry. |
| PE | 4 |
Put Option — option giving the right to sell the underlying at the strike price on expiry. |
| None | 5 |
No specific action or option type applicable. |
10. PublishFormat
| Enum Name | Numeric Code | Description |
|---|---|---|
| Binary | 1 |
Market data is published in binary-encoded format for low latency, high throughput consumption. |
| JSON | 2 |
Market data is published in JSON (text) format, making it human-readable and easy to parse. |
11. BroadCastMode
| Enum Name | Numeric Code | Description |
|---|---|---|
| Full | 1 |
The server broadcasts the complete dataset to subscribers in JSON format. |
| Partial | 2 |
The server broadcasts the complete dataset to subscribers but in | (Pipe) separated and trimmed format. |
12. Socket Event
| Enum Name | Description |
|---|---|
| joined |
Websocket Joined acknowledgement |
| error |
Erro during Websocket connection |
| warning |
Warning message |
| success |
Success Response |
Data Types & Business Rules
All data types now use business-oriented names, specify allowed sizes, and clearly state any validation rules.
| Field Name | Data Type | Size | Description |
|---|---|---|---|
| SecretKey | String | 20 |
The predefined secret key assigned to the client. |
| AppKey | String | 20 |
The application key used for authentication. |
| Token | String | 500 |
The authentication token used with every subsequent request. |
| UserID | String | 15 |
UserID of investor client. |
| AppVersion | String | 50 |
Marketdata app version. |
| Application_Expiry_Date | String | 50 |
User application expiry date. |
| ExchangeSegments | Integer | 2 |
Exchange Segment
|
| XtsMessageCode | Integer | 5 |
XTS Message Code
|
| ExchangeInstrumentID | Integer | 10 |
Exchange Scrip code or Symbol Token is unique identifier. |
| PublishFormat | String | 10 |
PublishFormat
|
| BroadCastMode | String | 10 |
BroadCastMode
|
| InstrumentType | Integer | 2 |
InstrumentType
|
| LastTradedPrice | Double | (15,4) |
The price at which the most recent trade for the instrument was executed. |
| LastTradedQuantity | Integer | 10 |
The quantity traded in the most recent transaction. |
| TotalBuyQuantity | Integer | 10 |
The total quantity of buy orders currently available in the market. |
| TotalSellQuantity | Integer | 10 |
The total quantity of sell orders currently available in the market. |
| TotalTradedQuantity | Integer | 10 |
The cumulative quantity of the instrument traded during the trading session. |
| AverageTradedPrice | Double | (15,4) |
The volume-weighted average price (VWAP) of all trades executed during the trading session. |
| LastTradedTime | Long | 15 |
The timestamp at which the most recent trade occurred (exchange time). |
| LastUpdateTime | Long | 15 |
The timestamp of the latest market data update received from the exchange. |
| PercentChange | Double | (15,4) |
The percentage change in price compared to the previous close. |
| Open | Double | (15,4) |
The price at which the instrument first traded when the market opened for the session. |
| High | Double | (15,4) |
The highest traded price of the instrument during the trading session. |
| Low | Double | (15,4) |
The lowest traded price of the instrument during the trading session. |
| Close | Double | (15,4) |
The most recent traded price or the official closing price of the session. |
| TotalValueTraded | Double | (15,4) |
The total traded value during the session, calculated as price × quantity for all trades. |
| BuyBackTotalBuy | Integer | 10 |
The total buy quantity placed under buy-back activity (exchange-specific). |
| BuyBackTotalSell | Integer | 10 |
The total sell quantity placed under buy-back activity (exchange-specific). |
| BookType | Integer | 10 |
BookType
|
| XMarketType | Integer | 10 |
XMarketType
|
| Name | String | 50 |
The official symbol or short name of the instrument as defined by the exchange. |
| DisplayName | String | 50 |
A user-friendly name of the instrument used for display purposes in applications. |
| Symbol | String | 50 |
Exchange-defined trading code used to identify an instrument. |
| Description | String | 50 |
A detailed description of the instrument, including company or contract details. |
| ExpiryDate | String | 20 |
ExpiryDate represents the date on which a derivative contract (futures or options) expires and is settled as per exchange rules. |
| Series | String | 50 |
The exchange-defined series under which the instrument is listed (e.g., EQ, BL, A). |
| NameWithSeries | String | 50 |
The instrument name appended with its series (e.g., RELIANCE-EQ). |
| InstrumentID | Integer | 10 |
A unique system-generated identifier assigned to the instrument by the exchange or trading system. |
| CreditRating | String | 50 |
The credit rating assigned to the instrument, if applicable (typically for debt instruments). |
| HighString | String | 50 |
The upper price band is represented as a formatted string. |
| LowString | String | 50 |
The lower price band is represented as a formatted string. |
| HighExecBandString | String | 50 |
The upper execution price band displayed as a formatted string. |
| LowExecBandString | String | 50 |
The lower execution price band displayed as a formatted string. |
| TERRange | String | 50 |
Denotes the trading exposure range or price/quantity limit range applicable for the instrument. |
| FreezeQty | Integer | 10 |
The maximum order quantity allowed per order for the instrument. |
| TickSize | Double | (15,4) |
The minimum price movement allowed for the instrument. |
| LotSize | Integer | 10 |
The minimum tradable quantity for the instrument. |
| UnderlyingInstrumentId | Integer | 10 |
The unique instrument identifier of the underlying asset for a derivative contract. |
| UnderlyingIndexName | String | 50 |
The name of the underlying index on which the derivative contract is based. |
| ContractExpiration | String | 50 |
The date on which a derivatives contract expires. After this date, the contract ceases to exist for trading. |
| ContractExpirationString | String | 50 |
The contract expiration date represented as a formatted string, as defined by the exchange. |
| RemainingExpiryDays | Integer | 10 |
The number of calendar days remaining until the contract expires. |
| OptionType | Integer | 10 |
OptionType
|
| StrikePrice | Double | (15,4) |
The strike price is the predetermined price at which the buyer of an options contract can buy or sell the underlying asset. |
| AGM | Boolean | 5 |
Indicates if an Annual General Meeting is scheduled for the company. |
| AllOrNone | Boolean | 5 |
Indicates if the order must be executed fully or not at all. |
| Bonus | Boolean | 5 |
Bonus shares declared per existing share. |
| Dividend | Boolean | 5 |
Dividend amount declared per share. |
| EGM | Boolean | 5 |
Indicates if an Extraordinary General Meeting is scheduled. |
| AuctionNumber | Integer | 10 |
Unique identifier for a specific auction. |
| AuctionStatus | Integer | 10 |
Current status of an auction. |
| InitiatorType | Integer | 10 |
Type of entity initiating the auction or corporate action. |
| SettlementPeriod | Integer | 10 |
Number of days for settlement of trades. |
| TotalBuyQty | Integer | 10 |
Total buy quantity in the auction or order book. |
| TotalSellQty | Integer | 10 |
Total sell quantity in the auction or order book. |
| AuctionQty | Integer | 10 |
Quantity allocated in the auction. |
| AuctionPrice | Double | (15,4) |
Price at which auction quantity is settled. |
| BestBuyPrice | Double | (15,4) |
Highest buy price currently available in the stock. |
| BestSellPrice | Double | (15,4) |
Lowest sell price currently available in the stock. |
| ELMargin | Double | (15,4) |
Extreme Loss Margin required for the instrument. |
| Interest | Boolean | 10 |
Interest rate applicable to a debt instrument or derivative. |
| ISIN | String | 15 |
International Securities Identification Number, unique per security. |
| MinimumFill | Boolean | 5 |
Minimum quantity that can be executed in a single order. |
| Rights | Boolean | 5 |
Number of rights shares issued per existing share. |
| VaRMargin | Double | (15,4) |
Total capital issued by the company. |
| IssuedCapital | Integer | 10 |
Total capital issued by the company. |
| BoardLotQuantity | Integer | 10 |
Minimum number of units that can be traded in one lot. |
| FaceValue | Integer | 10 |
Face value of the security per unit/share. |
| Spread | Integer | 10 |
Difference between best buy and sell price. |
| CallAuction1Flag | Boolean | 5 |
Indicates if a first call auction is applicable. |
| GSMIndicator | Integer | 10 |
Indicator for market segments or trading type. |
| MinimumQty | Integer | 10 |
Minimum tradable quantity for the instrument. |
| QuantityMultiplier | Integer | 10 |
Multiplier applied to quantity for derivatives/contracts. |
| PriceNumerator | Integer | 10 |
Numerator for representing price fractions. |
| PriceDenominator | Integer | 10 |
Denominator for representing price fractions. |
| SymbolType | Integer | 20 |
Symbol classification type (e.g., Common, Preferred). |
| CfiCode | String | 50 |
Classification of Financial Instruments code. |
| Status | String | 50 |
Current status of the instrument (Active, Inactive). |
| TicksPerPoint | Integer | 10 |
Number of ticks per point for price movement. |
| IsImpliedMarket | Double | (15,4) |
Indicates if the market is derived from implied instruments. |
| IsTradeable | Boolean | 5 |
Indicates if the instrument is currently tradeable. |
| MaxTradeVolume | Long | 15 |
Maximum allowed trade volume per order. |
| DecimalDisplace | Integer | 10 |
Number of decimal places used for pricing. |
| Eligible | Boolean | 5 |
Indicates if the instrument is eligible for trading. |
| TradingStatus | Integer | 10 |
Current trading status (Active, Suspended, Halted). |
| DisplayNameWithExchange | String | 50 |
Display name including exchange information. |
| FiftyTwoWeekHigh | Double | (15,4) |
Highest price of the instrument in the past 52 weeks. |
| FiftyTwoWeekLow | Double | (15,4) |
Lowest price of the instrument in the past 52 weeks. |
| TotTrdQty | Long | 15 |
Total traded quantity in the session. |
| TotTrdVal | Double | (15,4) |
Total traded value in the session. |
| TimeStamp | String | 50 |
Timestamp of the data snapshot. |
| TotalTrades | Long | 15 |
Total number of trades executed in the session. |
| OpenInterest | Double | (15,4) |
Open interest for derivatives contracts. |
| SettlementPrice | Double | (15,4) |
Price used for settlement of derivatives contracts. |
| AdditionalPreExpiryMarginPerc | Double | (15,4) |
Additional margin percentage applicable before expiry. |
| AdditionalMarginPercLong | Double | (15,4) |
Additional margin percentage for long positions. |
| AdditionalMarginPercShort | Double | (15,4) |
Additional margin percentage for short positions. |
| DeliveryMarginPerc | Double | (15,4) |
Margin percentage required for delivery-based trades. |
| SpecialMarginPercBuy | Double | (15,4) |
Special margin percentage for buying positions. |
| SpecialMarginPercSell | Double | (15,4) |
Special margin percentage for selling positions. |
| TenderMargin | Double | (15,4) |
Margin required for participating in tender offers. |
| ELMLongMargin | Double | (15,4) |
Extreme loss margin for long positions. |
| ELMShortMargin | Double | (15,4) |
Extreme loss margin for short positions. |
| InitialMarginPerc | Double | (15,4) |
Initial margin percentage for derivatives contracts. |
| ExposureMarginPerc | Double | (15,4) |
Margin based on exposure limit. |
| CallAuctionIndicator | Integer | 10 |
Indicates if the instrument is part of a call auction. |
| CurrentEligibleMarketType | Integer | 10 |
Market types the instrument is eligible for currently. |
| InstrumentLazyLoader | Integer | 10 |
Indicates if instrument data is loaded lazily for performance. |
| StartTime | String | 30 |
The starting timestamp from which OHLC data should be retrieved. |
| EndTime | String | 30 |
The ending timestamp up to which OHLC data should be retrieved. |
| CompressionValue | String | 30 |
The interval or granularity of OHLC data. |
Auth
Login (POST)
You can log in to the application using the POST /auth/login request. You will receive a token parameter in the response, which must be used in subsequent requests. All request bodies should have the content type application/json and contain valid JSON.
URL
Request Body Parameters
| Parameter Name | Type | Mandatory | Description |
|---|---|---|---|
| secretKey |
SecretKey
|
Y |
The predefined secret key assigned to the client. |
| appKey |
AppKey
|
Y |
Api Version number of the server. |
Request Body JSON
{
"secretKey": "Doqg107#6V",
"appKey": "3064470037e8c577",
}
Response Body Parameters
| Parameter Name | Type | Description |
|---|---|---|
| token |
Token
|
The authentication token used with every subsequent request, unless it is invalidated by the logout API. |
| userID |
UserID
|
UserID of the Dashboard. |
| appVersion |
AppVersion
|
Marketdata app version. |
| application_expiry_date |
ApplicationExpiryDate
|
Application expiry date. |
Response Body JSON
[ { "type": "success", "code": "s-response-0001", "description": "Provided Valid Credentials", "result": { "token": "eyJ1c2VySWQiOiJDSEFVEFMSSIsInB1YmxpY0tleSI6IjMwNjQ0NzdlOGM1NzciLCJpYXQiOjE1NTI0Nzk0NjEsImV4cCI6MTU1MzE1MjMxMX0", "userID": "ABC", "appVersion": "5.0.15", "application_expiry_date": "29-09-2026" } } ]
Logout (DELETE)
You can log out of the application using the delete /auth/logout request. You need to pass the authorization token in the request. You will receive a success status code in the response.
URL
Response Body JSON
[
{
"type": "success",
"code": "s-response-0001",
"description": "successfully logout"
}
]
ClientConfig (GET)
You can get the client's configuration information using the GET /config/client
request.
You will receive the configuration details in the response. Currently, the API returns enums related
to
exchange segments and message codes.
Following are the exchangesegments and messageCodes maintained at our application level:
exchangeSegments:-{"NSECM": 1, "NSEFO": 2, "NSECD": 3, "BSECM": 11, "BSEFO": 12},
messageCode:- {"touchlineEvent": 1501, "marketDepthEvent": 1502, "candleDataEvent": 1505,
"OIDataEvent": 1510}.
You need to pass authorization or token to the request.
Note: Calling of this API is optional.
URL
Response Body Parameters
| Parameter Name | Type | Description |
|---|---|---|
| exchangeSegments | ExchangeSegment |
ExchangeSegment
|
| xtsMessageCode | XTSMessageCode |
XTSMessageCode
|
| publishFormat | PublishFormat |
PublishFormat
|
| broadCastMode | BroadCastMode |
BroadCastMode
|
| instrumentType | InstrumentType |
InstrumentType
|
Response Body JSON
[ { "type": "success", "code": "s-response-0001", "description": "Fetched configurations successfully", "result": { "exchangeSegments": { "NSECM": 1, "NSEFO": 2, "NSECD": 3, "BSECM": 11, "BSEFO": 12, "BSECD": 13 }, "xtsMessageCode": { "TouchLineEvent": 1501, "MarketDepthEvent": 1502, "CandleDataEvent": 1505, "OpenInterestEvent": 1510 }, "publishFormat": [ "Binary", "JSON" ], "broadCastMode": [ "Binary", "JSON" ], "instrumentType": { "Futures": 1, "Options": 2, "Spread": 4, "Equity": 8, "Spot": 16, "PreferenceShares": 32, "Debentures": 64, "Warrants": 128, "Miscellaneous": 256, "MutualFund": 512 } } } ]
Search
Instruments By ID (POST)
You can search for instruments by using the POST /search/instrumentsbyid
request.
In the response, you will receive the
instrument details based on the instrumentID provided in the request.
The request body must have the content type application/json and must contain
valid
JSON.
URL
Request Body Parameters
| Parameter Name | Type | Mandatory | Description |
|---|---|---|---|
| instruments | Array | Y | Array of instrument objects |
| exchangeSegment |
ExchangeSegment
|
Y | ExchangeSegment |
| exchangeInstrumentID |
ExchangeInstrumentID
|
Y | Exchange Scrip code or Symbol Token is unique identifier |
Response Body Parameters
| Parameter Name | Type | Description |
|---|---|---|
| AGM |
AGM
|
Indicates if an Annual General Meeting is scheduled for the company |
| AllOrNone |
AllOrNone
|
Indicates if the order must be executed fully or not at all. |
| Bonus |
Bonus
|
Bonus shares declared per existing share. |
| Dividend |
Dividend
|
Dividend amount declared per share. |
| EGM |
EGM
|
Indicates if an Extraordinary General Meeting is scheduled. |
| AuctionDetailInfo | Object | Additional details about an auction event. |
| AuctionNumber |
AuctionNumber
|
Unique identifier for a specific auction. |
| AuctionStatus |
AuctionStatus
|
Current status of an auction. |
| InitiatorType |
InitiatorType
|
Type of entity initiating the auction or corporate action. |
| SettlementPeriod |
SettlementPeriod
|
Number of days for settlement of trades. |
| TotalBuyQty |
TotalBuyQty
|
Total buy quantity in the auction or order book. |
| TotalSellQty |
TotalSellQty
|
Total sell quantity in the auction or order book. |
| AuctionQty |
AuctionQty
|
Quantity allocated in the auction. |
| AuctionPrice |
AuctionPrice
|
Price at which auction quantity is settled. |
| BestBuyPrice |
BestBuyPrice
|
Highest buy price currently in the stock |
| BestSellPrice |
BestSellPrice
|
Lowest sell price currently in the stock |
| ELMargin |
ELMargin
|
Extreme Loss Margin required for the instrument. |
| Interest |
Interest
|
Interest rate applicable to a debt instrument or derivative |
| ISIN |
ISIN
|
International Securities Identification Number, unique per security. |
| MinimumFill |
MinimumFill
|
Minimum quantity that can be executed in a single order. |
| Rights |
Rights
|
Number of rights shares issued per existing share. |
| IssuedCapital |
IssuedCapital
|
Total capital issued by the company. |
| BoardLotQuantity |
BoardLotQuantity
|
Minimum number of units that can be traded in one lot. |
| FaceValue |
FaceValue
|
Face value of the security per unit/share. |
| Spread |
Spread
|
Difference between best buy and sell price. |
| CallAuction1Flag |
CallAuction1Flag
|
Indicates if a first call auction is applicable. |
| GSMIndicator |
GSMIndicator
|
Indicator for market segments or trading type. |
| InstrumentID |
InstrumentID
|
Unique identifier for the instrument in the system. |
| ExchangeInstrumentID |
ExchangeInstrumentID
|
Identifier of the instrument as per the exchange. |
| DisplayName |
DisplayName
|
Name of the instrument as displayed in UI. |
| Name |
Name
|
The official symbol or short name of the instrument as defined by the exchange. |
| AuctionNumber |
AuctionNumber
|
Unique identifier for a specific auction. |
| MinimumQty |
MinimumQty
|
Minimum tradable quantity for the instrument. |
| QuantityMultiplier |
QuantityMultiplier
|
Multiplier applied to quantity for derivatives/contracts. |
| PriceNumerator |
PriceNumerator
|
Numerator for representing price fractions. |
| PriceDenominator |
PriceDenominator
|
Denominator for representing price fractions. |
| LotSize |
LotSize
|
Number of units per lot. |
| InstrumentType |
InstrumentType
|
Type of instrument (Equity, Option, Future, etc.). |
| SymbolType |
SymbolType
|
Symbol classification type (e.g., Common, Preferred). |
| CfiCode |
CfiCode
|
Classification of Financial Instruments code. |
| Status |
Status
|
Current status of the instrument (Active, Inactive). |
| TicksPerPoint |
TicksPerPoint
|
Number of ticks per point for price movement. |
| TickSize |
TickSize
|
Minimum price movement allowed for the instrument. |
| Description |
Description
|
Additional description of the instrument. |
| IsImpliedMarket |
IsImpliedMarket
|
Indicates if the market is derived from implied instruments. |
| IsTradeable |
IsTradeable
|
Indicates if the instrument is currently tradeable. |
| ExchangeSegment |
ExchangeSegment
|
ExchangeSegment |
| Series |
Series
|
The exchange-defined series under which the instrument is listed (e.g., EQ, BL, A). |
| MaxTradeVolume |
MaxTradeVolume
|
Maximum allowed trade volume per order. |
| PriceBand | Object | Object containing high and low price limits for the instrument. |
| High |
High
|
Highest price of the instrument in the trading session. |
| Low |
Low
|
Lowest price of the instrument in the trading session. |
| DecimalDisplace |
DecimalDisplace
|
Number of decimal places used for pricing. |
| ExtendedMarketProperties | Object | Additional properties related to extended trading sessions. |
| CallAuctionIndicator | Object | Indicates if the instrument is in a call auction. |
| ExpulsionDate | Object | Date when the instrument is expelled from the exchange. |
| IssueMaturityDate | Object | Maturity date for debt instruments. |
| ReAdmissionDate | Object | Date when the instrument is readmitted to trading. |
| CorporateAction | Object | Type of corporate action applicable (Bonus, Dividend, Split). |
| NoDeliveryEndDate | Object | End date of no-delivery period for corporate action. |
| IssueRate | Object | Rate of issue for debt instruments or IPOs. |
| SettlementNo | Object | Settlement number associated with the trade or contract. |
| InterestPaymentDate | Object | Date on which interest is paid for debt instruments. |
| ListingDate | Object | Date when the instrument was listed on the exchange. |
| CompanyName | Object | Name of the issuing company. |
| UniqueKey | Object | Unique identifier for the instrument across systems. |
| CreditRating | Object | Credit rating of the instrument or issuer. |
| RecordDate | Object | Date on which shareholders are recorded for corporate actions. |
| NoDeliveryStartDate | Object | Start date of no-delivery period for corporate actions. |
| MarketType | Object | Type of market segment (Normal, Auction, OddLot, etc.). |
| BookClosureStartDate | Object | Start date of book closure period for corporate actions. |
| ExDate | Object | Ex-dividend or ex-rights date. |
| WarningPercent | Object | Warning percentage for price movement alerts. |
| IssueStartDate | Object | Start date for issuance of new shares or debt. |
| BookClosureEndDate | Object | End date of book closure period. |
| Remarks | Object | Additional remarks or notes related to the instrument. |
| MarketTypeStatusEligibility | Object | Eligibility status for a particular market type. |
| Normal | Object | Indicates if the instrument is eligible for normal trading. |
| OddLot | Object | Indicates if odd-lot trading is allowed. |
| RetailDebt | Object | Indicates if the instrument is a retail debt security. |
| Auction | Object | Indicates if the instrument is part of an auction. |
| CallAuction1 | Object | Flag for first call auction participation. |
| CallAuction2 | Object | Flag for second call auction participation. |
| MarketType |
MarketType
|
Current market type of the instrument. |
| Eligible |
Eligible
|
Indicates if the instrument is eligible for trading. |
| TradingStatus |
TradingStatus
|
Current trading status (Active, Suspended, Halted). |
| NameWithSeries |
NameWithSeries
|
Name combined with series for display purposes. |
| DisplayNameWithExchange |
DisplayNameWithExchange
|
Display name including exchange info. |
| FreezeQty |
FreezeQty
|
Quantity frozen/unavailable for trading. |
| LastUpdateTime |
LastUpdateTime
|
Last update time of the instrument data. |
| FiftyTwoWeekHigh |
FiftyTwoWeekHigh
|
Highest price of the instrument in the past 52 weeks. |
| FiftyTwoWeekLow |
FiftyTwoWeekLow
|
Lowest price of the instrument in the past 52 weeks. |
| Bhavcopy | Object | Snapshot or file reference of daily trading data. |
| Open |
Open
|
Opening price of the instrument for the trading session. |
| High |
High
|
Highest price during the trading session. |
| Low |
Low
|
Lowest price during the trading session. |
| Close |
Close
|
Closing price of the instrument for the session. |
| TotTrdQty |
TotTrdQty
|
Total traded quantity in the session. |
| TotTrdVal |
TotTrdVal
|
Total traded value in the session. |
| TimeStamp |
TimeStamp
|
Timestamp of the data snapshot. |
| TotalTrades |
TotalTrades
|
Total number of trades executed in the session. |
| OpenInterest |
OpenInterest
|
Open interest for derivatives contracts. |
| SettlementPrice |
SettlementPrice
|
Price used for settlement of derivatives contracts. |
| AdditionalPreExpiryMarginPerc |
AdditionalPreExpiryMarginPerc
|
Additional margin percentage applicable before expiry. |
| AdditionalMarginPercLong |
AdditionalMarginPercLong
|
Additional margin percentage for long positions. |
| AdditionalMarginPercShort |
AdditionalMarginPercShort
|
Additional margin percentage for short positions. |
| DeliveryMarginPerc |
DeliveryMarginPerc
|
Margin percentage required for delivery-based trades. |
| SpecialMarginPercBuy |
SpecialMarginPercBuy
|
Special margin percentage for buying positions. |
| SpecialMarginPercSell |
SpecialMarginPercSell
|
Special margin percentage for selling positions. |
| TenderMargin |
TenderMargin
|
Margin required for participating in tender offers. |
| ELMLongMargin |
ELMLongMargin
|
Extreme loss margin for long positions. |
| ELMShortMargin |
ELMShortMargin
|
Extreme loss margin for short positions. |
| InitialMarginPerc |
InitialMarginPerc
|
Initial margin percentage for derivatives contracts. |
| ExposureMarginPerc |
ExposureMarginPerc
|
Margin based on exposure limit. |
| CallAuctionIndicator | Object | Indicates if the instrument is part of a call auction. |
| MarketType |
MarketType
|
Current market type for trading. |
| CurrentEligibleMarketType |
CurrentEligibleMarketType
|
Market types the instrument is eligible for currently. |
| InstrumentLazyLoader |
InstrumentLazyLoader
|
Indicates if instrument data is loaded lazily for performance. |
Response Body JSON
[
{
"type": "success",
"code": "s-response-0001",
"description": "Instruments Found",
"result": {
"AGM": false,
"AllOrNone": true,
"Bonus": true,
"Dividend": true,
"EGM": true,
"AuctionDetailInfo": {
"AuctionNumber": 0,
"AuctionStatus": 0,
"InitiatorType": 0,
"SettlementPeriod": 0,
"TotalBuyQty": 0,
"TotalSellQty": 0,
"AuctionQty": 0,
"AuctionPrice": 0,
"BestBuyPrice": 0,
"BestSellPrice": 0
},
"ELMargin": 5,
"Interest": true,
"ISIN": "INE012A01025",
"MinimumFill": true
"Rights": true,
"VaRMargin": 10.28,
"IssuedCapital": 8924587534,
"BoardLotQuantity": 0,
"FaceValue": 100,
"Spread": 0,
"CallAuction1Flag": false,
"GSMIndicator": 0,
"InstrumentID": 1100100003045,
"ExchangeInstrumentID": 22,
"DisplayName": "ACC",
"Name": "ACC",
"AuctionNumber": 0,
"MinimumQty": 0,
"QuantityMutliplier": 1,
"PriceNumerator": 1,
"PriceDenominator": 1,
"LotSize": 1,
"InstrumentType": 8,
"SymbolType": 0,
"CfiCode": "ESXXXX",
"Status": "ESXXXX",
"TicksPerPoint": 20,
"TickSize": 0.05,
"Description": "ACC LIMITED-EQ",
"IsImpliedMarket": false,
"IsTradeable": false,
"ExchangeSegment": 1,
"Series": "EQ",
"MaxTradeVolume": 2147483647,
"PriceBand": {
"High": 330.45,
"Low": 270.45
},
"DecimalDisplace": 2,
"ExtendedMarketProperties": {
"CallAuctionIndicator": {
"Name": "CallAuctionIndicator",
"Value": ""
},
"ExpulsionDate": {
"Name": "ExpulsionDate",
"Value": "01Jan1980"
},
"IssueMaturityDate": {
"Name": "IssueMaturityDate",
"Value": "01Jan1980"
},
"ReAdmissionDate": {
"Name": "ReAdmissionDate",
"Value": "01Jan1980"
},
"CorporateAction": {
"Name": "CorporateAction",
"Value": "01Jan1980"
},
"NoDeliveryEndDate": {
"Name": "NoDeliveryEndDate",
"Value": "01Jan1980"
},
"IssueRate": {
"Name": "IssueRate",
"Value": ""
},
"SettlementNo": {
"Name": "CallAuctionIndicator",
"Value": "Missing"
},
"InterestPaymentDate": {
"Name": "InterestPaymentDate",
"Value": "01Jan1980"
},
"ListingDate": {
"Name": "ListingDate",
"Value": "01Jan1980"
},
"CompanyName": {
"Name": "CompanyName",
"Value": "ACC LIMITED-EQ"
},
"UniqueKey": {
"Name": "UniqueKey",
"Value": "ACC"
},
"CreditRating": {
"Name": "CreditRating",
"Value": "270.45-330.45"
},
"RecordDate": {
"Name": "RecordDate",
"Value": "01Jan1980"
},
"NoDeliveryStartDate": {
"Name": "NoDeliveryStartDate",
"Value": "01Jan1980"
},
"MarketType": {
"Name": "MarketType",
"Value": "NORMAL"
},
"BookClosureStartDate": {
"Name": "BookClosureStartDate",
"Value": "19Feb2019"
},
"ExDate": {
"Name": "ExDate",
"Value": "19Feb2020"
},
"WarningPercent": {
"Name": "WarningPercent",
"Value": "0"
},
"IssueStartDate": {
"Name": "IssueStartDate",
"Value": "24Oct1994"
},
"BookClosureEndDate": {
"Name": "BookClosureEndDate",
"Value": "28Feb2019"
},
"Remarks": {
"Name": "Remarks",
"Value": "AGM/CHANGE IN RTA"
}
},
"MarketTypeStatusEligibility": {
"Normal": {
"MarketType": 1,
"Eligibile": true,
"TradingStatus": 6
},
"OddLot": {
"MarketType": 2,
"Eligibile": false,
"TradingStatus": 2
},
"RetailDebt": {
"MarketType": 3,
"Eligibile": false,
"TradingStatus": 2
},
"Auction": {
"MarketType": 4,
"Eligibile": true,
"TradingStatus": 2
},
"CallAuction1": {
"MarketType": 5,
"Eligibile": false,
"TradingStatus": 1
},
"CallAuction2": {
"MarketType": 6,
"Eligibile": true,
"TradingStatus": 1
}
},
"NameWithSeries": "ACC-EQ",
"DisplayNameWithExchange": "ACC - NSECM",
"FreezeQty": 374832,
"LastUpdateTime": 1220519308,
"FiftyTwoWeekHigh": 351.3,
"FiftyTwoWeekLow": 232.35,
"Bhavcopy": {
"Open": 266,
"High": 267.9,
"Low": 261.5,
"Close": 263.75,
"TotTrdQty": 42967696,
"TotTrdVal": 11389044523.95,
"TimeStamp": "0001-01-01T00:00:00",
"TotalTrades": 197824,
"OpenInterest": 0,
"SettlementPrice": 0
},
"AdditionalPreExpiryMarginPerc": 0,
"AdditionalMarginPercLong": 0,
"AdditionalMarginPercShort": 0,
"DeliveryMarginPerc": 0,
"SpecialMarginPercBuy": 0,
"SpecialMarginPercSell": 0,
"TenderMargin": 0,
"ELMLongMargin": 0,
"ELMShortMargin": 0,
"InitialMarginPerc": 0,
"ExposureMarginPerc": 0,
"CallAuctionIndicator": 1,
"MarketType": 1,
"CurrentEligibleMarketType": 1,
"InstrumentLazyLoader": null
}
}
]
Instruments By Search String (GET)
You can search for instruments by using the GET /search/instruments request. In the response, you will receive the instrument details based on the searchString provided in the request.
URL
Request Body Parameters
| Parameter Name | Type | Mandatory | Description |
|---|---|---|---|
| searchString |
ExchangeSegment
|
Y |
Response Body Parameters
| Parameter Name | Type | Description |
|---|---|---|
| ExchangeSegment |
ExchangeSegment
|
Exchange segment in which the instrument is listed. |
| ExchangeInstrumentID |
ExchangeInstrumentID
|
Exchange script code or Symbol Token is unique identifier. |
| InstrumentType |
InstrumentType
|
Type of financial instrument. |
| Name |
Name
|
The official symbol or short name of the instrument as defined by the exchange. |
| DisplayName |
DisplayName
|
A user-friendly name of the instrument used for display purposes in applications. |
| Description |
Description
|
A detailed description of the instrument, including company or contract details. |
| Series |
Series
|
The exchange-defined series under which the instrument is listed (e.g., EQ, BL, A). |
| NameWithSeries |
NameWithSeries
|
The instrument name appended with its series (e.g., `RELIANCE-EQ`). |
| InstrumentID |
InstrumentID
|
A unique system-generated identifier assigned to the instrument by the exchange or trading system. |
| PriceBand |
Object
|
The permitted price range within which the instrument can trade during a session. |
| High |
High
|
The upper limit of the price band for the instrument. |
| Low |
Low
|
The lower limit of the price band for the instrument. |
| CreditRating |
CreditRating
|
The credit rating assigned to the instrument, if applicable (typically for debt instruments). |
| HighString |
HighString
|
The upper price band is represented as a formatted string. |
| LowString |
LowString
|
The lower price band is represented as a formatted string. |
| HighExecBandString |
HighExecBandString
|
The upper execution price band displayed as a formatted string. |
| LowExecBandString |
LowExecBandString
|
The lower execution price band displayed as a formatted string. |
| FreezeQty |
FreezeQty
|
The maximum order quantity allowed per order for the instrument. |
| TickSize |
TickSize
|
The minimum price movement allowed for the instrument. |
| LotSize |
LotSize
|
The minimum tradable quantity for the instrument. |
| UnderlyingInstrumentId |
UnderlyingInstrumentId
|
The unique instrument identifier of the underlying asset for a derivative contract. |
| UnderlyingIndexName |
UnderlyingIndexName
|
The name of the underlying index on which the derivative contract is based. |
| ContractExpirationString |
ContractExpirationString
|
The contract expiration date represented as a formatted string. |
| RemainingExpiryDays |
RemainingExpiryDays
|
The number of calendar days remaining until the contract expires. |
| ExchangeSegment |
ExchangeSegment
|
Exchange segment in which the instrument is listed. |
| ExchangeInstrumentID |
ExchangeInstrumentID
|
Exchange script code or Symbol Token is unique identifier. |
| StrikePrice |
StrikePrice
|
The strike price at which the option buyer can buy or sell the underlying asset. |
| OptionType |
OptionType
|
Defines whether the option is a Call or Put. |
Response Body JSON
{
"type": "success",
"code": "s-search-0001",
"description": "Record Found",
"result": [
{
"ExchangeSegment": 1,
"ExchangeInstrumentID": "11536",
"InstrumentType": 8,
"Name": "TCS",
"DisplayName": "TCS",
"ISIN": "INE467B01029",
"Description": "TCS-EQ",
"Series": "EQ",
"NameWithSeries": "TCS-EQ",
"InstrumentID": 1100100011536,
"PriceBand": {
"High": 3412.5,
"Low": 2792.1,
"HighString": "3412.50",
"LowString": "2792.10",
"CreditRating": "2792.10-3412.50",
"HighExecBandString": "0.00",
"LowExecBandString": "0.00",
"HighExecBand": 0,
"LowExecBand": 0,
"TERRange": "0.00-0.00"
},
"FreezeQty": 28944,
"TickSize": 0.1,
"LotSize": 1,
"CompanyName": "TATA CONSULTANCY SERV LT-EQ",
"DecimalDisplace": 2,
"IsIndex": false,
"IsTradeable": true,
"Industry": 11
},
{
"ExchangeSegment": 1,
"ExchangeInstrumentID": "759146",
"InstrumentType": 8,
"Name": "755TCSL28",
"DisplayName": "755TCSL28",
"ISIN": "INE729N07107",
"Description": "755TCSL28-N0",
"Series": "N0",
"NameWithSeries": "755TCSL28-N0",
"InstrumentID": 1100100759146,
"PriceBand": {
"High": 120000,
"Low": 80000,
"HighString": "120000.00",
"LowString": "80000.00",
"CreditRating": "80000.00-120000.00",
"HighExecBandString": "0.00",
"LowExecBandString": "0.00",
"HighExecBand": 0,
"LowExecBand": 0,
"TERRange": "0.00-0.00"
},
"FreezeQty": 999,
"TickSize": 0.01,
"LotSize": 1,
"CompanyName": "TCSL 7.55% 2028-N0",
"DecimalDisplace": 2,
"IsIndex": false,
"IsTradeable": true,
"Industry": 0
}
]
}
Instruments
Master (POST)
XTS provides an API call to fetch all tradable instruments as well as additional
data in a single structure. This call can be made once per day, and the response can be
persisted
in local storage or
a file based on your application design. You can then fetch instruments or symbols from this
dataset throughout the day.
The structure of the response is as follows. The pipe (|) and line-separated values can be
easily
tokenized and bulk-loaded into
your storage of choice.
URL
Request Body Parameters
| Parameter Name | Type | Mandatory | Description |
|---|---|---|---|
| exchangeSegmentList | Array | Y | Array of exchange segments |
Request Body JSON
{
"exchangeSegmentList": [
"NSECM",
"NSECD",
"NSEFO"
]
}
Terminalogy
If InstrumentType is Equities then use below header format:
ExchangeSegment|ExchangeInstrumentID|InstrumentType|Name|Description|Series|NameWithSeries|
InstrumentID|PriceBand.High|PriceBand.Low| FreezeQty|TickSize|LotSize|Multiplier|DisplayName|
ISIN|PriceNumerator|PriceDenominator|DetailedDescription|ExtendedSurvIndicator|CautionIndicator|GSMIndicator
Example:
NSECM|2885|8|RELIANCE|RELIANCE-EQ|EQ|RELIANCE-EQ|1100100002885|1598|1307.6|67662|0.1|1|1|RELIANCE|INE002A01018|1|1|RELIANCE
INDUSTRIES LTD-EQ|0|-1|-1
If InstrumentType is Options then use below header format:
ExchangeSegment|ExchangeInstrumentID|InstrumentType|Name|Description|Series|NameWithSeries|InstrumentID
|PriceBand.High|PriceBand.Low|FreezeQty|TickSize|LotSize|Multiplier|UnderlyingInstrumentId
|UnderlyingIndexName|ContractExpiration|StrikePrice|OptionType|DisplayName|PriceNumerator|PriceDenominator|DetailedDescription
Example:
NSEFO|48225|2|NIFTY|NIFTY2621725700PE|OPTIDX|NIFTY-OPTIDX|2604800048225|588|114.5|1801|0.05|65|1|-1|Nifty
50|2026-02-17T14:30:00|25700|4|NIFTY 17FEB2026 PE 25700|1|1|NIFTY2621725700PE
If InstrumentType is Futures, spread then use below header format:
ExchangeSegment|ExchangeInstrumentID|InstrumentType|Name|Description|Series|NameWithSeries|InstrumentID
|PriceBand.High|PriceBand.Low|FreezeQty|TickSize|LotSize|Multiplier|UnderlyingInstrumentId|UnderlyingIndexName|ContractExpiration|
DisplayName|PriceNumerator|PriceDenominator|DetailedDescription
Example:
NSEFO|49229|1|NIFTY|NIFTY26JANFUT|FUTIDX|NIFTY-FUTIDX|2602700049229|28369.8|23211.8|1801|0.1|65|1|-1|Nifty
50
|2026-01-27T14:30:00|NIFTY 27JAN2026|1|1|NIFTY26JANFUT
Quote (POST)
You can fetch the quote details by using the POST /instruments/quotes request. In the response, you will receive the quote details based on the exchangeSegment and instrumentID, along with the publishFormat provided in the request. The request body must have the content type application/json and should be valid JSON.
URL
Request Body Parameters
| Parameter Name | Type | Mandatory | Description |
|---|---|---|---|
| instruments | Array | Y | Array of instrument objects |
| exchangeSegment | ExchangeSegment | Y |
ExchangeSegment
|
| exchangeInstrumentID | ExchangeInstrumentID | Y | Exchange Scrip code or Symbol Token is unique identifier |
| xtsMessageCode | XTSMessageCode | Y |
XTSMessageCode
|
| publishFormat | PublishFormat | Y |
PublishFormat
|
Request Body JSON
{
"instruments": [
{
"exchangeSegment": 1,
"exchangeInstrumentID": 22
}
],
"xtsMessageCode": 1502,
"publishFormat": "JSON"
}
Response Body Parameters
| Parameter Name | Type | Description |
|---|---|---|
| mdp |
XTSMessageCode
|
XTSMessageCode |
| quoteList | Object | Response of subscribe instrument |
| listQuotes | Object | Market data for the list of requested instruments |
| MessageCode |
MessageCode
|
It is system generated message code |
| MessageVersion |
MessageVersion
|
It is system generated message version |
| ApplicationType |
ApplicationType
|
It is system generated ApplicationType |
| TokenID |
TokenID
|
It is system generated TokenID |
| ExchangeSegment |
ExchangeSegment
|
ExchangeSegment |
| ExchangeInstrumentID |
ExchangeInstrumentID
|
Exchange Scrip code or Symbol Token is unique identifier |
| ExchangeTimeStamp |
ExchangeTimeStamp
|
A timestamp represents the time at which an event occurred, as recorded by the exchange. |
| Bids | Object | The bid price displayed in most quote services is the highest bid price in the market. The ask or offer price on the other hand is the lowest price a seller of a particular stock is willing to sell a share of that given stock. |
| Asks | Object | The ask price is the lowest price a seller is willing to accept for a share of a stock. |
| Size |
Size
|
Total quantity available at the Ask or Bid price. |
| Price |
Price
|
Highest price at which buyers are willing to purchase the instrument |
| TotalOrders |
TotalOrders
|
Total number of buy orders placed at the bid or ask price. |
| BuyBackMarketMaker |
BuyBackMarketMaker
|
Indicates whether the bid is placed by a buy-back market maker |
| Touchline | Object | Touchline represents the best bid and best ask prices for a security at any given time during the trading day—specifically, the highest price a buyer is willing to pay and the lowest price at which a seller is willing to sell. |
| BidInfo | Object | The bid price displayed in most quote services represents the highest price a buyer is willing to pay in the market. The ask (or offer) price represents the lowest price at which a seller is willing to sell a share of the given stock. |
| AskInfo | Object | The ask price is the lowest price at which a seller is willing to accept for a share of a given stock. |
| LastTradedPrice |
LastTradedPrice
|
The price at which the most recent trade for the instrument was executed. |
| LastTradedQuantity |
LastTradedQuantity
|
The quantity traded in the most recent transaction. |
| TotalBuyQuantity |
TotalBuyQuantity
|
The total quantity of buy orders currently available in the market. |
| TotalSellQuantity |
TotalSellQuantity
|
The total quantity of sell orders currently available in the market. |
| TotalTradedQuantity |
TotalTradedQuantity
|
The cumulative quantity of the instrument traded during the trading session. |
| AverageTradedPrice |
AverageTradedPrice
|
The volume-weighted average price (VWAP) of all trades executed during the trading session. |
| LastTradedTime |
LastTradedTime
|
The timestamp at which the most recent trade occurred (exchange time). |
| LastUpdateTime |
LastUpdateTime
|
The timestamp of the latest market data update received from the exchange. |
| PercentChange |
PercentChange
|
The percentage change in price compared to the previous close. |
| Open |
Open
|
The price at which the instrument first traded when the market opened for the session. |
| High |
High
|
The highest traded price of the instrument during the trading session. |
| Low |
Low
|
The lowest traded price of the instrument during the trading session. |
| Close |
Close
|
The most recent traded price or the official closing price of the session. |
| TotalValueTraded |
TotalValueTraded
|
The total traded value during the session, calculated as price × quantity for all trades. |
| BuyBackTotalBuy |
BuyBackTotalBuy
|
The total buy quantity placed under buy-back activity (exchange-specific). |
| BuyBackTotalSell |
BuyBackTotalSell
|
The total sell quantity placed under buy-back activity (exchange-specific). |
| BookType |
BookType
|
BookType |
| XMarketType |
XMarketType
|
XMarketType |
Response Body JSON
[
{
"type": "success",
"code": "s-response-0001",
"description": "Instrument subscribed successfully!",
"result": {
"mdp": 1502,
"quoteList": {
"exchangeSegment": 1,
"exchangeInstrumentID": 2885
},
"listQuotes": {
"MessageCode": 1502,
"MessageVersion": 1,
"ApplicationType": 0,
"TokenID": 0,
"ExchangeSegment": 1,
"ExchangeInstrumentID": 2885,
"ExchangeTimeStamp": 1205682353,
"Bids": {
"Size": 0,
"Price": 0,
"TotalOrders": 0,
"BuyBackMarketMaker": 0
},
"Asks": {
"Size": 14916,
"Price": 900.05,
"TotalOrders": 10,
"BuyBackMarketMaker": 0
},
"Touchline": {
"BidInfo": {
"Size": 0,
"Price": 0,
"TotalOrders": 0,
"BuyBackMarketMaker": 0
},
"AskInfo": {
"Size": 14916,
"Price": 900.05,
"TotalOrders": 10,
"BuyBackMarketMaker": 0
},
"LastTradedPrice": 900.05,
"LastTradedQunatity": 1,
"TotalBuyQuantity": 0,
"TotalSellQuantity": 14916,
"TotalTradedQuantity": 14085685,
"AverageTradedPrice": 898.81,
"LastTradedTime": 1205682353,
"LastUpdateTime": 1205682353,
"PercentChange": 0,
"Open": 900,
"High": 909.1,
"Low": 890.7,
"Close": 900.05,
"TotalValueTraded": 1865862348,
"BuyBackTotalBuy": 38125,
"BuyBackTotalSell": 16903
},
"BookType": 0,
"XMarketType": 0
}
}
}
]
GetIndexList (GET)
You can retrieve the list of indices by using the GET /instruments/indexlist request. In the response, you will receive the names of all indices that belong to the specified exchangeSegment.
URL
Request Body Parameters
| Parameter Name | Type | Mandatory | Description |
|---|---|---|---|
| exchangeSegment |
ExchangeSegment
|
Y | ExchangeSegment |
Response Body Parameters
| Parameter Name | Type | Description |
|---|---|---|
| exchangeSegment |
ExchangeSegment
|
ExchangeSegment |
| indexList | Array | IndexList |
Response Body JSON
[
{
"type": "success",
"code": "s-response-0001",
"description": "Record Found",
"result": {
"exchangeSegment": 1,
"indexList": [
"NIFTY 50_26000",
"NIFTY BANK_26001",
"INDIA VIX_26002",
"NIFTY IT_26003",
"NIFTY 100_26004",
"NIFTY MIDCAP 50_26005",
"NIFTY GS 11 15YR_26006",
"NIFTY INFRA_26007"
]
}
}
]
GetSeries (GET)
You can search for the series by using the GET /instruments/instrument/series request. In the response, you will receive the series that you searched for based on the exchangeSegment sent in the request.
URL
Request Body Parameters
| Parameter Name | Type | Mandatory | Description |
|---|---|---|---|
| exchangeSegment |
ExchangeSegment
|
Y | ExchangeSegment |
Response Body Parameters
| Parameter Name | Type | Description |
|---|---|---|
| series | Array | The series field represents the trading category or segment under which an instrument is listed on the exchange. |
Response Body JSON
[
{
"type": "success",
"code": "s-response-0001",
"description": "Record Found",
"result": {
"series": [
"BL",
"BT",
"MF",
"NF",
"EQ",
"BE",
"N8",
"RL",
"NV"
]
}
}
]
GetEquitySymbol (GET)
You can search for the equity symbol by using the GET /instruments/instrument/symbol request. In the response, you will receive the equity symbol information based on the exchangeSegment, series, and symbol provided in the request.
URL
Request Body Parameters
| Parameter Name | Type | Mandatory | Description |
|---|---|---|---|
| exchangeSegment |
ExchangeSegment
|
Y | ExchangeSegment |
Response Body Parameters
| Parameter Name | Type | Description |
|---|---|---|
| ExchangeSegment |
ExchangeSegment
|
ExchangeSegment |
| ExchangeInstrumentID |
ExchangeInstrumentID
|
Exchange Scrip code or Symbol Token is unique identifier |
| InstrumentType |
InstrumentType
|
InstrumentType |
| Name |
Name
|
The official symbol or short name of the instrument as defined by the exchange. |
| DisplayName |
DisplayName
|
A user-friendly name of the instrument used for display purposes in applications. |
| Description |
Description
|
A detailed description of the instrument, including company or contract details |
| Series |
Series
|
The exchange-defined series under which the instrument is listed (e.g., EQ, BL, A). |
| NameWithSeries |
NameWithSeries
|
The instrument name appended with its series (e.g., RELIANCE-EQ). |
| InstrumentID |
InstrumentID
|
A unique system-generated identifier assigned to the instrument by the exchange or trading system. |
| PriceBand | Object | The permitted price range within which the instrument can trade during a session. |
| High |
High
|
The upper limit of the price band for the instrument. |
| Low |
Low
|
The lower limit of the price band for the instrument. |
| CreditRating |
CreditRating
|
The credit rating assigned to the instrument, if applicable (typically for debt instruments). |
| FreezeQty |
FreezeQty
|
The maximum order quantity allowed per order for the instrument. |
| TickSize |
TickSize
|
The minimum price movement allowed for the instrument. |
| LotSize |
LotSize
|
The minimum tradable quantity for the instrument. |
Response Body JSON
[
{
"type": "success",
"code": "s-response-0001",
"description": "Record Found",
"result": {
"ExchangeSegment": 1,
"ExchangeInstrumentID": 22,
"InstrumentType": 8,
"Name": "ACC",
"DisplayName": "ACC",
"Description": "ACC LIMITED",
"Series": "EQ",
"NameWithSeries": "ACC-EQ",
"InstrumentID": 1100100000022,
"PriceBand": {
"High": 1804.9,
"Low": 1476.8,
"CreditRating": "1476.80-1804.90",
"HighString": "1804.90",
"LowString": "1476.80"
},
"FreezeQty": 66476,
"TickSize": 0.05,
"LotSize": 1
}
}
]
GetExpiryDate (GET)
You can search for the expiry date by using the GET /instruments/instrument/expiryDate request. In the response, you will receive the expiry date based on the exchangeSegment, series, and symbol provided in the request.
URL
Request Body Parameters
| Parameter Name | Type | Mandatory | Description |
|---|---|---|---|
| exchangeSegment |
ExchangeSegment
|
Y | ExchangeSegment |
| series |
Series
|
Y | The exchange-defined series under which the instrument is listed (e.g., EQ, BL, A). |
| symbol |
Symbol
|
Y | Exchange-defined trading code used to identify an instrument. |
Response Body JSON
{
"type": "success",
"code": "s-response-0001",
"description": "Record Found",
"result": [
"2025-01-30T14:30:00",
"2025-02-27T14:30:00",
"2025-03-27T14:30:00",
"2025-02-27T14:30:00"
]
}
GetFutureSymbol (GET)
You can search for the future symbol by using the GET /instruments/instrument/futureSymbol request. In the response, you will receive the future symbol based on the exchangeSegment, series, symbol, and expiryDate provided in the request.
URL
Request Body Parameters
| Parameter Name | Type | Mandatory | Description |
|---|---|---|---|
| exchangeSegment |
ExchangeSegment
|
Y | ExchangeSegment |
| series |
Series
|
Y | The exchange-defined series under which the instrument is listed (e.g., EQ, BL, A). |
| symbol |
Symbol
|
Y | Exchange-defined trading code used to identify an instrument. |
| expiryDate |
ExpiryDate
|
Y | ExpiryDate represents the date on which a derivative contract (futures or options) expires and is settled as per exchange rules. |
Response Body Parameters
| Parameter Name | Type | Description |
|---|---|---|
| ExchangeSegment |
ExchangeSegment
|
ExchangeSegment |
| ExchangeInstrumentID |
ExchangeInstrumentID
|
Exchange Scrip code or Symbol Token is unique identifier |
| InstrumentType |
InstrumentType
|
InstrumentType |
| Name |
Name
|
The official symbol or short name of the instrument as defined by the exchange. |
| DisplayName |
DisplayName
|
A user-friendly name of the instrument used for display purposes in applications. |
| Description |
Description
|
A detailed description of the instrument, including company or contract details. |
| Series |
Series
|
The exchange-defined series under which the instrument is listed (e.g., EQ, BL, A). |
| NameWithSeries |
NameWithSeries
|
The instrument name appended with its series (e.g., RELIANCE-EQ). |
| InstrumentID |
InstrumentID
|
A unique system-generated identifier assigned to the instrument. |
| PriceBand | Object | The permitted price range within which the instrument can trade during a session. |
| High |
High
|
The upper limit of the price band for the instrument. |
| Low |
Low
|
The lower limit of the price band for the instrument. |
| CreditRating |
CreditRating
|
The credit rating assigned to the instrument, if applicable (typically for debt instruments). |
| HighString |
HighString
|
The upper price band is represented as a formatted string. |
| LowString |
LowString
|
The lower price band is represented as a formatted string. |
| HighExecBandString |
HighExecBandString
|
The upper execution price band displayed as a formatted string. |
| LowExecBandString |
LowExecBandString
|
The lower execution price band displayed as a formatted string. |
| FreezeQty |
FreezeQty
|
The maximum order quantity allowed per order for the instrument. |
| TickSize |
TickSize
|
The minimum price movement allowed for the instrument. |
| LotSize |
LotSize
|
The minimum tradable quantity for the instrument. |
| UnderlyingInstrumentId |
UnderlyingInstrumentId
|
The unique instrument identifier of the underlying asset for a derivative contract. |
| UnderlyingIndexName |
UnderlyingIndexName
|
The name of the underlying index on which the derivative contract is based. |
| ContractExpiration |
ContractExpiration
|
The date on which a derivatives contract expires. After this date, the contract ceases to exist for trading. |
| ContractExpirationString |
ContractExpirationString
|
The contract expiration date is represented as a formatted string, as defined by the exchange. |
| RemainingExpiryDays |
RemainingExpiryDays
|
The number of calendar days remaining until the contract expires. |
Response Body JSON
[
{
"type": "success",
"code": "s-response-0001",
"description": "Record Found",
"result": {
"ExchangeSegment": 2,
"ExchangeInstrumentID": 35006,
"InstrumentType": 1,
"Name": "NIFTY",
"DisplayName": "NIFTY 30JAN2025",
"Description": "NIFTY25JANFUT",
"Series": "FUTIDX",
"InstrumentID": 2503000035006,
"PriceBand": {
"High": 25131.1,
"Low": 20561.85,
"CreditRating": "20561.85-25131.10",
"HighString": "23354.10",
"LowString": "22438.85",
"HighExecBandString": "23354.20",
"LowExecBandString": "22438.35",
"TERRange": "22438.35-23354.20"
},
"FreezeQty": 1801,
"TickSize": 0.05,
"LotSize": 25,
"UnderlyingInstrumentId": -1,
"UnderlyingIndexName": "Nifty 50",
"ContractExpiration": "2025-01-30T14:30:00",
"ContractExpirationString": "30Jan2025",
"RemainingExpiryDays": 3
}
}
]
GetOptionType (GET)
You can search for the option type by using the GET /instruments/instrument/optionType request. In the response, you will receive the option type based on the exchangeSegment, series, symbol, and expiryDate provided in the request.
URL
Request Body Parameters
| Parameter Name | Type | Mandatory | Description |
|---|---|---|---|
| exchangeSegment |
ExchangeSegment
|
Y | ExchangeSegment |
| series |
Series
|
Y | The exchange-defined series under which the instrument is listed (e.g., EQ, BL, A). |
| symbol |
Symbol
|
Y | Exchange-defined trading code used to identify an instrument. |
| expiryDate |
ExpiryDate
|
Y | ExpiryDate represents the date on which a derivative contract (futures or options) expires and is settled as per exchange rules. |
Response Body Parameters
| Parameter Name | Type | Description |
|---|---|---|
| series | Array | Series |
Response Body JSON
[
{
"type": "success",
"code": "s-response-0001",
"description": "Record Found",
"result": {
"series": [
"PE",
"CE"
]
}
}
]
GetStrikePrice (GET)
You can search for the strike prices by using the GET /instruments/instrument/strikePrice request. In the response, you will receive all strike prices for the specified symbol and expiryDate.
URL
Request Body Parameters
| Parameter Name | Type | Mandatory | Description |
|---|---|---|---|
| exchangeSegment |
ExchangeSegment
|
Y | ExchangeSegment |
| series |
Series
|
Y | The exchange-defined series under which the instrument is listed (e.g., EQ, BL, A). |
| symbol |
Symbol
|
Y | Exchange-defined trading code used to identify an instrument. |
| expiryDate |
ExpiryDate
|
Y | ExpiryDate represents the date on which a derivative contract (futures or options) expires and is settled as per exchange rules. |
| optionType |
OptionType
|
Y | OptionType |
Response Body Parameters
[
{
"result": [
"29350",
"28300",
"21350",
"21400",
"27550",
"18400",
"24200",
"26350",
"19200"
]
}
]
GetOptionSymbol (GET)
You can search for the option symbol by using the GET /instruments/instrument/optionSymbol request. In the response, you will receive the option symbol based on the exchangeSegment, series, symbol, expiryDate, optionType, and strikePrice provided in the request.
URL
Request Body Parameters
| Parameter Name | Type | Mandatory | Description |
|---|---|---|---|
| exchangeSegment |
ExchangeSegment
|
Y | ExchangeSegment |
| series |
Series
|
Y | The exchange-defined series under which the instrument is listed (e.g., EQ, BL, A). |
| symbol |
Symbol
|
Y | Exchange-defined trading code used to identify an instrument. |
| expiryDate |
ExpiryDate
|
Y | ExpiryDate represents the date on which a derivative contract (futures or options) expires and is settled as per exchange rules. |
| optionType |
OptionType
|
Y | OptionType |
| strikePrice |
StrikePrice
|
Y | The strike price is the predetermined price at which the buyer of an options contract can buy (call option) or sell (put option) the underlying asset, on or before the option’s expiration date. |
Response Body Parameters
| Parameter Name | Type | Description |
|---|---|---|
| ExchangeSegment |
ExchangeSegment
|
ExchangeSegment |
| ExchangeInstrumentID |
ExchangeInstrumentID
|
Exchange Scrip code or Symbol Token is unique identifier |
| InstrumentType |
InstrumentType
|
InstrumentType |
| Name |
Name
|
The official symbol or short name of the instrument as defined by the exchange. |
| DisplayName |
DisplayName
|
A user-friendly name of the instrument used for display purposes in applications. |
| Description |
Description
|
A detailed description of the instrument, including company or contract details. |
| Series |
Series
|
The exchange-defined series under which the instrument is listed (e.g., EQ, BL, A). |
| NameWithSeries |
NameWithSeries
|
The instrument name appended with its series (e.g., RELIANCE-EQ). |
| InstrumentID |
InstrumentID
|
A unique system-generated identifier assigned to the instrument. |
| PriceBand | Object | The permitted price range within which the instrument can trade during a session. |
| High |
High
|
The upper limit of the price band for the instrument. |
| Low |
Low
|
The lower limit of the price band for the instrument. |
| CreditRating |
CreditRating
|
The credit rating assigned to the instrument, if applicable. |
| HighString |
HighString
|
The upper price band is represented as a formatted string. |
| LowString |
LowString
|
The lower price band is represented as a formatted string. |
| HighExecBandString |
HighExecBandString
|
The upper execution price band displayed as a formatted string. |
| LowExecBandString |
LowExecBandString
|
The lower execution price band displayed as a formatted string. |
| FreezeQty |
FreezeQty
|
The maximum order quantity allowed per order for the instrument. |
| TickSize |
TickSize
|
The minimum price movement allowed for the instrument. |
| LotSize |
LotSize
|
The minimum tradable quantity for the instrument. |
| UnderlyingInstrumentId |
UnderlyingInstrumentId
|
The unique instrument identifier of the underlying asset for a derivative contract. |
| UnderlyingIndexName |
UnderlyingIndexName
|
The name of the underlying index on which the derivative contract is based. |
| ContractExpiration |
ContractExpiration
|
The date on which a derivatives contract expires. |
| ContractExpirationString |
ContractExpirationString
|
The contract expiration date is represented as a formatted string. |
| RemainingExpiryDays |
RemainingExpiryDays
|
The number of calendar days remaining until the contract expires. |
| ExchangeSegment |
ExchangeSegment
|
ExchangeSegment |
| ExchangeInstrumentID |
ExchangeInstrumentID
|
Exchange Scrip code or Symbol Token is unique identifier |
| StrikePrice |
StrikePrice
|
The strike price is the predetermined price at which the buyer of an options contract can buy or sell the underlying asset. |
| OptionType |
OptionType
|
OptionType |
OHLC
Intraday Candle OHLC
The XTS Front-end API provides intraday archived OHLC (candlestick) data from the date of
access for Equity segments of NSECM and BSECM. For FO segments, OHLC data is available only for
currently traded contracts, and expired contracts are not supported.
The response is delivered in candle format,
including timestamp (epoch time since 1970), Open, High, Low, Close, Volume, and Open Interest (OI) .
The minimum
supported interval is 60 seconds (1 minute), with additional supported intervals for the GET OHLC request detailed
in the table below.
Compression Value Table
| Expected Timeframe | Compression |
|---|---|
| 1 minute | 60 |
| 2 minutes | 120 |
| 3 minutes | 180 |
| 4 minutes | 240 |
| 5 minutes | 300 |
| 7 minutes | 420 |
| 10 minutes | 600 |
| 15 minutes | 900 |
| 30 minutes | 1800 |
| 1 hour | 3600 |
| 2 hours | 7200 |
| 3 hours | 10800 |
| 4 hours | 14400 |
| 1 day | D |
| 1 week | W |
| 1 month | M |
URL
Request Body Parameters
| Parameter Name | Type | Mandatory | Description |
|---|---|---|---|
| exchangeSegment |
ExchangeSegment
|
Y | Exchange segment. |
| exchangeInstrumentID |
ExchangeInstrumentID
|
Y | Exchange Scrip code or Symbol Token is unique identifier. |
| startTime |
StartTime
|
Y | Date and time in MMM DD YYYY HHMMSS format. Default value is Jan 27 2025 090000 |
| endTime |
EndTime
|
Y | Date and time in MMM DD YYYY HHMMSS format. Default value is Jan 28 2025 153000 |
| compressionValue |
CompressionValue
|
Y | String value representing time interval. Default value is D. Allowed values are In1Minute (60), In2Minute (120), In3Minute (180), In5Minute (300), In10Minute (600), In15Minute (900), In30Minute (1800), In60Minute (3600) |
Response Body JSON
[
{
"type": "success",
"code": "s-ohlc-0001",
"description": "Data found",
"result": {
"exchangeSegment": "NSECM",
"exchangeInstrumentID": "22",
"dataReponse": "1737331200|1316|1316|1300.25|1305.45|14040244|0|"
}
}
]
Subscribe to Socket
This API request is used to subscribe to market data over a WebSocket connection for specified exchange instruments and message codes provided in the request. Upon successful subscription, the user receives an acknowledgment response containing the latest quote data along with the remaining subscription count, which is AppKey-specific and configurable via the API dashboard. Once subscribed, real-time market data for the specified instrument(s) will be continuously streamed on the market data WebSocket.
URL
Request Body Parameters
| Parameter Name | Type | Mandatory | Description |
|---|---|---|---|
| instruments | Array | Y | Array of instrument objects |
| exchangeSegment |
ExchangeSegment
|
Y | ExchangeSegment |
| exchangeInstrumentID |
ExchangeInstrumentID
|
Y | Exchange Scrip code or Symbol Token is unique identifier |
| MessageCode |
Integer
|
Y | It is system generated message code |
Request Body JSON
{
"instruments": [
{
"exchangeSegment": 1,
"exchangeInstrumentID": 22
}
],
"xtsMessageCode": 1502
}
Response Body JSON
{
"type": "success",
"code": "s-session-0001",
"description": "Instrument subscribed successfully!",
"result": {
"mdp": 1501,
"quotesList": [
{
"exchangeSegment": 1,
"exchangeInstrumentID": 22
}
],
"listQuotes": [
"{\"MessageCode\":1501,\"ExchangeSegment\":1,\"ExchangeInstrumentID\":\"22\",\"LastTradedPrice\":1723,\"LastTradedQunatity\":15,\"TotalBuyQuantity\":18446,\"TotalSellQuantity\":25283,\"TotalTradedQuantity\":189238,\"AverageTradedPrice\":1699.1,\"LastTradedTime\":1453476469,\"LastUpdateTime\":1453476469,\"PercentChange\":1.54,\"Open\":1696.8,\"High\":1724,\"Low\":1673.1,\"Close\":1696.8,\"TotalValueTraded\":0,\"AskInfo\":{\"Size\":1,\"Price\":1723.5,\"TotalOrders\":1,\"BuyBackMarketMaker\":0},\"BidInfo\":{\"Size\":271,\"Price\":1723,\"TotalOrders\":3,\"BuyBackMarketMaker\":0},\"XMarketType\":1,\"BookType\":1}"
],
"Remaining_Subscription_Count": 48
}
}
Unsubscribe to Socket
URL
This API request is used to unsubscribe from market data streaming for instruments that are already subscribed. Upon successful unsubscription, the server sends an acknowledgment confirming the unsubscription, stops sending market data for the specified instrument(s) on the WebSocket, and releases the corresponding subscription count, making it available for future subscriptions.
Request Body Parameters
| Parameter Name | Type | Mandatory | Description |
|---|---|---|---|
| instruments | Array | Y | Array of instrument objects |
| exchangeSegment |
ExchangeSegment
|
Y | ExchangeSegment |
| exchangeInstrumentID |
ExchangeInstrumentID
|
Y | Exchange Scrip code or Symbol Token is unique identifier |
| MessageCode |
Integer
|
Y | It is system generated message code |
Request Body JSON
{
"instruments": [
{
"exchangeSegment": 1,
"exchangeInstrumentID": 22
}
],
"xtsMessageCode": 1502
}
Response Body JSON
[
{
"type": "success",
"code": "s-response-0001",
"description": "Instrument subscription deleted!",
"result": {
"Remaining_Subscription_Count": 4
}
}
]
Socket Streaming
Introduction
To receive streaming Market Data events, you must use the Socket.IO library. For more information, visit: https://socket.io/.
Real-Time Streaming Flow
Once the connection is established, real-time streaming data can be obtained by
listening to the socket on the relevant
market data ports. The streaming data will be received on these ports, and upon receiving the data,
you are free to process it
as required.
Below are the steps to follow to correctly implement the real-time streaming flow:
- 1. Establish the socket connection
- 2. Listen to real-time streaming events
Establishment of Socket Connection
You can connect to the server by sending the userID, token, source, and broadcastMode as query parameters. The token is available only after a successful RESTful login request, as described in the RESTful section of the documentation.
import socketio # Base URL of the ApiMarketdata API server url = "https://developers.symphonyfintech.in" # Required credentials userID = "" token = "" broadcastMode = "Full" # "Partial" publishFormat = "JSON" socketio_path = "/apibinarymarketdata/socketio" logger = False # True # Create Socket.IO client sio = socketio.Client() connectionString = f"{url}?token={token}&userID={userID}&publishFormat={publishFormat}&broadcastMode={broadcastMode}" @sio.on("connect") def connect(): print("Connection Established") @sio.on("disconnect") def disconnect(): print("Disconnected") @sio.on("joined") def joined(data): print("Socket Joined", data) @sio.on("error") def error(data): print("Error", data)
Listening to Real-Time Streaming
Once the socket connection is successfully established, you can listen to real-time streaming data by subscribing to the attached market data ports. The complete market data will be received as a string.
BinaryData
Binary data event
@sio.on("xts-binary-packet")
def on_binary_full(data):
print("Binary data Full:", data)
Note
- If the packet is compressed, decompress it using zlib, and then deserialize the final packet.
- If the packet is not compressed, you can directly deserialize the packet.
- The isGzipCompressed flag is present in the parent header of the received packet. The final packet must be iterated accordingly.
- Further deserialization should be performed based on the message code.
Connect
The user needs to connect to the server via a socket (i.e., WebSocket). It is important to set the path
parameter value as /socket.io during the connection. The token will only be available after a successful
login, so make sure you log in first before connecting to the server via socket.
Here, the URL is the REST API address used to connect to the interactive server (e.g.,
www.test.example.com). Once connected to the server, you can listen to the following events:
SocketEvents.An example of a connect event is given below
@sio.on("connect")
def connect():
print("Connection Established")
Joined
If a successful connection is established with the server, this event will be raised to indicate that the user has been connected.
@sio.on("joined")
def on_joined(data):
print("Socket Joined", data)
Error
In case of any error with the server, this event will be raised along with the cause of the error. For example, if you send an incorrect token while connecting, the server will raise this event and disconnect your socket connection.
@sio.on("error")
def on_error(data):
print("Error", data)
Disconnect
In case a socket disconnection occurs with the server, this event will be raised to indicate the disconnection.
@sio.on("disconnect")
def on_disconnect():
print("Disconnected")
Binary Marketdata Event
Touchline event (1501)
| Field Name | Data Type | Description |
|---|---|---|
| Header | ||
| isGzipCompressed | int8 | Indicates whether the packet payload is gzip compressed (1 = compressed, 0 = not compressed). |
| messageCode | uint16 | Header-level message code. |
| exchangeSegment | int16 | Exchange segment identifier. |
| exchangeInstrumentID | int32 | Unique identifier of the instrument within the exchange. |
| bookType | int16 | Order book type. |
| marketType | int16 | Market type identifier. |
| uncompressedPacketSize | uint16 | Size of the packet after decompression. |
| compressedPacketSize | uint16 | Size of the compressed packet. |
| If isGzipCompressed is 1 then it is a compressed packet, need to deserialize using zlib, if isGzipCompressed is 0 then it is non compressed packet. | ||
| messageCode | uint16 | Actual message code inside the decompressed payload. |
| Touchline event (1501) | ||
| messageVersion | uint16 | Version of the message format. |
| applicationType | uint16 | Application type identifier. |
| tokenID | uint64 | Unique token identifier for the instrument. |
| sequenceNumber (if messageVersion >= 4) |
uint64 | Incremental sequence number used for ordering messages. |
| SkipBytes (if messageVersion >= 4) | int32 | Number of bytes to skip for forward compatibility. |
| exchangeSegment | int16 | Exchange segment identifier. |
| exchangeInstrumentId | int32 | Unique instrument identifier within the exchange. |
| exchangeTimestamp | uint64 | Timestamp generated by the exchange for this update. |
| Marketdepth Row (Bid & Ask) | ||
| size (Bid) | long | Bid quantity available at the best price level. |
| rowprice (Bid) | double | Best bid price. |
| totalOrders (Bid) | uint32 | Total number of buy orders at the best bid. |
| backmarketmakerflag (Bid) | int16 | Indicates market maker presence on the bid side. |
| size (Ask) | long | Ask quantity available at the best price level. |
| rowprice (Ask) | double | Best ask price. |
| totalOrders (Ask) | uint32 | Total number of sell orders at the best ask. |
| backmarketmakerflag (Ask) | int16 | Indicates market maker presence on the ask side. |
| LastUpdateTime | uint64 | Timestamp of the latest market data update. |
| LastTradedPrice | double | Price at which the last trade occurred. |
| LastTradedQuantity | long | Quantity traded in the last transaction. |
| TotalBuyQuantity | long | Total buy quantity available in the order book. |
| TotalSellQuantity | long | Total sell quantity available in the order book. |
| TotalTradedQuantity | long | Total quantity traded for the trading session. |
| AverageTradedPrice | double | Weighted average traded price. |
| LastTradedTime | int64 | Timestamp of the last trade. |
| percentChange | double | Percentage change compared to the previous close. |
| Open | double | Opening price of the trading session. |
| High | double | Highest traded price of the session. |
| Low | double | Lowest traded price of the session. |
| Close | double | Closing price of the previous trading session. |
| TotalValueTraded | double | Total traded value for the session. |
| bbtotalbuy | int16 | Total buy quantity from buyback orders. |
| bbtotalsell | int16 | Total sell quantity from buyback orders. |
| Booktype | int16 | Order book type. |
| MarketType | int16 | Market type identifier. |
Marketdepth Event (1502)
| Field Name | Data Type | Description |
|---|---|---|
| Header | ||
| isGzipCompressed | int8 | Indicates whether the packet payload is gzip compressed (1 = compressed, 0 = not compressed). |
| messageCode | uint16 | Header-level message code. |
| exchangeSegment | int16 | Exchange segment identifier. |
| exchangeInstrumentID | int32 | Unique identifier of the instrument within the exchange. |
| bookType | int16 | Order book type. |
| marketType | int16 | Market type identifier. |
| uncompressedPacketSize | uint16 | Size of the packet after decompression. |
| compressedPacketSize | uint16 | Size of the compressed packet. |
| If isGzipCompressed is 1 then it is a compressed packet, need to deserialize using zlib, if isGzipCompressed is 0 then it is non compressed packet. | ||
| messageCode | uint16 | Actual message code inside the decompressed payload. |
| Marketdepth event (1502) | ||
| messageVersion | uint16 | Version of the message structure. |
| applicationType | uint16 | Identifies the application type generating the message. |
| tokenID | uint64 | Unique token identifier for the instrument. |
| sequenceNumber (if messageVersion >= 4) |
uint64 | Sequential number used to maintain message ordering. |
| SkipBytes (if messageVersion >= 4) | int32 | Reserved bytes to skip for forward compatibility. |
| exchangeSegment | int16 | Exchange segment identifier. |
| exchangeInstrumentId | int32 | Unique instrument identifier within the exchange. |
| exchangeTimestamp | uint64 | Timestamp generated by the exchange for this update. |
| bidCount | int32 | Total number of bid levels present in the message. |
| Marketdepth Row (Bid) | ||
| size (Bid) | long | Bid quantity available at the current price level. |
| rowprice (Bid) | double | Bid price at this level. |
| totalOrders (Bid) | uint32 | Total number of buy orders at this bid level. |
| backmarketmakerflag (Bid) | int16 | Indicates market maker participation on the bid side. |
| askCount | int32 | Total number of ask levels present in the message. |
| Marketdepth Row (Ask) | ||
| size (Ask) | long | Ask quantity available at the current price level. |
| rowprice (Ask) | double | Ask price at this level. |
| totalOrders (Ask) | uint32 | Total number of sell orders at this ask level. |
| backmarketmakerflag (Ask) | int16 | Indicates market maker participation on the ask side. |
| LastUpdateTime | uint64 | Timestamp of the latest market data update. |
| LastTradedPrice | double | Price at which the most recent trade occurred. |
| LastTradedQuantity | long | Quantity traded in the last transaction. |
| TotalBuyQuantity | long | Total buy quantity available in the order book. |
| TotalSellQuantity | long | Total sell quantity available in the order book. |
| TotalTradedQuantity | long | Total quantity traded during the trading session. |
| AverageTradedPrice | double | Weighted average price of all executed trades. |
| LastTradedTime | int64 | Timestamp of the last executed trade. |
| percentChange | double | Percentage change compared to the previous close price. |
| Open | double | Opening price of the trading session. |
| High | double | Highest traded price during the session. |
| Low | double | Lowest traded price during the session. |
| Close | double | Closing price of the previous trading session. |
| TotalValueTraded | double | Total traded value for the trading session. |
| bbtotalbuy | int16 | Total buy quantity from buyback orders. |
| bbtotalsell | int16 | Total sell quantity from buyback orders. |
| Booktype | int16 | Order book type identifier. |
| MarketType | int16 | Market type identifier. |
OpenInterest Event (1510)
| Field Name | Data Type | Description |
|---|---|---|
| Header | ||
| isGzipCompressed | int8 | Indicates whether the packet payload is gzip compressed (1 = compressed, 0 = not compressed). |
| messageCode | uint16 | Header-level message code. |
| exchangeSegment | int16 | Exchange segment identifier. |
| exchangeInstrumentID | int32 | Unique identifier of the instrument within the exchange. |
| bookType | int16 | Order book type. |
| marketType | int16 | Market type identifier. |
| uncompressedPacketSize | uint16 | Size of the packet after decompression. |
| compressedPacketSize | uint16 | Size of the compressed packet. |
| If isGzipCompressed is 1 then it is a compressed packet, need to deserialize using zlib, if isGzipCompressed is 0 then it is non compressed packet. | ||
| messageCode | uint16 | Actual message code inside the decompressed payload. |
| OpenInterest event (1510) | ||
| messageVersion | uint16 | Version of the message format. |
| applicationType | uint16 | Identifies the application type generating the message. |
| tokenID | uint64 | Unique token identifier for the instrument. |
| sequenceNumber (if messageVersion >= 4) |
uint64 | Sequential number used to maintain message ordering. |
| SkipBytes (if messageVersion >= 4) | int32 | Reserved bytes to skip for forward compatibility. |
| exchangeSegment | int16 | Exchange segment identifier. |
| exchangeInstrumentId | int32 | Unique instrument identifier within the exchange. |
| exchangeTimestamp | uint64 | Timestamp generated by the exchange. |
| MarketType | int16 | Market type identifier. |
| openInterest | long | Total open interest for the instrument. |
| underlyingExchangeSegment | int16 | Exchange segment of the underlying instrument. |
| underlyingInstrumentID | uint64 | Unique identifier of the underlying instrument. |
| isStringExits | int8 | Indicates whether underlying index name string is present (1 = yes, 0 = no). |
| stringLength (if isStringExits = 1) | int8 | Length of the underlying index name string. |
| UnderlyingIndexName (if isStringExits = 1) |
string | Name of the underlying index. |
| underlyingTotalOpenInterest | uint64 | Total open interest of the underlying instrument. |
Candle Data Event
Candle Data Event message for JSON Full Packet
@sio.on("1505-json-full")
def on_1505_json_full(data):
print("CandleData data Full:", data)
Candle Data Event message for JSON Full Packet
{
"MessageCode": 1505,
"MessageVersion": 1,
"ApplicationType": 142,
"TokenID": 0,
"ExchangeSegment": 1,
"ExchangeInstrumentID": 2885,
"BarTime": 1737731759,
"BarVolume": 13161312,
"High": 1246.05,
"Low": 1245.5,
"Open": 1246,
"Close": 1245.95,
"OpenInterest": 0,
"SumOfQtyInToPrice": 0
}
Candle Data Event message for JSON Partial Packet
@sio.on("1505-json-partial")
def on_1505_json_partial(data):
print("CandleData Partial:", data)
Response to 1505-json-partial
t:1_2885,o:1246,h:1246.05,l:1245.5,c:1245.95,bt:1737731759,bv:13161312,pv:0
| Symbol | Explanation |
|---|---|
| t | ExchangeSegment_InstrumentID (exchange segment enum with underscore along with instrumentID of the particular subscribed instrument) |
| o | Open |
| h | High |
| l | Low |
| c | Close |
| bt | Bar Time |
| bv | Bar Volume |
| pv | Sum of Quantity In Price |
Field Name:
Data Type:
Size:
Description: