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
Type | Endpoint | Description |
---|---|---|
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
Type | Endpoint | Description |
---|---|---|
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
Field | Field type | Description |
---|---|---|
exchange_name | integer | Exchange name |
token | string | Unique identifier for instrument |
trading_symbol | string | Trading symbol for instrument |
lot_size | string | Lot size of the instrument |
tick_size | string | Tick size of price of the instrument |
instrument_type | string | Instrument type |
instrument_name | string | Name 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
Field | Field type | Description |
---|---|---|
name | string | wathclist name in which instruments or stocks will be added |
data | list of instrument details | list of instrument details |
instrument details
Field | Field type | Description |
---|---|---|
exchange_name | integer | Exchange name |
token | string | Unique 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 watchlistRequest
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
Field | Field type | Description |
---|---|---|
name | string | Name 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
Field | Field type | Description |
---|---|---|
exchange_name | integer | Exchange name |
token | string | Unique identifier for instrument |
trading_symbol | string | Trading symbol for instrument |
lot_size | string | Lot size of the instrument |
tick_size | string | Tick size of price of the instrument |
instrument_type | string | Instrument type |
instrument_name | string | Name of the instrument |