Not able to get index data in Search Script api.
-
Re: Announcing Search Scrip API endpoint for Smart API Users
HI @Moderator_1 ,@Moderator_2 ,
Am i doing it wrong or api not support index search.
Please correct me.
Below is node.js code
I want to access nifty index script token but i am not getting it in response.let searchScript = (req,res,next)=> {
smart_api.searchScrip({
"exchange": "NSE",
"searchscrip":"Nifty50"
})
.then((data) => {
console.log(JSON.stringify(data))
res.json(data);
})
.catch((ex) => {
//Log error
res.json(ex);
});
} -
Apologies for the delayed response.
Only traded symbol will be pushed via search scrip API.
Index scrip(any token starts with "999") is not allowed for trading and same wouldn't be pushed on list of scripsRegards,
SmartAPI team -
Hi @Moderator_2 ,
I have tried searching with "NIFTY" as per above but didnt found Nifty index object.please check below code
let searchScript = (req,res,next)=> {
smart_api.searchScrip({
"exchange": "NSE",
"searchscrip":"NIFTY"
})
.then((data) => {
console.log(JSON.stringify(data))
res.json(data);
})
.catch((ex) => {
//Log error
res.json(ex);
});
}
I am using node.js library "smartapi-javascript": "^1.0.21"
which has url - search_scrip : '/rest/secure/angelbroking/order/v1/searchScrip',response which i get ->
[
{
"exchange": "NSE",
"tradingsymbol": "NIFTY50ADD-BL",
"symboltoken": "7455"
},
{
"exchange": "NSE",
"tradingsymbol": "NIFTY50ADD-EQ",
"symboltoken": "7451"
},
{
"exchange": "NSE",
"tradingsymbol": "NIFTY50ADD-RL",
"symboltoken": "7452"
},
{
"exchange": "NSE",
"tradingsymbol": "NIFTYBEES-BL",
"symboltoken": "13048"
},
{
"exchange": "NSE",
"tradingsymbol": "NIFTYBEES-EQ",
"symboltoken": "10576"
},
{
"exchange": "NSE",
"tradingsymbol": "NIFTYBEES-RL",
"symboltoken": "30485"
},
{
"exchange": "NSE",
"tradingsymbol": "NIFTYBENAV-EQ",
"symboltoken": "30116"
},
{
"exchange": "NSE",
"tradingsymbol": "NIFTYBETF-BL",
"symboltoken": "21985"
},
{
"exchange": "NSE",
"tradingsymbol": "NIFTYBETF-EQ",
"symboltoken": "21959"
},
{
"exchange": "NSE",
"tradingsymbol": "NIFTYBETF-RL",
"symboltoken": "21984"
},
{
"exchange": "NSE",
"tradingsymbol": "NIFTYBINAV-EQ",
"symboltoken": "22037"
},
{
"exchange": "NSE",
"tradingsymbol": "NIFTYETF-BL",
"symboltoken": "6354"
},
{
"exchange": "NSE",
"tradingsymbol": "NIFTYETF-EQ",
"symboltoken": "6353"
},
{
"exchange": "NSE",
"tradingsymbol": "NIFTYETF-RL",
"symboltoken": "17595"
},
{
"exchange": "NSE",
"tradingsymbol": "NIFTYIETF-BL",
"symboltoken": "29554"
},
{
"exchange": "NSE",
"tradingsymbol": "NIFTYIETF-EQ",
"symboltoken": "29553"
},
{
"exchange": "NSE",
"tradingsymbol": "NIFTYIETF-RL",
"symboltoken": "21202"
},
{
"exchange": "NSE",
"tradingsymbol": "NIFTYQLITY-BL",
"symboltoken": "10692"
},
{
"exchange": "NSE",
"tradingsymbol": "NIFTYQLITY-EQ",
"symboltoken": "10690"
},
{
"exchange": "NSE",
"tradingsymbol": "NIFTYQLITY-RL",
"symboltoken": "10691"
}
]i want nifty index object which is not available in search_script api
Please check.
-
Kindly initiate a searchscrip key as "NIFTY".
To retrieve any scrip from search scrip API, on Openscripmaster.json file please fetch key "name" to pass here on Search API
Sample data:
{"token":"99926000","symbol":"Nifty 50","name":"NIFTY","expiry":"","strike":"0.000000","lotsize":"1","instrumenttype":"AMXIDX","exch_seg":"NSE","tick_size":"0.000000"}Regards,
SmartAPI team