Skip to main content

Watchlist

Watchlist API allows you to create your own watchlist, add or delete instruments to new or existing watchlists. Get a list of predefined watchlists and their constituents.

Watchlist

TypeEndpointDescription
GET/watchlist/Get Watchlist names
POST/watchlist/Get list of instruments in a watchlist
PUT/watchlist/Add new watchlist
DELETE/watchlist/Delete an existing watchlist
PUT/watchlist/script/Add stocks to watchlist
DELETE/watchlist/script/Delete stocks from watchlist

Predefined watchlists

TypeEndpointDescription
GET/watchlist/predefined/Get the list of predefined watchlist
POST/watchlist/predefined/Get the list of instruments present in predefined watchlist

Get Watchlist Names

Get watchlist names

Get the list of watchlist names of the user.

Request

curl --location --request GET '{BASEURL}/watchlist/' \
--header 'access-token: access-token' \
--header 'Content-Type: application/json' \
--data-raw ''

Response The success response will be having a status code as 200. If HTTP status code is received in response like 4xx or 5xx, this means failure or exceptions. Success response will return the list of watchlist names as below.

[
“watchlist1”,
“Watchlist2”,
“watchlist3”
]

Get Watchlist's instruments

Get watchlist’s instruments

Get the details of all the instruments present in a watchlist

Request

curl --location --request POST '{BASEURL}/watchlist/' \
--header 'access-token: access-token' \
--header 'Content-Type: application/json' \
--data-raw '{"name" : "watchlist_name"}'

Response

The success response will be having a status code as 200. If HTTP status code is received in response like 4xx or 5xx, this means failure or exceptions. Success response will return the list of instrument details as below.

[
{
"exchange_name": 1,
"token": "1285",
"trading_symbol": "HDFC-EQ",
"lot_size": "1",
"tick_size": "0.05",
"instrument_type": "EQUITY",
"instrument_name": "EQ"
},
{
"exchange_name": 1,
"token": "22",
"trading_symbol": "ACC-EQ",
"lot_size": "1",
"tick_size": "0.05",
"instrument_type": "EQUITY",
"instrument_name": "EQ"
},
]
Instrument detail attributes
FieldField typeDescription
exchange_nameintegerExchange name
tokenstringUnique identifier for instrument
trading_symbolstringTrading symbol for instrument
lot_sizestringLot size of the instrument
tick_sizestringTick size of price of the instrument
instrument_typestringInstrument type
instrument_namestringName of the instrument

Add Watchlist

Add new watchlist

Create a new watchlist.

Request

curl --location --request PUT '{BASEURL}/watchlist/' \
--header 'access-token: access-token' \
--header 'Content-Type: application/json' \
--data-raw '{"name" : "watchlist_name"}'

Response

HTTP status code 201 is recieved when a new watchlist is created. The response body is null.

Delete Watchlist

Delete a watchlist

Delete an existing watchlist using wathclist name.

Request

curl --location --request DELETE '{BASEURL}/watchlist/' \
--header 'access-token: access-token' \
--header 'Content-Type: application/json' \
--data-raw '{"name" : "watchlist_name"}'

Response

HTTP status is 200 and response body is null.

Add stocks to Watchlist

Add stocks to watchlist

Add stock to a wathclist. If wathclist doesn't exist then it will be created.

Request

curl --location --request PUT '{BASEURL}/watchlist/script/' \
--header 'access-token: access-token' \
--header 'Content-Type: application/json' \
--data-raw '{
"name" : "newname 3",
"data": [
{
"exchange_name": "NSE",
"token": "22"
},
{
"exchange_name": "NSE",
"token": "10"
}
]
}'

Request Parameters

FieldField typeDescription
namestringwathclist name in which instruments or stocks will be added
datalist of instrument detailslist of instrument details

instrument details

FieldField typeDescription
exchange_nameintegerExchange name
tokenstringUnique identifier for instrument

Response

Response body is null with HTTP status code 200 for success.

Delete instruments from a watchlist

Delete stocks from a watchlist

Delete stocks or instruments from a watchlist

Request

curl --location --request DELETE 'http://localhost:80/external/api/v0/watchlist/script/' \
--header 'access-token: access-token' \
--header 'Content-Type: application/json' \
--data-raw '{
"name" : "Watchlist_name",
"data": [
{
"exchange_name": "NSE",
"token": "22"
},
{
"exchange_name": "NSE",
"token": "10"
}
]
}'

Response

Response body is null and HTTP status code is 200 for success.

Get predefined watchlist

Get Predefined Watchlist names

Gets the names of predefined watchlists. The predefined watchlist will be the same for all the users.

Request

curl --location --request GET 'http://localhost:80/external/api/v0/watchlist/predefined/'
--header 'access-token: access-token' \
--header 'Content-Type: application/json' \

Response The success response will be having a status code as 200. If HTTP status code is received in response like 4xx or 5xx, this means failure or exceptions. Success response will return the list of watchlist names as below

[
“NIFTY”,
“SENSEX”
]

Get instruments of predefined watchlist

Get Predefined watchlist’s instruments

Gets the list of instruments present in a predefined watchlist.

Request

curl --location --request POST '{BASEURL}/watchlist/predefined/' \
--header 'access-token: access-token' \
--header 'Content-Type: application/json' \
--data-raw '{"name" : "watchlist_name"}'

Request parameter

FieldField typeDescription
namestringName of the watchlist

Response

The success response will be having a status code as 200. If HTTP status code is received in response like 4xx or 5xx, this means failure or exceptions. Success response will return the list of instrument details as below.

[
{
"exchange_name": 1,
"token": "1285",
"trading_symbol": "HDFC-EQ",
"lot_size": "1",
"tick_size": "0.05",
"instrument_type": "EQUITY",
"instrument_name": "EQ"
},
{
"exchange_name": 1,
"token": "22",
"trading_symbol": "ACC-EQ",
"lot_size": "1",
"tick_size": "0.05",
"instrument_type": "EQUITY",
"instrument_name": "EQ"
},
]

Instrument details attributes

FieldField typeDescription
exchange_nameintegerExchange name
tokenstringUnique identifier for instrument
trading_symbolstringTrading symbol for instrument
lot_sizestringLot size of the instrument
tick_sizestringTick size of price of the instrument
instrument_typestringInstrument type
instrument_namestringName of the instrument