Skip to content

Search Scripts

The Search Scripts APIs enable you to search instruments using key words.

POST: /api/searchScrips

https://connect.thefirstock.com/api/searchScrips

Request Details

Parameter Description
userId Logged in User Id
stext Search Text
exchange Exchange (Select from ‘exarr’ Array provided in User Details response

Code

from thefirstock import thefirstock 

SS = thefirstock.firstock_SearchScrips(
stext='ITC',
)
   curl -X POST 'https://connect.thefirstock.com/api/searchScrips' \
     -H 'Content-Type: application/json' \
     -d '{
     "userId": "",
     "jKey": "",
     "stext": "ITC"
      }'
const Firstock = require('thefirstock');

const firstock = new Firstock();

firstock.searchScripts({stext:""},(err, result)=>{
console.log("Error, ",err)
console.log("Result: ",result)
})
using thefirstock;

class Program
{
public static void Main()
{
    Firstock firstock = new Firstock();
    var result = firstock.searchScripts(stext: "ITC");
}
}

Response Details

Response data will be in json format with below fields.

Parameter Description
stat Ok or Not_Ok
Watch list update success or failure indication.
values Array of json objects. (object fields given in below table)
emsg This will be present only in case of errors. That is : 1) Invalid Input 2) Session Expired

Response Details: Json Fields of object in values Array

Parameter Description
exch NSE, BSE, NFO ...
Exchange
tsym Trading symbol of the scrip (contract)
tokem Token of the scrip (contract)
pp Price precision
ti Tick size
ls Lot size

Sample Response

{
   "stat": "Ok",
   "values": [
{
  "exch": "NSE",
  "token": "1660",
  "tsym": "ITC-EQ",
  "pp": "2",
  "ls": "1",
  "ti": "0.05"
},
{
  "exch": "BSE",
  "token": "500875",
  "tsym": "ITC",
  "pp": "2",
  "ls": "1",
  "ti": "0.05"
},
{
  "exch": "NFO",
  "token": "56843",
  "tsym": "ITC30JUN22F",
  "dname": "ITC JUN FUT",
  "pp": "2",
  "ls": "3200",
  "ti": "0.05"
},
{
  "exch": "NFO",
  "token": "54151",
  "tsym": "ITC28JUL22F",
  "dname": "ITC JUL FUT",
  "pp": "2",
  "ls": "3200",
  "ti": "0.05"
},
{
  "exch": "NFO",
  "token": "82381",
  "tsym": "ITC25AUG22F",
  "dname": "ITC AUG FUT",
  "pp": "2",
  "ls": "3200",
  "ti": "0.05"
},
{
  "exch": "NFO",
  "token": "93884",
  "tsym": "ITC30JUN22P155",
  "dname": "ITC JUN 155 PE ",
  "pp": "2",
  "ls": "3200",
  "ti": "0.05"
},
{
  "exch": "NFO",
  "token": "93883",
  "tsym": "ITC30JUN22C155",
  "dname": "ITC JUN 155 CE ",
  "pp": "2",
  "ls": "3200",
  "ti": "0.05"
},
{
  "exch": "NFO",
  "token": "93886",
  "tsym": "ITC30JUN22P157.5",
  "dname": "ITC JUN 157.50 PE ",
  "pp": "2",
  "ls": "3200",
  "ti": "0.05"
},
{
  "exch": "NFO",
  "token": "93885",
  "tsym": "ITC30JUN22C157.5",
  "dname": "ITC JUN 157.50 CE ",
  "pp": "2",
  "ls": "3200",
  "ti": "0.05"
},
{
  "exch": "NFO",
  "token": "93888",
  "tsym": "ITC30JUN22P160",
  "dname": "ITC JUN 160 PE ",
  "pp": "2",
  "ls": "3200",
  "ti": "0.05"
},
{
  "exch": "NFO",
  "token": "93887",
  "tsym": "ITC30JUN22C160",
  "dname": "ITC JUN 160 CE ",
  "pp": "2",
  "ls": "3200",
  "ti": "0.05"
},
{
  "exch": "NFO",
  "token": "93890",
  "tsym": "ITC30JUN22P162.5",
  "dname": "ITC JUN 162.50 PE ",
  "pp": "2",
  "ls": "3200",
  "ti": "0.05"
},
{
  "exch": "NFO",
  "token": "93889",
  "tsym": "ITC30JUN22C162.5",
  "dname": "ITC JUN 162.50 CE ",
  "pp": "2",
  "ls": "3200",
  "ti": "0.05"
},
{
  "exch": "NFO",
  "token": "93892",
  "tsym": "ITC30JUN22P165",
  "dname": "ITC JUN 165 PE ",
  "pp": "2",
  "ls": "3200",
  "ti": "0.05"
},
{
  "exch": "NFO",
  "token": "93891",
  "tsym": "ITC30JUN22C165",
  "dname": "ITC JUN 165 CE ",
  "pp": "2",
  "ls": "3200",
  "ti": "0.05"
},
{
  "exch": "NFO",
  "token": "93894",
  "tsym": "ITC30JUN22P167.5",
  "dname": "ITC JUN 167.50 PE ",
  "pp": "2",
  "ls": "3200",
  "ti": "0.05"
},
{
  "exch": "NFO",
  "token": "93893",
  "tsym": "ITC30JUN22C167.5",
  "dname": "ITC JUN 167.50 CE ",
  "pp": "2",
  "ls": "3200",
  "ti": "0.05"
},
{
  "exch": "NFO",
  "token": "93896",
  "tsym": "ITC30JUN22P170",
  "dname": "ITC JUN 170 PE ",
  "pp": "2",
  "ls": "3200",
  "ti": "0.05"
},
{
  "exch": "NFO",
  "token": "93895",
  "tsym": "ITC30JUN22C170",
  "dname": "ITC JUN 170 CE ",
  "pp": "2",
  "ls": "3200",
  "ti": "0.05"
},
{
  "exch": "NFO",
  "token": "93898",
  "tsym": "ITC30JUN22P172.5",
  "dname": "ITC JUN 172.50 PE ",
  "pp": "2",
  "ls": "3200",
  "ti": "0.05"
},
{
  "exch": "NFO",
  "token": "93897",
  "tsym": "ITC30JUN22C172.5",
  "dname": "ITC JUN 172.50 CE ",
  "pp": "2",
  "ls": "3200",
  "ti": "0.05"
},
{
  "exch": "NFO",
  "token": "93900",
  "tsym": "ITC30JUN22P175",
  "dname": "ITC JUN 175 PE ",
  "pp": "2",
  "ls": "3200",
  "ti": "0.05"
},
{
  "exch": "NFO",
  "token": "93899",
  "tsym": "ITC30JUN22C175",
  "dname": "ITC JUN 175 CE ",
  "pp": "2",
  "ls": "3200",
  "ti": "0.05"
},
{
  "exch": "NFO",
  "token": "93902",
  "tsym": "ITC30JUN22P177.5",
  "dname": "ITC JUN 177.50 PE ",
  "pp": "2",
  "ls": "3200",
  "ti": "0.05"
},
{
  "exch": "NFO",
  "token": "93901",
  "tsym": "ITC30JUN22C177.5",
  "dname": "ITC JUN 177.50 CE ",
  "pp": "2",
  "ls": "3200",
  "ti": "0.05"
 }
 ]
 }
{
 "stat": "Not_Ok",
 "emsg": "No Data :"
}