ORVIX REST API Document (4.0.0)

Download OpenAPI specification:

This is the REST API documentation for the Orvix application. You can learn more about API by visiting orvixtech.com/. Please contact in this number +91 9274541010 to obtain API & Secret Key. To test the authorization filters for this sample, you can utilize provided API_key and secret_key.

Introduction

This API is documented and designed to facilitate algorithmic trading activities. It incorporates standard REST API principles to enable seamless communication between trading applications and the underlying platform. The structure of the API is based on the Orvix sample provided by our team. Additionally, it has been extended to showcase the capabilities of the API tool and leverage Orvix documentation. In addition to adhering to standard REST API syntax, the API also utilizes a few vendor extensions to enhance its functionality.

Specification

The API provides detailed information for all available endpoints, including:

  • Supported HTTP methods
  • Request and response structures
  • Authentication requirements
  • Input and output schemas
  • Error-handling standards

The API follows standard REST conventions combined with Orvix-specific vendor extensions to improve performance and enable advanced trading functionality.

Change History

Revised Date Description
25-04-2025 Added NetPosition API
05-11-2025 Added Market Quotes and LTP Quotes in Market Data API
21-11-2025 Added Cancel All Request API documentation, including request/response structure and usage description.
24-11-2025 Added Square Up All Request API (positiontype, product, segment, clientcode), response structure, note on pending orders.

Versions and Dependencies

Language Version Required Libraries / Packages
Python v3.10.12 requests (v2.31.0), json, websockets (v12.0), asyncio (v3.4.3), nest_asyncio (v1.6.0), ssl
Node.js v20.11.1 request (v2.88.2), websockets (v8.16.0)

Rate Limits for Interactive API Calls

API Name Description Limit (Requests/Sec)
/orders Get OrderBook / OrderHistory 1
/orders Place Order 10
/orders/cover Place Cover Order 10
/orders?AppOrderID Cancel Order 10
/orders/cancelall Cancel All Orders 10
/portfolio/holdings Get Holdings 1
/portfolio/position Get Net Position 1
/user/balance Get Balance 1

Common Errors

Status_Code Description Example Response
401 Invalid AccessToken {"status": "unsuccessful", "data": {"error": "Invalid AccessToken"}}
410 Application Not Active {"status": "unsuccessful", "data": {"error": "Application Not Active"}}
404 Application Not Found {"status": "unsuccessful", "data": {"error": "Application Not Found"}}
500 API Server Not Connected {"status": "unsuccessful", "data": {"error": "Api Server Not Connected"}}
409 Invalid API version 4 needed {"status": "unsuccessful", "data": {"error": "Invalid API version 4 needed"}}
405 Invalid Method {"status": "unsuccessful", "data": {"error": "Invalid Method"}}
404 Wrong Request (Invalid Path) {"status": "unsuccessful", "data": {"error": "Wrong Request please check path"}}
429 Msg rate limit exceeded {"status": "unsuccessful", "data": {"error_text": "Message rate limit has exceeded by it's limit"}}

Environment URLs

UAT / Demo

Service Port Base URL Description
Access Web Server 15207 https://wss.orvixtech.com:15207 REST API
WebSocket Feed Server 15208 wss://wss.orvixtech.com:15208 Real-time data stream

Production

Service Port Variable Base URL
Access Web Server {apiPort} https://{clientBaseUrl}:{apiPort}
WebSocket Feed Server {wsPort} wss://{clientBaseUrl}:{wsPort}

Variables

  • clientBaseUrl: Client host domain
  • clientPort: Client port number

Authentication

The Orvix API uses a combination of two authentication methods:

  • API Key
  • SecretKey

ApiKeyAuth

Send Authorization as API_KEY:REQUEST_TOKEN. Example: "QnO9<!*v>RhT|yGv.eZ1KTMxJ:7xO9zEyrBId3N?<|!Vxq".

Security Scheme Type: API_KEY:REQUEST_TOKEN

Login Process

Login Endpoint

This endpoint is used to authenticate a user by sending the api_key and api_secrets to the Interactive API server.
Upon successful validation, the server generates and returns a request token, which remains valid for 24 hours.

header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Request Body schema: application/x-www-form-urlencoded
required
api_key
string

The API application key (e.g., QnO9<!*v>RhT|yGv.eZ1KTMxJ)

api_secrets
string

The secret key for authentication (e.g., OWldYkq3RsPm4RXAV4#D$pHx)

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/connect/login"
payload = {
  "api_key": "API_KEY",
  "api_secrets": "API_SECRET"
}
headers = {
  "Content-Type": "application/x-www-form-urlencoded",
  "Api-Version": "4"
}

response = requests.post(url, data=payload, headers=headers)
print(response.json())

Response samples

Content type
application/json
{
  • "status": "successful",
  • "data": {
    }
}

Logout

This endpoint invalidates the user's active session token and terminates the API session.
After logout, the user must log in again to obtain a fresh request token.
Any API calls using an invalidated token will result in authentication errors.

Authorizations:
ApiKeyAuth
header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/connect/login"
headers = {
  "Api-Version": "4",
  "Authorization": "API_KEY:REQUEST_TOKEN"
}

response = requests.delete(url, headers=headers)
print(response.json())

Response samples

Content type
application/json
{
  • "status": "successful",
  • "data": {
    }
}

Session Token

You need to log in every day or whenever you launch the application. The session token lasts for 24 hours or until logout. If the token expires or the user logs out, a new login is required. This ensures secure, continuous access.

Authorizations:
ApiKeyAuth
header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/session/token"
headers = {
  "Api-Version": "4",
  "Authorization": "API_KEY:REQUEST_TOKEN"
}
response = requests.get(url, headers=headers)
print(response.json())

Response samples

Content type
application/json
{
  • "status": "successful",
  • "data": {
    }
}

User

User Profile

This endpoint retrieves the user's profile details stored by the broker. Users can access their profile at any time.

Authorizations:
ApiKeyAuth
header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/user/profile"

headers = {
  "Api-Version": "4",
  "Authorization": "API_KEY:REQUEST_TOKEN"
}

response = requests.get(url, headers=headers)
print(response.json())

Response samples

Content type
application/json
{
  • "status": "successful",
  • "data": {
    }
}

User Margin

The User Margin endpoint provides detailed information regarding funds, cash, and margin status for the user across both equity and commodity segments. Upon a successful request, the server responds with a JSON object containing various fields, including "status" and "data". The "data" field further encapsulates detailed information related to the user's margin status.

Authorizations:
ApiKeyAuth
header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Responses

Response samples

Content type
application/json
{
  • "status": "successful",
  • "data": {
    }
}

Orders

Orders Regular

The order APIs facilitate placing orders of various types and retrieving daily order information. Users can initiate orders on exchanges and execute orders with stop-loss protection.

Authorizations:
ApiKeyAuth
header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Request Body schema: application/x-www-form-urlencoded
tradingsecurity
string

Unique Security_ID of the script, e.g., "3045"

exchange
string

BSECM, BSECOM, BSEFO, BSEINX, BSEFX, CQG, MCX, NSECD, NSECM, NSEFO, NSEIFSC, NSESLBM, DGCX, IB, MAXXTRADER, NCDEX, NSECOM

transaction_type
string

BUY or SELL

order_type
string

MARKET, LIMIT, SL, SL-M

quantity
string

Quantity to trade, e.g., "10"

validity
string

DAY, IOC, GTT, GTC, OPG, FOK, GTX, GTD, EOS, FAK, ATO, ATC

price
string

Price of the order, e.g., "830.00"

product
string

CNC or NRML

tag
string

Optional alphanumeric tag (max 20 chars)

trigger_price
string

Trigger price for SL / SL-M orders

disclosed_quantity
string

Quantity to disclose publicly (Optional)

userid
string

ClientID (Optional). For manager terminal, pass ClientID here.

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/orders/regular"

payload = {
  "tradingsecurity": "3045",
  "exchange": "NSECM",
  "transaction_type": "BUY",
  "order_type": "LIMIT",
  "quantity": "10",
  "validity": "DAY",
  "price": "830",
  "product": "CNC"
}

headers = {
  "Content-Type": "application/x-www-form-urlencoded",
  "Api-Version": "4",
  "Authorization": "API_KEY:REQUEST_TOKEN"
}

response = requests.post(url, data=payload, headers=headers)
print(response.json())

Response samples

Content type
application/json
{
  • "status": "successful",
  • "data": {
    }
}

Orders Regular SLBM

The Orders Regular SLBM APIs enable users to place and manage orders within the Stock Lending and Borrowing Market (SLBM).

Authorizations:
ApiKeyAuth
header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Request Body schema: application/x-www-form-urlencoded
tradingsecurity
string

Unique Security_ID of the script, e.g., "150013"

exchange
string

NSESLBM

transaction_type
string

BUY / SELL

order_type
string

MARKET, LIMIT

quantity
string

Example: 10

validity
string

DAY, IOC

price
string

Example: 800.00

product
string

CNC, NRML

open_close
string

BUY => Borrow/Recall, SELL => Lend/Repay

userid
string

ClientID: User id of the user provided by Orvix (Optional). ManagerID: If manager terminal, ClientID is sent here.

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/orders/regular"

payload = {
  "tradingsecurity": "150013",
  "exchange": "NSESLBM",
  "transaction_type": "SELL",
  "order_type": "LIMIT",
  "quantity": "8",
  "validity": "DAY",
  "price": "800",
  "product": "NRML",
  "open_close": "Lend",
  "userid": "DAPI1"
}

headers = {
  "Content-Type": "application/x-www-form-urlencoded",
  "Api-Version": "4",
  "Authorization": "API_KEY:REQUEST_TOKEN"
}

response = requests.post(url, data=payload, headers=headers)
data = response.json()
print(data)

Response samples

Content type
application/json
{
  • "status": "successful",
  • "data": {
    }
}

Order Status

This will provide order status of all the placed trades.

Authorizations:
ApiKeyAuth
header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/orders"

headers = {
  "Api-Version": "4",
  "Authorization": "API_KEY:REQUEST_TOKEN"
}

response = requests.get(url, headers=headers)

data = response.json()
print(data)

Response samples

Content type
application/json
{
  • "status": "successful",
  • "data": [
    ]
}

Order Status - OrderID wise

Retrieve the status of a placed trade using the OrderID.

Authorizations:
ApiKeyAuth
header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/orders/2920"

headers = {
  "Api-Version": "4",
  "Authorization": "API_KEY:REQUEST_TOKEN"
}

response = requests.get(url, headers=headers)
data = response.json()
print(data)

Response samples

Content type
application/json
{
  • "status": "Successful",
  • "data": [
    ]
}

Order Status - Reference wise

Retrieve the status of a placed trade using the Tag (Reference) and OrderID.

Authorizations:
ApiKeyAuth
header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/orders/ReferenceTag/2920"

headers = {
  "Api-Version": "4",
  "Authorization": "API_KEY:REQUEST_TOKEN"
}

response = requests.get(url, headers=headers)
data = response.json()
print(data)

Response samples

Content type
application/json
{
  • "status": "Successful",
  • "data": [
    ]
}

Orders Modify Quantity

Modify your open orders by changing order type (MARKET, LIMIT, SL, SL-M), price, quantity, disclosed quantity, or stop-loss.

Authorizations:
ApiKeyAuth
header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Request Body schema: application/x-www-form-urlencoded
order_type
string

Type of order (MARKET, LIMIT, SL, SL-M)

quantity
string

Number of units to buy or sell

price
string

Price at which the user wants to place the order

validity
string

Order validity (DAY, IOC, GTT, GTC, OPG, FOK, GTX, GTD, EOS, FAK, ATO, ATC)

trigger_price
string

Price at which order should be triggered (for SL, SL-M)

disclosed_quantity
string

Quantity to disclose publicly (for equities, optional)

userid
string

User ID provided by Orvix (optional)

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/orders/regular/128439"

payload = {
  "order_type": "MARKET",
  "quantity": "5",
  "validity": "DAY",
  "price": "830"
}

headers = {
  "Content-Type": "application/x-www-form-urlencoded",
  "Api-Version": "4",
  "Authorization": "API_KEY:REQUEST_TOKEN"
}

response = requests.put(url, data=payload, headers=headers)
data = response.json()
print(data)

Response samples

Content type
application/json
{
  • "status": "successful",
  • "data": {
    }
}

Orders Regular MARKET

This endpoint is used to update a regular order by its ID. It sends a PUT request to update the price or type of a regular order.

Authorizations:
ApiKeyAuth
header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Request Body schema: application/x-www-form-urlencoded
order_type
string

MARKET, LIMIT, SL, SL-M

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/orders/regular/128439"

payload = {
  'order_type': 'MARKET'
}
headers = {
  'Api-Version': '4',
  'Authorization': 'API_KEY:REQUEST_TOKEN'
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)

Response samples

Content type
application/json
{
  • "status": "successful",
  • "data": {
    }
}

Orders Regular CANCEL

This API can be called to cancel any open order of the user by providing the correct appOrderID matching with the chosen open order to cancel.

Authorizations:
ApiKeyAuth
header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/orders/regular/128439"

payload = {}
headers = {
  'Api-Version': '4',
  'Authorization': 'API_KEY:REQUEST_TOKEN'
}

response = requests.request("DELETE", url, headers=headers, data=payload)

print(response.text)

Response samples

Content type
application/json
{
  • "status": "successful",
  • "data": {
    }
}

Cancel All Orders

This API cancels all open orders for the authenticated user. The request does not require any specific order identifiers. Once invoked, the system automatically detects and cancels every order that is currently in an open state for the user.

Authorizations:
ApiKeyAuth
header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/orders/cancelall"

headers = {
    "Api-Version": "4",
    "Authorization": "API_KEY:REQUEST_TOKEN"
}

response = requests.delete(url, headers=headers)

print(response.text)

Response samples

Content type
application/json
{
  • "status": "successful",
  • "data": [
    ]
}

trades

Trades

When any order gets executed, a new trade event is generated by the server. Clients can listen to these events by registering to receive them.

Authorizations:
ApiKeyAuth
header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/trades"

headers = {
  'Api-Version': '4',
  'Authorization': 'API_KEY:REQUEST_TOKEN'
}

response = requests.get(url, headers=headers)
print(response.text)

Response samples

Content type
application/json
{
  • "status": "successful",
  • "data": [
    ]
}

Trade - OrderID wise

Fetch executed trade details for a specific order using its OrderID.

Authorizations:
ApiKeyAuth
path Parameters
OrderID
required
string

Unique order ID

header Parameters
Api-Version
required
string
Default: 4

API version for this endpoint. Must be 4.

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/trades/2920"

headers = {
  'Api-Version': '4',
  'Authorization': 'API_KEY:REQUEST_TOKEN'
}

response = requests.get(url, headers=headers)
print(response.text)

Response samples

Content type
application/json
{
  • "status": "successful",
  • "data": [
    ]
}

Trade - Reference wise

Retrieve executed trade details using a reference tag and OrderID.

Authorizations:
ApiKeyAuth
path Parameters
Reference
required
string

Reference tag associated with the order

orderID
required
string

Unique order ID

header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/trades/ReferenceTag/2920"

headers = {
  'Api-Version': '4',
  'Authorization': 'API_KEY:REQUEST_TOKEN'
}

response = requests.get(url, headers=headers)
print(response.text)

Response samples

Content type
application/json
{
  • "status": "Successful",
  • "data": [
    ]
}

Instruments

Instruments List (CSV)

The Instruments API provides a single, consolidated CSV list of tradable assets from various exchanges and segments.

Retrieving the full instrument list
Unlike other APIs that return JSON, this API returns a gzipped CSV dump containing instruments across all exchanges.
The dump is generated once per day, therefore the last_price field is not real-time.

Response Structure (Sample Rows)

security_id security_id. symbol security_description previous_close expiry_date strike_price tick_size quantity option_type instrument_type exchange face_value
2000259 2000259 TRENT TRENT24FEB3640PE 128.75 29FEB2024 3640.00 0.05 400.00 PE OPTSTK BSEFO 1.00
2000259 2000259 TRENT TRENT24FEB3620CE 132.50 29FEB2024 3620.00 0.05 300.00 CE OPTSTK BSEFO 1.00
2000260 2000259 INFY INFY24FEB2000CE 45.80 29FEB2024 2000.00 0.05 500.00 CE OPTSTK NSEFO 5.00
2000260 2000259 INFY INFY24FEB2100PE 50.00 29FEB2024 2100.00 0.05 700.00 PE OPTSTK NSEFO 5.00
2000261 2000259 RELIANCE REL24FEB2500PE 73.20 29FEB2024 2500.00 0.05 200.00 PE OPTSTK NSEFO 10.00

Note:
The actual CSV is very large; the above is only a snippet.

Authorizations:
ApiKeyAuth
header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Request samples

import requests
import csv

url = "https://wss.orvixtech.com:15207/instruments"

headers = {
    'Api-Version': '4',
    'Authorization': 'API_KEY:REQUEST_TOKEN',
    'Content-Type': 'application/x-www-form-urlencoded'
}

response = requests.get(url, headers=headers, verify=False)

if response.status_code == 200:
    content = response.content.decode('utf-8')
    csv_data = [line.split(',') for line in content.split('\n') if line.strip()]

    with open('response_data.csv', 'w', newline='') as csvfile:
        writer = csv.writer(csvfile)
        writer.writerows(csv_data)

    print("Data has been written to response_data.csv successfully.")
else:
    print(f"Error: {response.status_code}")

Expiry

Expiry Date

This endpoint allows the user to retrieve all available expiry dates of a contract using the symbol and exchange.

Authorizations:
ApiKeyAuth
header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Request Body schema: application/x-www-form-urlencoded
symbol
string

Symbol of the instrument (e.g., "NIFTY")

exchange
string

Exchange of the instrument (e.g., "NSEFO")

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/expirydate"

payload = {
  "symbol": "NIFTY",
  "exchange": "NSEFO"
}

headers = {
  "Api-Version": "4",
  "Content-Type": "application/x-www-form-urlencoded",
  "Authorization": "API_KEY:REQUEST_TOKEN"
}

response = requests.get(url, params=payload, headers=headers)
print(response.json())

Response samples

Content type
application/json
{
  • "status": "successful",
  • "data": {
    }
}

NetPosition

NetPosition

The NetPosition API provides the user's current positions.

Fetches user net positions.

  • positiontype=daily → Daily net positions
  • positiontype=expiry / blank("") → Expiry-wise net positions
Authorizations:
ApiKeyAuth
header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Request Body schema: application/x-www-form-urlencoded
required
positiontype
string

Type of position to fetch:

  • daily
  • expiry / blank("")

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/netposition"
payload = 'positiontype=expiry'

headers = {
  'Api-Version': '4',
  'Authorization': 'API_KEY:REQUEST_TOKEN',
  'Content-Type': 'application/x-www-form-urlencoded'
}

response = requests.post(url, headers=headers, data=payload)
print(response.text)

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Square Up All

Square Up All

The Square Up All API allows you to square off your positions for a specific client.
You can execute square-up based on the following parameters:

  • positiontype:

    • expiry / blank("") → Square-up positions based on expiry
    • daily → Square-up only daily positions
  • product:

    • blank("") → all products
    • NRML → Normal trading product
    • CNC → Cash-and-carry product
  • segment:

    • blank("") → all segments
    • NSECM, NSEFO, BSECM, MCX → The exchange segment for the positions
  • clientcode:

    • blank("") → all mapped clientcode wise
    • Specify the client code for whom you want to square-up positions

Note: Before executing a square-up-all request, it is mandatory to cancel all orders request.

Authorizations:
ApiKeyAuth
header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Request Body schema: application/x-www-form-urlencoded
required
positiontype
string

Type of position to fetch:

  • daily → Fetch daily net positions
  • expiry or blank("") → Fetch expiry-wise net positions
product
string

Type of product for trading. Options:

  • blank("") → all products
  • NRML → Normal(INTRADAY) product
  • CNC → Cash & Carry product
segment
string

Exchange segment to fetch positions from. Options:

  • blank("") → all segments
  • NSECM → NSE Cash Market
  • NSEFO → NSE Futures & Options
  • BSECM → BSE Cash Market
  • MCX → Multi Commodity Exchange
clientcode
string

Client code for which the square-up request should be executed.

  • blank("") → all mapped client codes

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/squareupall"
payload = "positiontype=daily&product=NRML&segment=NSECM&clientcode=DAI1"

headers = {
    "Api-Version": "4",
    "Authorization": "API_KEY:REQUEST_TOKEN",
    "Content-Type": "application/x-www-form-urlencoded"
}

response = requests.post(url, headers=headers, data=payload)
print(response.text)

Response samples

Content type
application/json
{
  • "status": "successful",
  • "data": {
    }
}

InstrumentID

Index

This endpoint allows users to fetch the InstrumentID (also known as SecurityID or TradingSecurity) of an index instrument using the symbol, exchange, and instrument type.

Authorizations:
ApiKeyAuth
query Parameters
symbol
required
string
Example: symbol=NIFTY

Symbol of the instrument (e.g., "NIFTY")

exchange
required
string
Example: exchange=NSECM

Exchange of the instrument (e.g., "NSECM")

instrument_type
required
string
Example: instrument_type=INDEX

Instrument type (e.g., "INDEX")

header Parameters
Api-Version
required
string
Default: 4

API version (must be 4 for this request)

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/instrumentid"

payload = {
  "symbol": "NIFTY",
  "exchange": "NSECM",
  "instrument_type": "INDEX"
}

headers = {
  "Api-Version": "4",
  "Authorization": "API_KEY:REQUEST_TOKEN"
}

response = requests.get(url, params=payload, headers=headers)
print(response.json())

Response samples

Content type
application/json
{
  • "status": "successful",
  • "data": {
    }
}

Equity

Retrieve the InstrumentID for a specific Equity.

The InstrumentID is also known as the SecurityID or TradingSecurity.

Notes:

  • For NSECM, use expiry_date = "EQ"
  • For BSECM, use expiry_date = "A"
Authorizations:
ApiKeyAuth
header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Request Body schema: application/x-www-form-urlencoded
required
symbol
string

Symbol of the instrument (e.g., "TCS")

expiry_date
string

Expiry date of the instrument.

  • NSECM: "EQ"
  • BSECM: "A"
exchange
string

Exchange of the instrument (e.g., "NSECM")

instrument_type
string

Instrument type (e.g., "EQUITY")

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/instrumentid"

payload = {
  "symbol": "TCS",
  "expiry_date": "EQ",
  "exchange": "NSECM",
  "instrument_type": "EQUITY",
}

headers = {
  "Api-Version": "4",
  "Authorization": "API_KEY:REQUEST_TOKEN"
}

response = requests.get(url, data=payload, headers=headers)
print(response.json())

Response samples

Content type
application/json
{
  • "status": "successful",
  • "data": {
    }
}

Options

Retrieve the InstrumentID for an Option instrument. This is also known as the SecurityID or TradingSecurity.

Authorizations:
ApiKeyAuth
header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Request Body schema: application/x-www-form-urlencoded
required
symbol
string

Symbol of the instrument (e.g., "NIFTY")

expiry_date
string

Expiry date of the contract (e.g., "16MAY2024")

strike_price
string

Strike price of the option (e.g., "21000")

option_type
string

Option type (e.g., "CE" or "PE")

exchange
string

Exchange of the instrument (e.g., "NSEFO")

instrument_type
string

Instrument type (e.g., "OPT", "OPTIDX")

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/instrumentid"

payload = {
  "symbol": "NIFTY",
  "expiry_date": "16MAY2024",
  "strike_price": "21000",
  "option_type": "PE",
  "exchange": "NSEFO",
  "instrument_type": "OPT",
}

headers = {
  "Api-Version": "4",
  "Authorization": "API_KEY:REQUEST_TOKEN"
}

response = requests.get(url, data=payload, headers=headers)
print(response.json())

Response samples

Content type
application/json
{
  • "status": "successful",
  • "data": {
    }
}

Future

Retrieve the InstrumentID for a Future contract. This is also known as the SecurityID or TradingSecurity.

Authorizations:
ApiKeyAuth
header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Request Body schema: application/x-www-form-urlencoded
required
symbol
string

Symbol of the instrument (e.g., "NIFTY")

expiry_date
string

Expiry date of the contract (e.g., "25JUL2024")

exchange
string

Exchange of the instrument (e.g., "NSEFO")

instrument_type
string

Instrument type (e.g., "FUT", "FUTIDX")

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/instrumentid"

payload = {
  "symbol": "NIFTY",
  "expiry_date": "25JUL2024",
  "exchange": "NSEFO",
  "instrument_type": "FUT",
}

headers = {
  "Api-Version": "4",
  "Authorization": "API_KEY:REQUEST_TOKEN"
}

response = requests.get(url, data=payload, headers=headers)
print(response.json())

Response samples

Content type
application/json
{
  • "status": "successful",
  • "data": {
    }
}

Auction_Orders

Auction Order

Place an Auction Order for stocks currently available in auction. Only stocks present in the user's demat account will appear in auction lists.

Authorizations:
ApiKeyAuth
header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Request Body schema: application/x-www-form-urlencoded
required
tradingsecurity
string

Unique Security_ID of the script (e.g., "220")

exchange
string

Exchange name (e.g., "NSECM")

transaction_type
string

Transaction type (SELL)

order_type
string

Order type (AUCTION)

quantity
string

Order quantity

validity
string

Order validity (e.g., DAY)

price
string

Order price

product
string

Product type (e.g., CNC, NRML)

userid
string

ClientID: User ID provided by Orvix (optional). ManagerID: If manager terminal, ClientID must be sent in this parameter.

tag
string

Optional tag to identify the order (max 20 chars)

auction_number
string

Auction number assigned to the stock

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/auctionorder"

payload = {
  "tradingsecurity": "220",
  "exchange": "NSECM",
  "transaction_type": "SELL",
  "order_type": "AUCTION",
  "quantity": "10",
  "validity": "DAY",
  "price": "830",
  "product": "CNC",
  "userid": "DAPI1",
  "tag": "ReferenceTag",
  "auction_number": "2044"
}

headers = {
  "Content-Type": "application/x-www-form-urlencoded",
  "Api-Version": "4",
  "Authorization": "API_KEY:REQUEST_TOKEN"
}

response = requests.post(url, data=payload, headers=headers)
print(response.json())

Response samples

Content type
application/json
{
  • "status": "successful",
  • "data": {
    }
}

Auction Data

The Auction Orders API provides a daily gzipped CSV file of auction orders from exchanges.

Response CSV Columns:

SecurityID Symbol AuctionNo AuctionStatus InitiatorType TotalBuyQty BuyAmount TotalSellQty SellAmount AuctionQty AuctionPrice SettlementPeriod DateTime
4668 BANKBARODA 15 OPEN_SOLICITOR_PERIOD 0 1 0.00 4 265.00 0 0.00 1 15:47:03
383 BEL 16 OPEN_SOLICITOR_PERIOD 0 1 0.00 3 228.00 0 0.00 1 08:52:33
21113 BFINVEST 17 OPEN_SOLICITOR_PERIOD 0 1 0.00 2 591.00 0 0.00 1 08:54:18
4749 CONCOR 30 OPEN_SOLICITOR_PERIOD 0 1 0.00 1 1049.00 0 0.00 1 15:46:45
422 BHARATFORG 19 OPEN_SOLICITOR_PERIOD 0 1 0.00 1500 1433.85 0 0.00 1 08:53:52

Note: The CSV file is large; above is just a snippet.

header Parameters
Api-Version
required
string
Default: 4

Keep API Version set to 4 for all API calls.

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15207/auctions"
headers = { 'Api-Version': '4' }

response = requests.get(url, headers=headers)
print(response.text)

Response samples

Content type
application/json
{
  • "status": "string",
  • "error": "INVALID_REQUEST"
}

WS Login

Establishing WebSocket connection

Python

import asyncio
import websockets

async def connect_to_server():
    async with websockets.connect('wss://wss.orvixtech.com:15207') as websocket:
        sc = '{"Message":"Login","API_KEY":"QnO9<!*v>RhT|yGv.eZ1KTMxJ","REQUEST_TOKEN":"7xO9zEyrBId3N*<|!Vxq"}'
        await websocket.send(sc)
        while True:
          response = await websocket.recv()
          print( response )
        return

asyncio.run(connect_to_server())

Node.js

const WebSocket = require('ws');

async function connectToServer() {
    const ws = new WebSocket('wss://wss.orvixtech.com:15207');

    ws.on('open', function open() {
        const sc = '{"Message":"Login","API_KEY":"QnO9<!*v>RhT|yGv.eZ1KTMxJ","REQUEST_TOKEN":"7xO9zEyrBId3N*<|!Vxq"}';
        ws.send(sc);
    });

    ws.on('message', function incoming(data) {
        console.log(data);
    });
}

connectToServer();

Response 1

When the websocket connection is established and the user is Successfuly logged in, a "success" response will be received. The connection will then remain open, awaiting further updates from the server, such as when a new order is placed.

{
  "Message": "LoginResponse",
  "Status": "success"
}

Order Response

Response 1

When an order is placed via API or through ORVIX (outside of the websocket), this will provide the following response:

{
    "Message": "Order",
    "status": "Successful",
    "data": {
        "order_id": "23",
        "parent_order_id": "6746",
        "exchange_order_id": "",
        "placed_by": "DAPI1",
        "tradingsymbol": "RELIANCE",
        "exchange": "NSECM",
        "instrument_token": "2885",
        "transaction_type": "Buy",
        "order_type": "MARKET",
        "status": "Unknown",
        "product": "CNC",
        "validity": "DAY",
        "price": "0.00",
        "userid": "DAPI1",
        "quantity": "100",
        "trigger_price": "0.00",
        "pending_quantity": "100",
        "filled_quantity": "0",
        "disclosed_quantity": "0",
        "order_timestamp": "02\/03\/2024 18:58:09",
        "exchange_timestamp": "01\/01\/1970 05:30:00",
        "status_message": "",
        "tag": "HELLOMOTO2"
    }
}



Order structure:

  • order_id: Unique order ID, generated while placing the order.
  • parent_order_id: The parent ID of the order.
  • exchange_order_id: OrderID assigned by exchange.
  • placed_by: Identifier for the entity that placed the order.
  • tradingsymbol: Symbol of the instrument.
  • exchange: The exchange for the order.
  • instrument_token: The numerical identifier issued by the exchange representing the instrument.
  • transaction_type:Type of transaction (e.g., BUY or SELL).
  • order_type: The type of the order (e.g., MARKET, LIMIT, SL, SL-M).
  • status:The status of the order.(e.g., Execute, Pending, Reject, Cancel, Unknown)
  • product:Type of product (e.g., CNC).
  • validity: The validity of the order.
  • price: Price at which the order was placed.
  • userid: User ID associated with the order.
  • quantity: Total quantity of the order placed.
  • trigger_price: The trigger price of the placed order.
  • pending_quantity: Pending quantity to be filled.
  • filled_quantity: Quantity that's been filled.
  • disclosed_quantity: Quantity to be disclosed (may be diffent from actual quantity) to the public exhange orderbook.
  • order_timestamp: Timestamp at which the order was registered by the API.
  • exchange_timestamp: Timestamp at which the order was registered by the exchange.
  • status_message: Textual description of the order's status. Failed orders come with human readable explanation.
  • tag: Additional tag or label (if any).

Trade Response

Response 2 -

When an trade happens in a order placed via API or through ORVIX, this will provide the following Trade response:


{
    "Message": "Trade",
    "status": "Successful",
    "data": {
        "trade_id": "12440",
        "order_id": "6746",
        "exchange_trade_id": "T28856746975208",
        "exchange_order_id": "O28856746",
        "Exchange": "NSECM",
        "tradingsymbol": "RELIANCE",
        "instrument_token": "2885",
        "tag": "HELLOMOTO2",                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
        "product": "CNC",
        "average_price": "2939.50",
        "price": "2939.50",
        "quantity": "100",
        "pending_quantity": "0",
        "transaction_type": "BUY",
        "fill_timestamp": "2024-03-03 00:28:09",
        "order_timestamp": "00:28:09",
        "exchange_timestamp": "2024-03-03 00:28:09"
    }
}

Trade Response structure:

  • trade_id: The unique identifier for the trade.
  • order_id: Unique order ID, generated while placing the order.
  • exchange_trade_id: The unique identifier assigned to the trade by the exchange.
  • exchange_order_id: The unique identifier assigned to the order by the exchange.
  • exchange: The exchange where the trade occurred.
  • tradingsymbol: Symbol of the traded instrument.
  • instrument_token: The numerical identifier issued by the exchange representing the instrument.
  • tag: Additional tag or label (if any).
  • product: Type of product (e.g., CNC).
  • average_price: The average price at which the trade was executed.
  • price: Price at which the order was placed.
  • quantity: Number of Quantity traded.
  • pending_quantity: Pending quantity to be filled in order.
  • transaction_type: Type of transaction (e.g., BUY or SELL).
  • fill_timestamp: The date and time when the trade was executed or filled.
  • order_timestamp: Timestamp at which the order was registered by the API.
  • exchange_timestamp: Timestamp at which the order was registered by the exchange.

Historical data

Historical Market Data

This API retrieves historical market data (OHLCV) for a specified security within a given date and time range.
You must provide the exchange, security identifier, resolution (interval), and the start–end timestamps.

The API supports multiple resolutions:

  • X → Minutes (e.g., 1, 5, 15, 30, 60)
  • XD → Days (e.g., 1D, 3D)
  • XW → Weeks (e.g., 1W)
  • XM → Months (e.g., 1M)

The returned data typically includes:

  • Open Price
  • High Price
  • Low Price
  • Close Price
  • Volume
  • Timestamp

Useful for charting, analysis, and back-testing strategies.

Request Body schema: application/x-www-form-urlencoded
EXC
string

Represents the exchange where the security is traded (e.g., "NSECM", "NSEFO").

SECID
string

Unique security identifier for which historical data is requested (e.g., "2885").

FROM
string

The start timestamp or date (epoch format) from where historical data should be fetched.

TO
string

The end timestamp or date (epoch format) up to where historical data should be fetched.

RESOLUTION
string

Defines the interval of historical data:

  • X → Minutes
  • XD → Days
  • XW → Weeks
  • XM → Months
    Example: "1", "5", "15", "1D", "1W", "1M"

Responses

Request samples

import requests

url = "https://wss.orvixtech.com:15208/ticks?EXC=NSECM&SECID=2885&FROM=1719998100&TO=1720020600&RESOLUTION=15"


response = requests.request("GET", url)
print(response.text)

Response samples

Content type
application/json
{
  • "Response": "Success",
  • "FROM": "1719809100",
  • "TO": "1719914400",
  • "data": [
    ]
}

Market quotes

Market quotes

This endpoint retrieves real-time market quote information for a specified security.
By providing the exchange code (EXC) and security identifier (SECID), the API returns the latest available market data, such as last traded price (LTP), bid/ask details, volume, and other key parameters used for live market analysis.

Request Body schema: application/x-www-form-urlencoded
EXC
string

Represents the exchange where the security is traded (e.g., "NSECM").

SECID
string

Represents the security identifier (e.g., "3045" ).

Responses

Request samples

import requests
url = "https://wss.orvixtech.com:15208/quote?EXC=NSECM&SECID=3045"
response = requests.request("GET", url)
print(response.text)

Response samples

Content type
application/json
{
  • "status": "successful",
  • "data": {
    }
}

LTP quotes

LTP quotes

This API returns the Last Traded Price (LTP) of a security in real time.
Users must provide the exchange (EXC) and security identifier (SECID),
and the API responds with the most recent traded price along with basic
symbol information.

This endpoint is ideal for use cases requiring quick LTP refreshes
without full market depth or quote details.

Request Body schema: application/x-www-form-urlencoded
EXC
string

Represents the exchange where the security is traded (e.g., "NSECM").

SECID
string

Represents the security identifier (e.g., "3045" ).

Responses

Request samples

import requests
url = "https://wss.orvixtech.com:15208/quote/ltp?EXC=NSECM&SECID=3045"
response = requests.request("GET", url)
print(response.text)

Response samples

Content type
application/json
{
  • "status": "successful",
  • "data": {
    }
}

Broadcast

The WebSocket API is the most efficient (speed, latency, resource consumption, and bandwidth) way to receive quotes for instruments across all exchanges during live market hours. A quote consists of fields such as open, high, low, close, last traded price, 5 levels of bid/offer market depth data etc.

Establishing WebSocket connection

To achieve the equivalent WebSocket connection, you can use the websockets library. Here's how you can do it:

Python

import asyncio
import websockets

async def connect_to_server():
    async with websockets.connect('wss://wss.orvixtech.com:15208') as websocket:
        response = await websocket.recv()
        if "HandShake" in response:
            print("WebSocket connection successful!")
        else:
            print("WebSocket connection failed")

asyncio.run(connect_to_server())

Node.js

const WebSocket = require('ws');

async function connectToServer() {
    const websocket = new WebSocket('wss://wss.orvixtech.com:15208');

    websocket.on('message', function(message) {
        if (message.includes('HandShake')) {
            console.log('WebSocket connection successful!');
        } else {
            console.log('WebSocket connection failed');
        }
        websocket.close();
    });
}

connectToServer();

It awaits a message (response) from the server using websocket.recv(). If the received message contains the substring "HandShake", it prints "WebSocket connection successful!" indicating that the handshake process was successful. If the message does not contain "HandShake", it prints "WebSocket connection failed".


Broadcast Request

The script establishes a WebSocket connection to a server, sends a "Broadcast" message upon receiving a handshake, and processes and prints the received broadcast messages containing market data.

Request Structure

{
  "Message": "Broadcast",
  "EXC": "NSECM",
  "SECID": "3045"
}

Python

import asyncio
import websockets

async def connect_to_server():
    async with websockets.connect('wss://wss.orvixtech.com:15208') as websocket:
        response = await websocket.recv()
        if "HandShake" in response:
            sc = '{"Message":"Broadcast","EXC":"NSECM","SECID":"3045"}'
            await websocket.send(sc)
            response = await websocket.recv()
            if '"Broadcast"' in response:
                  print(response)
        else:
            print("WebSocket connection failed")

asyncio.run(connect_to_server())

Node.js

const WebSocket = require('ws');

async function connect() {
    const ws = new WebSocket('wss://wss.orvixtech.com:15208');

    ws.on('open', () => ws.send('{"Message":"Broadcast","EXC":"NSECM","SECID":"3045"}'));
    ws.on('message', data => {
        if (data instanceof Buffer) {
            // Convert binary buffer to string
            data = data.toString('utf-8');
        }
        console.log(data.includes('"Broadcast"') ? data : 'WebSocket connection failed');
    });
}

connect();

Upon receiving a response to this broadcast message, it checks if the response contains "Broadcast". If so, it prints the entire response. The broadcast response itself is a JSON object containing various fields related to market data. It can further be parsed according to the need and requirement.


Response

Example JSON Output

  {
      "Message": "Broadcast",
      "EXC": "NSECM",
      "SECID": "3045",
      "BT": "1709113203",
        "B": [
            {
                "P": "743.45",
                "Q": "91",
                "C": "4"
            },
            {
                "P": "743.40",
                "Q": "2453",
                "C": "8"
            },
            {
                "P": "743.35",
                "Q": "26",
                "C": "3"
            },
            {
                "P": "743.30",
                "Q": "2327",
                "C": "16"
            },
            {
                "P": "743.25",
                "Q": "316",
                "C": "8"
            }
        ],
        "A": [
            {
                "P": "743.50",
                "Q": "11",
                "C": "1"
            },
            {
                "P": "743.55",
                "Q": "267",
                "C": "4"
            },
            {
                "P": "743.65",
                "Q": "1500",
                "C": "1"
            },
            {
                "P": "743.70",
                "Q": "11",
                "C": "1"
            },
            {
                "P": "743.75",
                "Q": "2530",
                "C": "7"
            }
        ],
        "TQT": "10120104",
        "LTP": "743.50",
        "LTQ": "12",
        "LTT": "1709113203",
        "VWAP": "748.39",
        "TBQTY": "609120",
        "TSQTY": "1216842",
        "O": "749.85",
        "H": "756.75",
        "L": "741.00",
        "C": "749.85",
        "OI": "0",
        "LL": "501.55",
        "LH": "777.50",
        "TV": "75737.85"
    }

The broadcast response itself is a JSON object containing various fields related to market data. Here's a breakdown of the structure:

  • EXC: Represents the exchange where the security is traded (e.g., "NSECM").
  • SECID: Represents the security identifier.
  • BT: Broadcast time.
  • B: 5 Array of Buy Side Depth. containing objects with price ("P"), quantity ("Q"), and Order Count ("C").
  • A: 5 Array of Sell Side Depth
  • TQT: Total quantity traded.
  • LTP: Last traded price.
  • LTQ: Last traded quantity.
  • LTT: Last traded time.
  • VWAP: Volume weighted average price.
  • TBQTY: Total buy quantity.
  • TSQTY: Total sell quantity.
  • O: Open price.
  • H: High price.
  • L: Low price.
  • C: Close price.
  • OI: Open interest.
  • LL: Life low.
  • LH: Life high.
  • TV: Total value traded.

Parsing Live VWAP value (From Broadcast)

This is the sample code for getting live VWAP out of broadcast message. Similarly we can all other like the Volume Last trded price (LTP), Last Traded Quantity (LTQ), Close price(C), and more. It's all about finding the right names for these values in the JSON data and adjusting the script accordingly. With a bit of tweaking, you can easily fetch and keep an eye on various live market statistics that matter to you.

Python

import asyncio
import websockets

async def connect_to_server():
    async with websockets.connect('wss://wss.orvixtech.com:15208') as websocket:
        response = await websocket.recv()
        if "HandShake" in response:

            sc = "{\"Message\":\"Broadcast\",\"EXC\":\"NSECM\",\"SECID\":\"3045\"}"
            await websocket.send(sc)

        OldVWAP = -1
        while True:
            response = await websocket.recv()
            if "\"Broadcast\"" in response:
                response_string = response
                responses = response_string.strip().split("\n\n")

            for res in responses:
                data = json.loads(res)
                if "LTP" in data:
                    if (OldVWAP != data["VWAP"] ):
                      OldVWAP = data["VWAP"]
                      print("VWAP:", data["VWAP"])

asyncio.run(connect_to_server())
    

Node.js


const WebSocket = require('ws');

async function connectToServer() {
    const ws = new WebSocket('wss://wss.orvixtech.com:15208');

    ws.on('open', async () => {
        const sc = '{"Message":"Broadcast","EXC":"NSECM","SECID":"3045"}';
        await ws.send(sc);
    });

    let oldVWAP = -1;
    ws.on('message', data => {
        const response = data.toString(); 
        if (response.includes('"VWAP"')) {
            const responses = response.trim().split("\n\n");

            for (const res of responses) {
                try {
                    const jsonData = JSON.parse(res);
                    if (jsonData["VWAP"] && oldVWAP !== jsonData["VWAP"]) {
                        oldVWAP = jsonData["VWAP"];
                        console.log("VWAP:", jsonData["VWAP"]);
                    }
                } catch (error) {
                    console.error('Error parsing JSON:', error);
                }
            }
        }
    });
}

connectToServer().catch(console.error);



  VWAP: 766.44
  VWAP: 766.45
  VWAP: 766.46
  VWAP: 766.47
  VWAP: 766.48
  VWAP: 766.51
  VWAP: 766.52
  VWAP: 766.53
  VWAP: 766.54
  VWAP: 766.62
  VWAP: 766.76
  .
  .
  .
  and so on

VWAP is crucial in stock trading, showing the average price weighted by volume. Traders rely on it to gauge fair value, decide on trades, and minimize market impact. It's especially handy for intraday analysis and algorithmic trading, offering a key reference point for efficient market navigation.

LTP

It is the Last Traded Price at which a security was traded on an exchange. It provides a real-time snapshot of a security's valuation, guiding investment decisions and trading strategies based on current market sentiment.

LTP Request

Request Structure

{
  "Message": "LTP",
  "EXC": "NSEFO",
  "SECID": "35020"
}

Python

import asyncio
import websockets

async def connect_to_server():
    async with websockets.connect('wss://wss.orvixtech.com:15208') as websocket:
        response = await websocket.recv()
        if "HandShake" in response:
            sc = '{"Message":"LTP","EXC":"NSEFO","SECID":"35020"}'
            await websocket.send(sc)
            while True:
              response = await websocket.recv()
              if '"LTP"' in response:
                print(response)
        else:
            print("WebSocket connection failed")

asyncio.run(connect_to_server())

Node.js

const WebSocket = require('ws');

async function connect() {
    const ws = new WebSocket('wss://wss.orvixtech.com:15208');

    ws.on('open', () => ws.send('{"Message":"LTP","EXC":"NSEFO","SECID":"35020"}'));
    ws.on('message', data => {
        if (data instanceof Buffer) {
            // Convert binary buffer to string
            data = data.toString('utf-8');
        }
        console.log(data.includes('"LTP"') ? data : 'WebSocket connection failed');
    });
}

connect();

Response

Example JSON Output

{
    "Message": "LTP",
    "EXC": "NSEFO",
    "SECID": "35020",
    "LTP": "20915.00"
}

LTP Response Structure

  • Message: LTP
  • EXC: Represents the exchange where the security is traded (e.g., "NSEFO").
  • SECID: Represents the security identifier.
  • LTP: Last traded price.

OHLCL

OHLCL stands for Open, High, Low, Close. It's a set of data points commonly used in financial markets to summarize the trading activity of a security over a given period. This data is essential for technical analysis, charting, and understanding market trends.

OHLCL Request

Request Structure

{
  "Message": "OHLCL",
  "EXC": "NSEFO",
  "SECID": "35707"
}

Python

import asyncio
import websockets

async def connect_to_server():
    async with websockets.connect('wss://wss.orvixtech.com:15208') as websocket:
        response = await websocket.recv()
        if "HandShake" in response:
            sc = '{"Message":"OHLCL","EXC":"NSEFO","SECID":"35707"}'
            await websocket.send(sc)
            while True:
              response = await websocket.recv()
              if '"OHLCL"' in response:
                print(response)
        else:
            print("WebSocket connection failed")

asyncio.run(connect_to_server())

Node.js

const WebSocket = require('ws');

async function connect() {
    const ws = new WebSocket('wss://wss.orvixtech.com:15208');

    ws.on('open', () => ws.send('{"Message":"OHLCL","EXC":"NSEFO","SECID":"35707"}'));
    ws.on('message', data => {
        if (data instanceof Buffer) {
            // Convert binary buffer to string
            data = data.toString('utf-8');
        }
        console.log(data.includes('"OHLCL"') ? data : 'WebSocket connection failed');
    });
}

connect();

Response

Example JSON Output

{
    "Message": "OHLCL",
    "EXC": "NSEFO",
    "SECID": "35707",
    "O": "11015.00",
    "H": "11099.25",
    "L": "11013.10",
    "C": "10985.00",
    "LTP": "11092.05"
}

OHLCL Response Structure

  • Message: OHLCL
  • EXC: Represents the exchange where the security is traded (e.g., "NSEFO").
  • SECID: Represents the security identifier.
  • O: Open price.
  • H: High price.
  • L: Low price.
  • C: Close price.
  • LTP: Last traded price.

Watch

The provided data includes essential information for tracking securities in financial markets. It covers details such as the exchange where the security is traded, its unique identifier, and recent trading activity. Other important data points encompass the total quantity and value traded, along with prices at the open, high, low, and close of trading sessions. Additionally, it includes timestamps for the last trade and broadcast, as well as open interest and volume-weighted average price. These details are vital for investors and traders to monitor market movements and make informed decisions.

Watch Request

Request Structure

{
  "Message": "Watch",
  "EXC": "NSEFO",
  "SECID": "71441"
}

Python

import asyncio
import websockets

async def connect_to_server():
    async with websockets.connect('wss://wss.orvixtech.com:15208') as websocket:
        response = await websocket.recv()
        if "HandShake" in response:
            sc = '{"Message":"Watch","EXC":"NSEFO","SECID":"71441"}'
            await websocket.send(sc)
            while True:
              response = await websocket.recv()
              if '"Watch"' in response:
                print(response)
        else:
            print("WebSocket connection failed")

asyncio.run(connect_to_server())

Node.js

const WebSocket = require('ws');

async function connect() {
    const ws = new WebSocket('wss://wss.orvixtech.com:15208');

    ws.on('open', () => ws.send('{"Message":"Watch","EXC":"NSEFO","SECID":"71441"}'));
    ws.on('message', data => {
        if (data instanceof Buffer) {
            // Convert binary buffer to string
            data = data.toString('utf-8');
        }
        console.log(data.includes('"Watch"') ? data : 'WebSocket connection failed');
    });
}

connect();

Response

Example JSON Output

{
    "Message": "Watch",
    "EXC": "NSEFO",
    "SECID": "71441",
    "LTP": "22287.55",
    "LTQ": "50",
    "BP": "22285.05",
    "BQ": "50",
    "SP": "22287.05",
    "SQ": "250",
    "TQT": "1495350",
    "TV": "332965.69659000001",
    "BT": "1708663448",
    "LLT": "1708663447",
    "VWAP": "22266.74",
    "OI": "11420900",
    "O": "22285.10",
    "H": "22344.45",
    "L": "22235.10",
    "C": "22243.25"
}

Watch Response Structure

  • Message: Watch
  • EXC: Represents the exchange where the security is traded (e.g., "NSEFO").
  • SECID: Represents the security identifier.
  • LTP: Last traded price.
  • LTQ: Last traded quantity.
  • BP: (L-1) Bid Price.
  • BQ: (L-1) Bid Quantity.
  • SP: Sell Price.
  • SQ: Sell Quantity.
  • TQT: Total quantity traded.
  • TV: Total value traded.
  • BT: Broadcast time.
  • LLT: Last trade time.
  • VWAP: Volume Weighted Average Price.
  • OI: Open interest.
  • O: Open price.
  • H: High price.
  • L: Low price.
  • C: Close price.

Auction

This script establishes a WebSocket connection to a server, sends an "Auction" message upon receiving a handshake, and processes and prints the received auction messages containing auction data.

Auction Request

Request Structure

{
  "Message": "Auction",
  "EXC": "NSECM",
  "SECID": "10397"
}

Python

import asyncio
import websockets

async def connect_to_server():
    async with websockets.connect('wss://wss.orvixtech.com:15208') as websocket:
        response = await websocket.recv()
        if "HandShake" in response:
            sc = '{"Message":"Auction","EXC":"NSECM","SECID":"10397"}'
            await websocket.send(sc)
            response = await websocket.recv()
            if '"Auction"' in response:
              print(response)
        else:
            print("WebSocket connection failed")

asyncio.run(connect_to_server())

Node.js

const WebSocket = require('ws');

async function connect() {
    const ws = new WebSocket('wss://wss.orvixtech.com:15208');

    ws.on('open', () => ws.send('{"Message":"Auction","EXC":"NSECM","SECID":"10397"}'));
    ws.on('message', data => {
        if (data instanceof Buffer) {
            // Convert binary buffer to string
            data = data.toString('utf-8');
        }
        console.log(data.includes('"Auction"') ? data : 'WebSocket connection failed');
    });
}

connect();

Response

Example JSON Output

{
    "Message": "Auction",
    "EXC": "NSECM",
    "SECID": "10397",
    "BT": "1709113203",
    "B": [
        {
            "P": "0.00",
            "Q": "151",
            "C": "0"
        },
        {
            "P": "0.00",
            "Q": "0",
            "C": "0"
        },
        {
            "P": "0.00",
            "Q": "0",
            "C": "0"
        },
        {
            "P": "0.00",
            "Q": "0",
            "C": "0"
        },
        {
            "P": "0.00",
            "Q": "0",
            "C": "0"
        }
    ],
    "A": [
        {
            "P": "89.00",
            "Q": "151",
            "C": "0"
        },
        {
            "P": "90.90",
            "Q": "150",
            "C": "0"
        },
        {
            "P": "91.00",
            "Q": "151",
            "C": "0"
        },
        {
            "P": "91.50",
            "Q": "50",
            "C": "0"
        },
        {
            "P": "91.86",
            "Q": "151",
            "C": "0"
        }
    ],
    "TQT": "0",
    "LTP": "0.00",
    "LTQ": "0",
    "LTT": "0",
    "VWAP": "0.00",
    "TBQTY": "0",
    "TSQTY": "653",
    "O": "0.00",
    "H": "0.00",
    "L": "0.00",
        "C": "0.00",
        "OI": "0",
        "LL": "0.00",
        "LH": "0.00",
        "TV": "0.00",
        "DPR": "60.82-91.23"
    }

Auction Response Structure

  • EXC: Represents the exchange where the security is traded (e.g., "NSECM").
  • SECID: Represents the security identifier.
  • BT: Broadcast time.
  • B: 5 Array of Buy Side Depth. containing objects with price ("P"), quantity ("Q"), and Order Count ("C").
  • A: 5 Array of Sell Side Depth
  • TQT: Total quantity traded.
  • LTP: Last traded price.
  • LTQ: Last traded quantity.
  • LTT: Last traded time.
  • VWAP: Volume weighted average price.
  • TBQTY: Total buy quantity.
  • TSQTY: Total sell quantity.
  • O: Open price.
  • H: High price.
  • L: Low price.
  • C: Close price.
  • OI: Open interest.
  • LL: Life low.
  • LH: Life high.
  • TV: Total value traded.
  • DPR: Daily price range.