Skip to main content

Websocket

Getting Started

Introduction

  • The WebSocket API serves as an advanced technology that enables the establishment of a bidirectional communication channel
    between a user's browser and a server. Through this API, users can seamlessly send messages to a server and receive responses
    driven by events, eliminating the need for continuous polling of the server for replies.
  • With the WebSocket API, users gain the capability to access real-time quotes for all scripts across various Indian Exchanges during
    market hours. These data feeds are broadly classified into two categories: Market Feed and Depth Feed. Upon initiating a new
    connection, users can anticipate receiving an acknowledgment, typically denoted as "tk," followed by the exchange feed, commonly
    represented as "tf."

Create Session

Connection String

Create Connection to Websocket using the following URL:

wss://norenapi.thefirstock.com/NorenWSTP/

Request

{
	"susertoken": "4cc80a3c2a22a94e07967d28bb58f4e59e69e3f2f4", # Session generated from the login api
	"t": "c",
	"actid": userId,
	"uid": userId,
	"source": "API"
}

If connection has been established successfully:

{"t":"ck","k":"OK"}

If validation fails, response will show as its failed:

{"t":"ck","k":"NOT_OK"}