How to Connect using REST API

Introduction

  • To connect using RESTful APIs, you will need following information :
     
    – “endpoint” to connect to,
    – “port number” to connect to,
    – “API Key” received from our team to access data
  • You will receive this information in the email from our team. Once received, you will need to send request to our server using all of the above parameters every time when you need data – as per below syntax :
  • http://endpoint:port/function_name/?accesskey=apikey
  • For example, to get list of allowed Exchanges under your key, you can send request as :
    http://endpoint:port/GetExchanges/?accesskey=apikey
  • RESTful API returns data in JSON format by default. If you need response in XML format, you will need to append xml=true parameter – as below :
    http://endpoint:port/GetExchanges/?accesskey=apikey&xml=true

List of REST API Functions

REST API Function Description
GetLastQuote Returns LastTradePrice of Single Symbol (detailed)
GetLastQuoteShort Returns LastTradePrice of Single Symbol (short)
GetLastQuoteShortWithClose Returns LastTradePrice of Single Symbol (short with Close of Previous Day)
GetLastQuoteArray Returns LastTradePrice of multiple Symbols – max 25 in single call (detailed)
GetLastQuoteArrayShort Returns LastTradePrice of multiple Symbols – max 25 in single call (short)
GetLastQuoteArrayShortWithClose Returns LastTradePrice of multiple Symbols – max 25 in single call (short with Close of Previous Day)
GetSnapshot Returns latest Snapshot Data of multiple Symbols – max 25 in single call
GetHistory Returns historical data (Tick / Minute / EOD)
GetExchanges Returns array of available exchanges
GetInstrumentsOnSearch Returns array of max. 20 instruments (properties) by selected exchange and ‘search word’
GetInstruments Returns array of instruments (properties) by selected exchange
GetInstrumentTypes Returns list of Instrument Types (e.g. FUTIDX, FUTSTK, etc.)
GetProducts Returns list of Products (e.g. NIFTY, BANKNIFTY, GAIL, etc.)
GetExpiryDates Returns array of Expiry Dates (e.g. 25JUN2020, 30JUL2020, etc.)
GetOptionTypes Returns list of Option Types (e.g. CE, PE, etc.)
GetStrikePrices Returns list of Strike Prices (e.g. 10000, 11000, 75.5, etc.)
GetServerInfo Returns information about server where connection is made
GetLimitation Returns user account information (e.g. which functions are allowed, Exchanges allowed, symbol limit, etc.)
GetMarketMessages Returns array of last messages (Market Messages) related to selected exchange
GetExchangeMessages Returns array of last messages (Exchange Messages) related to selected exchange
GetLastQuoteOptionChain Returns LastTradePrice of entire OptionChain of requested underlying
GetExchangeSnapshot Returns entire Exchange Snapshot as per Period & Periodicity
   
ClientAccess XML Policy This is required for Silverlight Applications
CrossDomain Policy This is required for Adobe Flash Applications

Important Notes

  • – API Functions can accept more than 1 parameter. You will need to send additional parameters by appending the query with “&”
     
    – Our RESTful API accepts and responds to only HTTP GET requests. HTTP POST request or any other type of request WILL NOT work.
     
    – RESTful API Sends data in JSON format by default. To get data in XML format, append “&xml=true” to your query.
     
    – Sometimes, API sends diagnostic messages in plain/text – instead of actual data requested. For example, when API Key is expired / invalid, etc.. Your application should be able to handle these messages in non-JSON / non-XML format.

Was this helpful?