Introduction

Purpose:-

This API document serves as a comprehensive guide for anyone who is looking to integrate their application with our broadcast gateway and Restful API’s. It will provide real time market data which helps in building real time trading platform. This documentation will provide you with the necessary information to leverage the functionalities offered by our API efficiently.

Scope:-

The primary purpose of this documentation is to provide the knowledge and resources to successfully integrate the API’s with their system. It aims to provide clear explanations of API endpoints, parameters, authentication methods, response formats, and best practices to facilitate seamless integration and optimal usage.

This documentation covers all aspects of the Broadcast Gateway API’s, including its endpoints, request and response formats, authentication mechanisms and any additional features or functionalities.

Target Audience:-

This documentation is intended for anyone who is willing to develop their trading system. Whether you’re a seasoned developer familiar with technology or a newcomer looking to explore integration possibilities, this documentation will provide you with the guidance and resources you need.

Assumptions:-

The documentation assumes that readers have a basic understanding of web technologies, HTTP protocols, and basic API concepts.

Note: - All the validations are expected to be done by the integration partner. Before submitting data to the server, it is important to ensure all required form controls are filled out, in the correct format.

Rate Limit

Below are the rate limits defined for Market API calls

Serial No. API Name Rate Limit(Request/Sec)
1 instruments/master (To get Masters) 1
2 search/instrumentsbyid (To search By InstrumentID) 1

Steps

Here are the steps to integrate the system :-

  1. 1. Use the API Key and Secret Key provided by the vendor to login using Session Login API
  2. 2. On successful login , user will get an bearer token which need to be stored to access rest of the API’s and to connect the socket
  3. 3. User will then need to connect to the socket by using this token to ws://serverAddress/token= this endpoint
  4. 4. User will need to add Authorization in request header and pass this bearer token to access the API’s
  5. 5. A user session will be created and all the socket events will be sent to the connected users
  6. 6. At last, user can call logout API which will expire the user token and disconnect the user from socket

User

The user needs to log in using the public key and secret key which are generated while registering with the API dashboard. The public key will be first authenticated by the broker gateway before redirecting to the API service.

Session Login

The API consumer sends a login request to the Market API server with Secret Key & App Key. Upon successful validation, the user will get a login response.

Endpoint: auth/Login
Method: POST

REQUEST BODY SCHEMA

Field Name Data Type Possible Values Description
secretKey DT_Key Secret Key to validate
appKey DT_Key The API App Key
source DT_Source Login source of user

RESPONSES

200:-

Field Name Data Type Description
type DT_Type Response for request
code DT_Code Response code to user request
description DT_Description Valid/Invalid User
result LoginSuccessRes

400:-

On bad request, BadRequestRes model will be returned.

Sample Request Body
{
    “secretKey” : “Koiejemlfjoi+lkmdclemclelclcewQ”,
    “appKey” : “Hujnk3iidm3”,
    “source” : “API”
}
          
Sample Response Body
{
    "result": {
        "token": "ALn8Y8LmEj4/VPhXvT8MPYL6tYiYJFxGdnf94SyrANvzujMd58n89yCiaXXKUYHBkc6dcN8lujxE4Nb5Sf8NDog2cb9iVPx/ExRl6coDZpcd00XtGphlSQinIjK9EJrgYNhvLxmHCr7owfJbhxPi3u1z0C9/KBHwLcxZI2/AAwYgNiEwe6RltoT4lITFXUqKMJZAD8zBvnxT+aXAPZVIxGAh2hrqpIyDugNHCrBMrcYf+Gw5gx0y05GmpZ2240fWfa1cs8H5wNZKfbyNLu/dOE279NwPLpX04eCXAQHy6NCggjK1BujfA48fQH1SqH9r",
        "userID": "APICLIENT1",
        "appVersion": ""
    },
    "type": "success",
    "code": "success code",
    "description": "Valid user"
}

Session Logout

This call invalidates the session token and destroys the API session. After this the user should go through the login flow again and extract the session token from the login response before further activities.

Endpoint: - /auth/logout
Method: - DELETE
Authorization: - Bearer Token

RESPONSES

200:-

Field Name Data Type Description
type DT_Type Response for request
code DT_Code Response code to user request
description DT_Description User logout status

400:-

On bad request, BadRequestRes model will be returned.

Sample Request Header
DELETE /auth/logout
Authorization: Bearer {token}
            
Sample Response Body
{
    “type”: "success",
    “code”: "success code",
    “description”: "successfully logged out",
} 

Subscription

In this API, you can subscribe to the instruments. On successful request, you will get a response which includes the list of instruments you have subscribed.

Endpoint: - /instruments/subscription
Method: - POST
Authorization: - Bearer Token

REQUEST BODY SCHEMA

200:-

Field Name Data Type Possible Values Description
instruments Array< Instrument>
messageCode DT_MessageCode 1501: Touchline
1502: Market Data

RESPONSES

200:-

Field Name Data Type Description
type DT_Type Response for request
code DT_Code Response code to user request
description DT_Description
result SubscriptionData

400:-

On bad request, BadRequestRes model will be returned.

Sample Request Header
POST /instruments/subscription
Authorization: Bearer {token}
Sample Request Body
{
    "instruments": [
        {
        "exchangeSegment": 1,
        "exchangeInstrumentID": 22
        }
    ],
    "messageCode": 1501
}
       
Sample Response Body
{
    "result": {
        "mdp": 1501,
        "quoteList": [
            {
                "exchangeSegment": 1,
                "exchangeInstrumentID": 22
            }
        ],
        "listQuotes": "",
        "remaining_Subscription_Count": 49
    },
    "type": "success",
    "code": "success code",
    "description": "Instrument subscribed successfully"
}

Unsubscription

In this API, you can unsubscribe to the instruments. On successful request, you will get a response which includes the list of instruments you have unsubscribed.

Endpoint: - /instruments/subscription
Method: - PUT
Authorization: - Bearer Token

REQUEST BODY SCHEMA

Field Name Data Type Possible Values Description
instruments Array< Instrument>
messageCode DT_MessageCode 1501: Touchline
1502: Market Data

RESPONSES

200:-

Field Name Data Type Description
type DT_Type Response for request
code DT_Code Response code to user request
description DT_Description
result UnsubscriptionData

400:-

On bad request, BadRequestRes model will be returned.

Sample Request Header
PUT /instruments/subscription
Authorization: Bearer {token}
  
Sample Request Body
{
    "instruments": [
        {
        "exchangeSegment": 1,
        "exchangeInstrumentID": 22
        }
    ],
    "messageCode": 1501
}
Sample Response Body
{
    "result": {
        "mdp": 1501,
        "unsubList": [
            {
                "exchangeSegment": 1,
                "exchangeInstrumentID": 22
            }
        ]
    },
    "type": "success",
    "code": "success code",
    "description": "Instrument subscription deleted successfully"
}

Master

This API will provide the contract masters in a single structure. This call can be made once in a day and the response can be persisted as per your design.

Endpoint: - /instruments/master
Method: - POST
Authorization: - Bearer Token

The response structure is as follows:-

If Instrument Type is of Equities then response format will be:

ExchangeSegment|ExchangeTokenID|InstrumentType|Name|Description|Series| NameWithSeries|InstrumentID|High|Low| FreezeQty|TickSize|LotSize|Multiplier|displayName|ISIN|PriceNumerator|PriceDenominator

Example: NSECM|22|8|ACC|ACC-EQ|EQ|ACC-EQ|1100100000022|2157.3|1765.1|50890|0.05|1|1|ACC|INE012A01025|1|1

If Instrument Type is ofF&O then response format will be:

ExchangeSegment|ExchangeTokenID|InstrumentType|Name|Description|Series| NameWithSeries|InstrumentID|High|Low|FreezeQty|TickSize| LotSize|Multiplier|UnderlyingInstrumentId|UnderlyingIndexName|ContractExpiration|StrikePrice|OptionType

Example: NSEFO|64024|IDEA|IDEA22NOV12PE|OPTSTK|IDEA-OPTSTK|2114700061211|16739.8|13696.2|5001|0.05|70000|1|1100100014366|IDEA|2021-05-27T14:30:00|12|4|IDEA 24NOV2022 PE 12|1|1


REQUEST BODY SCHEMA

Field Name Data Type Possible Values Description
exchangeSegmentList List <string>

RESPONSES

200:-

Field Name Data Type Description
type DT_Type Response for request
code DT_Code Response code to user request
description DT_Description
result string
Sample Request Header
POST /instruments/master
Authorization: Bearer {token}
Sample Request Body
{
    "exchangeSegmentList": [
        "NSECM"
    ]
}            
Sample Response Body
{
    "result": {
        “NSECM|28633|0|TIJARIA|TIJARIA-IQ|IQ|TIJARIA-IQ|0|0|0|0|5|1
        NSECM|1964|0|TRENT|TRENT-EQ|EQ|TRENT-EQ|0|0|0|0|5|1
        NSECM|6972|0|TRENT|TRENT-BE|BE|TRENT-BE|0|0|0|0|5|1
        NSECM|12843|0|TRENT|TRENT-BL|BL|TRENT-BL|0|0|0|0|5|999999999
        NSECM|28651|0|TRENT|TRENT-IQ|IQ|TRENT-IQ|0|0|0|0|5|1
        NSECM|18504|0|TVVISION|TVVISION-EQ|EQ|TVVISION-EQ|0|0|0|0|5|1
        NSECM|18507|0|TVVISION|TVVISION-BL|BL|TVVISION-BL|0|0|0|0|5|999999999
        NSECM|18508|0|TVVISION|TVVISION-BE|BE|TVVISION-BE|0|0|0|0|5|1
        NSECM|18509|0|TVVISION|TVVISION-IQ|IQ|TVVISION-IQ|0|0|0|0|5|1
        NSECM|8424|0|VIPULLTD|VIPULLTD-EQ|EQ|VIPULLTD-EQ|0|0|0|0|5|1
        NSECM|8434|0|VIPULLTD|VIPULLTD-BL|BL|VIPULLTD-BL|0|0|0|0|5|999999999
        NSECM|8437|0|VIPULLTD|VIPULLTD-BE|BE|VIPULLTD-BE|0|0|0|0|5|1
        NSECM|8440|0|VIPULLTD|VIPULLTD-IQ|IQ|VIPULLTD-IQ|0|0|0|0|5|1”
    },
    "type": "success",
    "code": "success code",
    "description": "data fetched successfully"
} 

Get Series

This API call will return a series you searched based on the exchange segment you have sent in the request.

Endpoint: -/instruments/instrument/series?exchangeSegment=
Method: - GET
Authorization: - Bearer Token

REQUEST IN QUERY PARAMETER

Field Name Data Type Possible Values Description
exchangeSegment DT_ExchangeSegment 1,2 NSECM : 1, NSEFO : 2

RESPONSES

200:-

Field Name Data Type Description
result SeriesData

400:-

On bad request, BadRequestRes model will be returned.

Sample Request Header
GET /instruments/instrument/series?exchangeSegment=2
Authorization: Bearer {token}
        
Sample Response Body
{
    "result": {
        "data": [
            "FUTSTK",
            "OPTSTK",
            "OPTIDX",
            "FUTIDX"
        ]
    }
}
             

Get Equity Symbol

This API call will return anequity symbol information you searched based on the exchange segment, series and symbol you have sent in the request.

Endpoint: - /instruments/instrument/symbol?exchangeSegment=1&series=EQ&symbol=ACC
Method: - GET
Authorization: - Bearer Token

REQUEST IN QUERY PARAMETER

Field Name Data Type Possible Values Description
exchangeSegment DT_ExchangeSegment 1 NSECM : 1
series DT_Series “EQ”
symbol DT_Symbol “ACC”

RESPONSES

200:-
Field Name Data Type Description
type DT_Type Response for request
code DT_Code Response code to user request
description DT_Description
result EquitySymbolRes
400:-

On bad request, BadRequestRes model will be returned.

Sample Request Header
GET /instruments/instrument/symbol?exchangeSegment=1&series=EQ&symbol=ACC
Authorization: Bearer {token}
         
Sample Response Body
{
    "result": {
        "nameWithSeries": "ACC-EQ",
        "exchangeSegment": 1,
        "exchangeInstrumentID": 22,
        "instrumentType": 0,
        "name": "ACC",
        "displayName": "ACC",
        "description": "ACC LIMITED",
        "series": "EQ",
        "instrumentID": 1,
        "priceBand": {
            "high": 1911.2,
            "low": 1885.9,
            "creditRating": "2139.70-2615.15",
            "highString": "1911.2",
            "lowString": "1885.9"
        },
        "freezeQty": 0,
        "tickSize": 0.05,
        "lotSize": 1
    },
    "type": "success",
    "code": "success code",
    "description": "data fetched successfully"
}
            
  

Get Expiry Date

This API call will return expiry date information you searched based on the exchange segment, series and symbol you have sent in the request.

Endpoint: - /instruments/instrument/expiryDate?exchangeSegment=2&series=OPTIDX&symbol=BANKNIFTY
Method: - GET
Authorization: - Bearer Token

REQUEST IN QUERY PARAMETER

Field Name Data Type Possible Values Description
exchangeSegment DT_ExchangeSegment 1, 2 NSECM : 1, NSEFO : 2
series DT_Series “OPTIDX”,
“OPTSTK”,
“FUTIDX”,
“FUTSTK”
symbol DT_Symbol “BANKNIFTY”

RESPONSES

200:-
Field Name Data Type Description
result ExpiryData

400:-

On bad request, BadRequestRes model will be returned.

Sample Request Header
GET /instruments/instrument/expiryDate?exchangeSegment=1&series=EQ&symbol=ACC
Authorization: Bearer {token}
Sample Response Body
{
    "result": {
        "data": [
        "2024-03-28T14:30:00",
        "2024-04-25T14:30:00",
        "2024-06-27T14:30:00",
        "2024-09-26T14:30:00",
        "2024-12-26T14:30:00",
        "2024-03-28T14:30:00",
        "2024-04-25T14:30:00",
        "2024-06-27T14:30:00",
        "2024-09-26T14:30:00",
        "2024-12-26T14:30:00"
        ]
    }
} 

Get Future Symbol

This API call will return future symbol information you searched based on the exchange segment, series, symbol and expiry date you have sent in the request.

Endpoint: /instruments/instrument/futureSymbol?exchangeSegment=2&series=FUTSTK&symbol=ACC&expiryDate=28Mar2024
Method: - GET
Authorization: - Bearer Token

REQUEST IN QUERY PARAMETER

Field Name Data Type Possible Values Description
exchangeSegment DT_ExchangeSegment 2 NSEFO : 2
series DT_Series “FUTIDX”, “FUTSTK”
symbol DT_Symbol “ACC”
expiryDate DT_Date “28Mar2024”

RESPONSES

200:-
Field Name Data Type Description
type DT_Type Response for request
code DT_Code Response code to user request
description DT_Description
result FutureSymbolData
400:-

On bad request, BadRequestRes model will be returned.

Sample Request Header
GET /instruments/instrument/futureSymbol?exchangeSegment=2&series=FUTSTK&symbol=ACC&expiryDate=28Mar2024
Authorization: Bearer {token}
            
Sample Response Body
{
    "result": {
        "underlyingInstrumentId": 22,
        "underlyingIndexName": "ACC24MARFUT",
        "contractExpiration": "2024-03-28T00:00:00",
        "contractExpirationString": "28Mar2024",
        "remainingExpiryDays": 13,
        "exchangeSegment": 2,
        "exchangeInstrumentID": 38783,
        "instrumentType": 0,
        "name": "ACC",
        "displayName": "ACC",
        "description": "ACC24MARFUT",
        "series": "FUTSTK",
        "instrumentID": 1,
        "priceBand": {
            "high": 2675.55,
            "low": 2575,
            "creditRating": "",
            "highString": "2575",
            "lowString": "2675.55"
        },
        "freezeQty": 9001,
        "tickSize": 0.05,
        "lotSize": 300
    },
    "type": "success",
    "code": "success code",
    "description": "data fetched successfully"
}
            

Get Option Symbol

This API call will return option symbol information you searched based on the exchange segment, series, symbol, expiry date, option type and strike price you have sent in the request.

Endpoint: /instruments/instrument/optionSymbol?exchangeSegment=2&series=OPTIDX&symbol=BANKNIFTY&expiryDate=28Mar2024&optionType=CE&strikePrice=46000
Method: - GET
Authorization: - Bearer Token

REQUEST IN QUERY PARAMETER

Field Name Data Type Possible Values Description
exchangeSegment DT_ExchangeSegment 2 NSEFO : 2
series DT_Series “OPTIDX”, “OPTSTK”
symbol DT_Symbol “BANKNIFTY”
expiryDate DT_Date “28Mar2024”
optionType DT_StrOptionType “CE”, “PE”
strikePrice DT_IntPrice 46000

RESPONSES

200:-
Field Name Data Type Description
type DT_Type Response for request
code DT_Code Response code to user request
description DT_Description
result OptionSymbolData
400:-

On bad request, BadRequestRes model will be returned.

Sample Request Header
GET /instruments/instrument/optionSymbol?exchangeSegment=2&series=OPTIDX&symbol=BANKNIFTY&expiryDate=28Mar2024&optionType=CE&strikePrice=46000
Authorization: Bearer {token}
 
Sample Response Body
{
    "result": {
        "strikePrice": 46000,
        "optionType": 1,
        "underlyingInstrumentId": -2,
        "underlyingIndexName": "BANKNIFTY24MAR46",
        "contractExpiration": "2024-03-28T00:00:00",
        "contractExpirationString": "28Mar2024",
        "remainingExpiryDays": 13,
        "exchangeSegment": 2,
        "exchangeInstrumentID": 66679,
        "instrumentType": 0,
        "name": "BANKNIFTY",
        "displayName": "BANKNIFTY",
        "description": "BANKNIFTY24MAR46000CE",
        "series": "OPTIDX",
        "instrumentID": 1,
        "priceBand": {
            "high": 1313.5,
            "low": 1021,
            "creditRating": "",
            "highString": "1313.5",
            "lowString": "1021"
        },
        "freezeQty": 901,
        "tickSize": 0.05,
        "lotSize": 15
    },
    "type": "success",
    "code": "success code",
    "description": "data fetched successfully"
}
 

Get Option Type

This API call will return option type information you searched based on the exchange segment, series, symbol and expiry date you have sent in the request.

Endpoint: /instruments/instrument/optionType?exchangeSegment=2&series=OPTIDX&symbol=BANKNIFTY&expiryDate=28Mar2024
Method: - GET
Authorization: - Bearer Token

REQUEST IN QUERY PARAMETER

Field Name Data Type Possible Values Description
exchangeSegment DT_ExchangeSegment 2 NSEFO : 2
series DT_Series “OPTIDX”, “OPTSTK”
symbol DT_Symbol “BANKNIFTY”
expiryDate DT_Date “28Mar2024”

RESPONSES

200:-
result OptionTypeData
400:-

On bad request, BadRequestRes model will be returned.

Sample Request Header
GET 
/instruments/instrument/optionType?exchangeSegment=2&series=OPTIDX&symbol=BANKNIFTY&expiryDate=28Mar2024
Authorization: Bearer {token}
            
Sample Response Body
 {
  "result": {
    "data": [
        “CE”,
        “PE”
    ]
  }
}    

Index List

This API call will return Index list based on the exchange segment you have sent in the request.

Endpoint: /instruments/indexList?exchangeSegment=2
Method: - GET
Authorization: - Bearer Token

REQUEST IN QUERY PARAMETER

Field Name Data Type Possible Values Description
exchangeSegment DT_ExchangeSegment 1, 2 NSECM : 1, NSEFO : 2

RESPONSES

200:-
Field Name Data Type Description
type DT_Type Response for request
code DT_Code Response code to user request
description DT_Description
result IndexData
400:-

On bad request, BadRequestRes model will be returned.

Sample Request Header
GET /instruments/indexList?exchangeSegment=1
Authorization: Bearer {token}
Sample Response Body
 
{
    "result": [
        "MIDCPNIFTY",
        "FINNIFTY",
        "BANKNIFTY",
        "NIFTY"
    ],
    "type": "success",
    "code": "success code",
    "description": "data fetched successfully"
}    

Instrument By ID

This API call will return the instruments information you searched based on the instrument ID.

Endpoint: /search/instrumentsbyid
Method: - POST
Authorization: - Bearer Token

REQUEST IN QUERY PARAMETER

Field Name Data Type Possible Values Description
source DT_Source
userID DT_UserId
instruments Instrument

RESPONSES

200:-
Field Name Data Type Description
type DT_Type Response for request
code DT_Code Response code to user request
description DT_Description
result InstrumentByID
400:-

On bad request, BadRequestRes model will be returned.

Sample Request Header
  POST /search/instrumentsbyid
  Authorization: Bearer {token}
Sample Request Body
{
    "source": "string",
    "userID": "string",
    "instruments": {
      "exchangeSegment": 1,
      "exchangeInstrumentID": 22
    }
  }
  
Sample Response Body
 
{
    "result": {
        "agm": false,
        "allOrNone": true,
        "bonus": false,
        "dividend": true,
        "egm": false,
        "auctionDetailInfo": {
            "auctionNumber": 1,
            "auctionStatus": 2,
            "initiatorType": 1,
            "settlementPeriod": 1,
            "totalBuyQty": 1,
            "totalSellQty": 1,
            "auctionQty": 1,
            "auctionPrice": 1,
            "bestBuyPrice": 1,
            "bestSellPrice": 1
        },
        "elMargin": 1,
        "interest": false,
        "isin": "",
        "minimumFill": true,
        "rights": false,
        "vaRMargin": 1,
        "issuedCapital": 187787263,
        "boardLotQuantity": 1,
        "faceValue": 0,
        "spread": 0,
        "callAuction1Flag": false,
        "gsmIndicator": 1,
        "settlementNo": "",
        "instrumentID": 1,
        "exchangeInstrumentID": 1,
        "preferredExchangeInstrumentID": 1,
        "preferredExchangeSegment": 2,
        "oppositeExchangeInstrumentID": 1,
        "oppositeExchangeSegment": 1,
        "displayName": "ACC",
        "name": "ACC",
        "auctionNumber": 1,
        "minimumQty": 0,
        "quantityMutliplier": 1,
        "mutliplier": 1,
        "priceNumerator": 1,
        "priceDenominator": 1,
        "lotSize": 1,
        "instrumentType": 0,
        "symbolType": 0,
        "cfiCode": "",
        "status": "",
        "ticksPerPoint": 20,
        "tickSize": 0.05,
        "description": "ACC LIMITED-EQ",
        "isImpliedMarket": false,
        "isTradeable": true,
        "exchangeSegment": 2,
        "series": "EQ",
        "maxTradeVolume": 1,
        "priceBand": {
            "highExecBandString": "NA",
            "lowExecBandString": "NA",
            "highExecBand": 0,
            "lowExecBand": 0,
            "terRange": "",
            "high": 1911.2,
            "low": 1885.9,
            "creditRating": "2139.70-2615.15",
            "highString": "1885.9",
            "lowString": "1911.2"
        },
        "decimalDisplace": 2,
        "extendedMarketProperties": {
            "callAuctionIndicator": {
                "name": "CallAuctionIndicator",
                "value": "0"
            },
            "expulsionDate": {
                "name": "ExpulsionDate",
                "value": "1/1/1980 12:00:00 AM"
            },
            "issueMaturityDate": {
                "name": "IssueMaturityDate",
                "value": "1/1/1980 12:00:00 AM"
            },
            "reAdmissionDate": {
                "name": "ReAdmissionDate",
                "value": "1/1/1980 12:00:00 AM"
            },
            "corporateAction": {
                "name": "CorporateAction",
                "value": ""
            },
            "noDeliveryEndDate": {
                "name": "NoDeliveryEndDate",
                "value": ""
            },
            "issueRate": {
                "name": "IssueRate",
                "value": ""
            },
            "settlementNo": {
                "name": "SettlementNo",
                "value": ""
            },
            "interestPaymentDate": {
                "name": "InterestPaymentDate",
                "value": ""
            },
            "listingDate": {
                "name": "ListingDate",
                "value": "1/1/1980 12:00:00 AM"
            },
            "companyName": {
                "name": "CompanyName",
                "value": "ACC LIMITED"
            },
            "uniqueKey": {
                "name": "UniqueKey",
                "value": "22"
            },
            "creditRating": {
                "name": "CreditRating",
                "value": "2139.70-2615.15"
            },
            "recordDate": {
                "name": "RecordDate",
                "value": "7/7/2023 12:00:00 AM"
            },
            "noDeliveryStartDate": {
                "name": "NoDeliveryStartDate",
                "value": ""
            },
            "marketType": {
                "name": "MarketType",
                "value": ""
            },
            "bookClosureStartDate": {
                "name": "BookClosureStartDate",
                "value": "1/1/1980 12:00:00 AM"
            },
            "exDate": {
                "name": "ExDate",
                "value": "7/7/2023 12:00:00 AM"
            },
            "warningPercent": {
                "name": "WarningPercent",
                "value": "1"
            },
            "issueStartDate": {
                "name": "IssueStartDate",
                "value": "10/24/1994 12:00:00 AM"
            },
            "bookClosureEndDate": {
                "name": "BookClosureEndDate",
                "value": "1/1/1980 12:00:00 AM"
            },
            "remarks": {
                "name": "Remarks",
                "value": ""
            }
        },
        "marketTypeStatusEligibility": {
            "normal": {
                "marketType": 1,
                "eligibile": true,
                "tradingStatus": 1
            },
            "oddLot": {
                "marketType": 1,
                "eligibile": true,
                "tradingStatus": 2
            },
            "retailDebt": {
                "marketType": 1,
                "eligibile": true,
                "tradingStatus": 1
            },
            "auction": {
                "marketType": 1,
                "eligibile": true,
                "tradingStatus": 1
            },
            "callAuction1": {
                "marketType": 1,
                "eligibile": true,
                "tradingStatus": 1
            },
            "callAuction2": {
                "marketType": 1,
                "eligibile": true,
                "tradingStatus": 1
            }
        },
        "nameWithExchange": "ACC-NSECM",
        "nameWithSeries": "ACC-EQ",
        "displayNameWithExchange": "ACC-NSECM",
        "displayNameWithSeries": "ACC-EQ",
        "displayNameWithSeriesAndExchange": "ACC-EQ-NSECM",
        "freezeQty": 0,
        "lastUpdateTime": 1388947530,
        "fiftyTwoWeekHigh": 2675,
        "fiftyTwoWeekLow": 1592.35,
        "bhavcopy": {
            "open": 1899.05,
            "high": 1911.2,
            "low": 1885.9,
            "close": 1900.25,
            "totTrdQty": 465342,
            "totTrdVal": 883557107.05,
            "timeStamp": "2024-02-05T09:34:55Z",
            "totalTrades": 29110,
            "openInterest": 1,
            "settlementPrice": 1
        },
        "additionalPreExpiryMarginPerc": 1,
        "additionalMarginPercLong": 1,
        "additionalMarginPercShort": 1,
        "deliveryMarginPerc": 1,
        "specialMarginPercBuy": 1,
        "specialMarginPercSell": 1,
        "tenderMargin": 1,
        "elmLongMargin": 1,
        "elmShortMargin": 1,
        "initialMarginPerc": 1,
        "exposureMarginPerc": 1,
        "callAuctionIndicator": 0,
        "marketType": 1,
        "currentEligibleMarketType": 1,
        "industry": 0
    },
    "type": "success",
    "code": "success code",
    "description": "data fetched successfully"
}

Instruments By Search String

This API call will return the instruments information you searched based on the search string you have sent in the request.

Endpoint: /search/instruments?searchString=ACC
Method: - GET
Authorization: - Bearer Token

REQUEST IN QUERY PARAMETER

Field Name Data Type Possible Values Description
searchString(required) DT_Code “ACC” NSECM : 1
source(optional) DT_Source

RESPONSES

200:-
Field Name Data Type Description
type DT_Type Response for request
code DT_Code Response code to user request
description DT_Description
result InstrumentBySearchData
400:-

On bad request, BadRequestRes model will be returned.

Sample Request Header
GET /search/instruments?searchString=ACC
Authorization: Bearer {token}                
              
Sample Response Body
 
{
    "result": {
        "exchangeSegment": 2,
        "exchangeInstrumentID": 22,
        "instrumentType": 0,
        "name": "ACC",
        "displayName": "ACC",
        "description": "ACC LIMITED",
        "series": "EQ",

        "nameWithSeries": "ACC-EQ",
        "instrumentID": 1,
        "priceBand": {
            "highExecBandString": "NA",
            "lowExecBandString": "NA",
            "highExecBand": 0,
            "lowExecBand": 0,
            "terRange": "",
            "high": 1911.2,
            "low": 1885.9,
            "creditRating": "2139.70-2615.15",
            "highString": "1911.2",
            "lowString": "1885.9"
        },
        "freezeQty": 0,
        "tickSize": 0.05,
        "lotSize": 1,
        "companyName": "ACC LIMITED",
        "decimalDisplace": "2",
        "isIndex": false,
        "isTradeable": true,
        "industry": 0
    },
    "type": "success",
    "code": "success code",
    "description": "data fetched successfully"
}
    

Web socket

Once the connection is established with the web socket server, real-time data can be obtained by listening to the socket on the relevant broadcast events. You can get the related real-time data on those events. The data received through web socket will be in bytes, you need to deserialize the bytes according to the packet structure. Below are the steps you need to follow to achieve real-time streaming of broadcast events:

  • • • Register broadcast event of socket connection.
  • • Real-time interactive events.


1. Connect

User need to connect server via socket (i.e. web socket). It is important to set path parameter value as ws://serverAddress/token= during connection. Token will be only available after successful login. So make sure you login first then you can connect server via socket.


2. Touchline Event

This event will invoke whenever a touchline event occur. Touchline Binary is the object and its bytes will be in the Final Packet in the packet structure bytes.


3. Market Depth Event

This event will invoke whenever a market depth event occur. Market Depth Binary is the object and its bytes will be in the Final Packet in the packet structure bytes

Protocol Structure

LoginSuccessRes
Field Name Data Type Description
token DT_AuthToken Unique token generated to validate user
userID DT_UserId
appVersion DT_AppVersion

BadRequestRes
Field Name Data Type Description
type DT_Type Error for request
code DT_Code Response code to user request
description DT_Description Reason for failed request

Instrument
Field Name Data Type Description
exchangeSegment DT_ExchangeSegment
exchangeInstrumentID DT_ExchangeInstrumentID

Series Data
Field Name Data Type Description
data List <string>

Equity Symbol Data
Field Name Data Type Possible Values Description
nameWithSeries DT_Series “ACC-EQ”
exchangeSegment DT_ExchangeSegment
exchangeInstrumentID DT_ExchangeInstrumentID
instrumentType DT_InstrumentType
name DT_Name
displayName DT_Name “ACC”
description DT_Name “ACC LIMITED”
series DT_Series “EQ”
instrumentID DT_ExchangeInstrumentID
priceBand PriceBand
freezeQty DT_Qty
tickSize DT_Price
lotSize DT_Qty

Price Band
Field Name Data Type Possible Values Description
high DT_Price
low DT_Price
creditRating DT_Name
highString DT_Name
lowString DT_Name

Expiry Data
Field Name Data Type Description
data List <string>

Future Symbol Data
FieldName DataType Possible Values Description
exchangeSegment DT_ExchangeSegment
exchangeInstrumentID DT_ExchangeInstrumentID
instrumentType DT_InstrumentType
name DT_Name
displayName DT_Name “ACC”
description DT_Name “ACC24MARFUT”
series DT_Series “FUTSTK”
instrumentID DT_ExchangeInstrumentID
priceBand PriceBand
freezeQty DT_Qty
tickSize DT_Price
lotSize DT_Qty
underlyingInstrumentId DT_ExchangeInstrumentID
underlyingIndexName DT_Name
contractExpiration DT_Date “2024-03-28T00:00:00”
contractExpirationString DT_Date “28Mar2024”
remainingExpiryDays DT_Days

Option Symbol Data
FieldName DataType Possible Values Description
exchangeSegment DT_ExchangeSegment
exchangeInstrumentID DT_ExchangeInstrumentID
instrumentType DT_InstrumentType
name DT_Name
displayName DT_Name “ACC”
description DT_Name “ACC24MARFUT”
series DT_Series “FUTSTK”
instrumentID DT_ExchangeInstrumentID
priceBand PriceBand
freezeQty DT_Qty
tickSize DT_Price
lotSize DT_Qty
underlyingInstrumentId DT_ExchangeInstrumentID
underlyingIndexName DT_Name
contractExpiration DT_Date “2024-03-28T00:00:00”
contractExpirationString DT_Date “28Mar2024”
remainingExpiryDays DT_Days
strikePrice DT_IntPrice
optionType DT_OptionType

Option Type Data
Field Name Data Type Description
data List <string>

Instrument by Search Data
FieldName DataType Possible Values Description
exchangeSegment DT_ExchangeSegment
exchangeInstrumentID DT_ExchangeInstrumentID
instrumentType DT_InstrumentType
name DT_Name
displayName DT_Name “ACC”
description DT_Name “ACC24MARFUT”
series DT_Series “FUTSTK”
nameWithSeries DT_Series
instrumentID DT_ExchangeInstrumentID
priceBand PriceBand
freezeQty DT_Qty
tickSize DT_Price
lotSize DT_Qty
companyName DT_Name
decimalDisplace DT_Qty
isIndex DT_Bool
isTradeable DT_Bool
industry DT_IntPrice

Instrument by Id Data
FieldName DataType Possible Values Description
agm DT_Bool
allOrNone DT_Bool
bonus DT_Bool
dividend DT_Bool
egm DT_Bool
auctionDetailInfo AuctionData
elMargin DT_Qty
interest DT_Bool
isin DT_Name
minimumFill DT_Bool
rights DT_Bool
vaRMargin DT_Price
issuedCapital DT_Qty
boardLotQuantity DT_Qty
faceValue DT_Qty
spread DT_IntPrice
callAuction1Flag DT_Bool
gsmIndicator DT_IntPrice
settelementNo DT_IntPrice
instrumentID DT_ExchangeInstrumentID
exchangeInstrumentID DT_ExchangeInstrumentID
preferredExchangeInstrumentID DT_ExchangeInstrumentID
preferredExchangeSegment DT_ExchangeSegment
oppositeExchangeInstrumentID DT_ExchangeInstrumentID
oppositeExchangeSegment DT_ExchangeSegment
displayName DT_Name
name DT_Name
auctionNumber DT_IntPrice
minimumQty DT_Qty
quantityMultiplier DT_Qty
multiplier DT_Qty
priceNumerator DT_IntPrice
priceDenominator DT_IntPrice
lotSize DT_Qty
instrumentType DT_InstrumentType
symbolType DT_IntPrice
cfiCode DT_Name
status DT_Name
ticksPerPoint DT_IntPrice
tickSize DT_Price
description DT_Name
isImpliedMarket DT_Bool
isTradeable DT_Bool
exchangeSegment DT_ExchangeSegment
series DT_Series
maxTradeVolume DT_Qty
priceBand PriceBandIns
decimalDisplace DT_Price
extendedMarketProperties ExtendedMarketProperties
marketTypeStatusEligibility MarketTypeStatusEligibility
nameWithExchange DT_Name
nameWithSeries DT_Series
displayNameWithExchange DT_Name
displayNameWithSeries DT_Series
displayNameWithSeriesAndExchange DT_Series
freezeQty DT_Qty
lastUpdateTime DT_Days
fiftyTwoWeekHigh DT_Price
fiftyTwoWeekLow DT_Price
bhavcopy Bhavcopy
additionalPreExpiryMarginPerc DT_IntPrice
additionalMarginPercLong DT_IntPrice
additionalMarginPercShort DT_IntPrice
deliveryMarginPerc DT_IntPrice
specialMarginPercBuy DT_IntPrice
specialMarginPercSell DT_IntPrice
tenderMargin DT_IntPrice
elmLongMargin DT_IntPrice
elmShortMargin DT_IntPrice
initialMarginPerc DT_IntPrice
exposureMarginPerc DT_IntPrice
callAuctionIndicator DT_IntPrice
marketType DT_MarketType
currentEligibleMarketType DT_IntPrice
industry DT_IntPrice

Bhavcopy Data
FieldName DataType Possible Values Description
open DT_Price
high DT_Price
low DT_Price
close DT_Price
totTrdQty DT_Qty
totTrdVal DT_Price
timeStamp DT_Date
totalTrades DT_Qty
openInterest DT_Qty
settlementPrice DT_Qty

Auction Data
FieldName DataType Possible Values Description
auctionNumber DT_Qty
auctionStatus DT_Qty
initiatorType DT_Qty
settlementPeriod DT_Qty
totalBuyQty DT_Qty
totalSellQty DT_Qty
auctionQty DT_Qty
auctionPrice DT_Qty
bestBuyPrice DT_Qty
bestSellPrice DT_Qty

Price Band Instrument Details
FieldName DataType Possible Values Description
high DT_Price
low DT_Price
highString DT_Name
lowString DT_Name
creditRating DT_Name
highExecBandString DT_Name
lowExecBandString DT_Name
highExecBand DT_Price
lowExecBand DT_Price
terRange DT_Price

Extended Market Properties
FieldName DataType Possible Values Description
callAuctionIndicator KeyValue
expulsionDate KeyValue
issueMaturityDate KeyValue
reAdmissionDate KeyValue
corporateAction KeyValue
noDeliveryEndDate KeyValue
issueRate KeyValue
settlementNo KeyValue
interestPaymentDate KeyValue
listingDate KeyValue
companyName KeyValue
uniqueKey KeyValue
creditRating KeyValue
recordDate KeyValue
noDeliveryStartDate KeyValue
marketType KeyValue
bookClosureStartDate KeyValue
exDate KeyValue
warningPercent KeyValue
issueStartDate KeyValue
bookClosureEndDate KeyValue
remarks KeyValue
KeyValue Data
FieldName DataType Possible Values Description
name DT_Name
value DT_Name
Market Type Status Eligibility
FieldName DataType Possible Values Description
normal MarketEligibleData
oddLot MarketEligibleData
retailDebt MarketEligibleData
auction MarketEligibleData
callAuction1 MarketEligibleData
callAuction2 MarketEligibleData
Market Eligible Data
FieldName DataType Possible Values Description
marketType DT_MarketType
eligible DT_Bool
tradingStatus DT_TradingStatus
Subscription Data
FieldName DataType Possible Values Description
mdp DT_Mdp
quoteList List< Instrument>
listQuotes DT_Description
remaining_Subscription_Count DT_Qty
Unsubscription Data
FieldName DataType Possible Values Description
mdp DT_Mdp
unsubList List< Instrument >
Index List Data
FieldName DataType Possible Values Description
exchangeSegment DT_ExchangeSegment
indexList List<string>
Packet Structure
FieldName DataType Possible Values Description
isGzipCompressed DT_IsGzip 1, 0 1 – uncompressed, 0 - compressed
Packetsize DT_BinaryPacketSize
messageCode DT_BinaryPacketSize 1501, 1502, 1510, 1512 1501 – Touchline, 1502 – Market Depth, 1510 – Open Interest, 1512 - LTPEvent
exchangeSegment DT_BinaryExchangeSegment 1, 2 1 – NSECM, 2 - NSEFO
exchangeInstrumentID DT_ExchangeInstrumentID
bookType DT_BookType
marketType DT_BinaryMarketType
CompressedPacketSize DT_BinaryIntQty
UnCompressedPacketSize DT_BinaryIntQty
Final Packet Bytes Addition of current offset and compressed or uncompressed data
Touchline Binary Structure
FieldName DataType Possible Values Description
messageVersion DT_BinaryPacketSize
applicationType DT_BinaryPacketSize
tokenID DT_BinaryToken
sequenceNumber DT_BinaryToken
SkipBytes DT_BinaryIntQty
exchangeSegment DT_BinaryExchangeSegment
exchangeInstrumentId DT_ExchangeInstrumentID
exchangeTimestamp DT_BinaryIntQty
BidMarketDeptRow MarketDepthRowInfo
AskMarketDeptRow MarketDepthRowInfo
LastUpdateTime DT_BinaryToken
LastTradePrice DT_Price
LastTradedQuantity DT_BinaryIntQty
totalBuyQuantity DT_BinaryQty
totalSellQuantity DT_BinaryQty
totalTradedQuantity DT_BinaryQty
averageTradedPrice DT_Price
lastTradedTime DT_LastTradedTime
percentChange DT_Price
open DT_Price
high DT_Price
low DT_Price
close DT_Price
totalvaluetraded DT_Price
bbtotalbuy DT_BinaryBuySell
bbtotalsell DT_BinaryBuySell
Booktype DT_BookType
MarketType DT_BinaryMarketType
Market Depth Row Info
FieldName DataType Possible Values Description
size DT_BinaryIntQty
rowPrice DT_Price
totalOrders DT_BinaryIntQty
backMarketMakerFlag DT_BackMarketFlag
Market Depth Binary Structure
FieldName DataType Possible Values Description
messageVersion DT_BinaryPacketSize
applicationType DT_BinaryPacketSize
tokenID DT_BinaryToken
sequenceNumber DT_BinaryToken
SkipBytes DT_BinaryIntQty
exchangeSegment DT_BinaryExchangeSegment
exchangeInstrumentId DT_ExchangeInstrumentID
exchangeTimestamp DT_BinaryIntQty
BidCout DT_BinaryIntQty
BidMarketDeptRowList BidMarketDeptRowList
AskCount DT_BinaryIntQty
LastUpdateTime DT_BinaryToken
AskMarketDeptRowList List<MarketDepthRowInfo >
BidMarketDeptRow MarketDepthRowInfo
AskMarketDeptRow MarketDepthRowInfo
LastUpdateTime DT_BinaryToken
LastTradePrice DT_Price
LastTradedQuantity DT_BinaryIntQty
totalBuyQuantity DT_BinaryQty
totalSellQuantity DT_BinaryQty
totalTradedQuantity DT_BinaryQty
averageTradedPrice DT_Price
lastTradedTime DT_LastTradedTime
percentChange DT_Price
open DT_Price
high DT_Price
low DT_Price
close DT_Price
totalvaluetraded DT_Price
bbtotalbuy DT_BinaryBuySell
bbtotalsell DT_BinaryBuySell
Booktype DT_BookType
MarketType DT_BinaryMarketType

Data Types

Below are the user defined data types:-

Name Data Type Remarks
DT_ExchangeSegment integer
DT_ExchangeInstrumentID integer
DT_InstrumentType integer
DT_Price double
DT_Series string
DT_Symbol string
DT_Date string
DT_Name string
DT_Qty integer
DT_MarketType integer
DT_Days integer
DT_Bool boolean
DT_IntPrice integer
DT_BinaryQty uint
DT_BinaryIntQty int
DT_BinaryExchangeSegment short
DT_BinaryMarketType short
DT_BinaryBuySell short
DT_BookType short
DT_BinaryPacketSize ushort
DT_BinaryToken ulong
DT_Type string
DT_Code string
DT_Description string
DT_OptionType integer
DT_LastTradedTime long
DT_BackMarketFlag short
DT_IsGzip sbyte
DT_Mdp integer
DT_TradingStatus integer
DT_AuthToken string
DT_UserId string
DT_AppVersion string
DT_StrOptionType string
DT_Key string
DT_MessageCode integer
DT_Source string