Data Services - NSE

This path is about the data services of NSE Equity : /Api/V1/Data/NseEquity

Retrieving the NSE Data Services

TPIL_NSE_SEGMENT_ID - 4


Nse Equity Request Type

  • NSE_EQUITY_NIFTY_INFO_REQUEST_TYPE = 1
  • NSE_EQUITY_TOUCHLINE_INFO_REQUEST_TYPE = 2
  • NSE_EQUITY_QUOTES_REQUEST_TYPE = 3
  • NSE_EQUITY_TOPGAINERS_INFO_REQUEST_TYPE = 4
  • NSE_EQUITY_TOPLOSERS_INFO_REQUEST_TYPE = 5
  • NSE_EQUITY_INCREMENTAL_TOUCHLINE_INFO_REQUEST_TYPE = 6
  • NSE_EQUITY_INDICES_INFO_REQUEST_TYPE = 7
  • NSE_EQUITY_VOLUMETOPPERS_INFO_REQUEST_TYPE = 8
  • NSE_EQUITY_TURNOVERTOPPERS_INFO_REQUEST_TYPE = 9
  • NSE_EQUITY_LOWPRICEHIGHVOLUME_INFO_REQUEST_TYPE = 10
  • NSE_EQUITY_NEWLISTINGS_INFO_REQUEST_TYPE = 11
  • NSE_EQUITY_MARKETTURNOVER_INFO_REQUEST_TYPE = 12
  • NSE_EQUITY_NEWHIGHLOW_INFO_REQUEST_TYPE = 13
  • NSE_EQUITY_ADVANCEDECLINES_INFO_REQUEST_TYPE = 14
  • NSE_EQUITY_INDEXBASEDTOUCHLINE_INFO_REQUEST_TYPE = 15
  • NSE_EQUITY_INDICES_NEWHIGHLOW_INFO_REQUEST_TYPE = 16
  • NSE_EOD_EQUITY_TOUCHLINE_INFO_REQUEST_TYPE = 17
  • NSE_EQUITY_ANNOUNCEMENTS_INDO_REQUEST_TYPE = 18
  • NSE_EQUITY_INDEXBASEDTOUCHLINE_WITH_PREVIOUSHIGHLOW_INFO_REQUEST_TYPE = 19
  • NSE_EQUITY_BULK_DEAL_INFO_REQUEST_TYPE = 20
  • NSE_EOD_EQUITY_INDICES_INFO_REQUEST_TYPE = 21
  • NSE_EQUITY_MARKET_MOVEMENT_INFO_REQUEST_TYPE = 22
  • TPIL_NSE_EQUITY_MARKET_MOVEMENT_INDICES_INFO_REQUEST_TYPE = 23
  • NSE_EQUITY_CIRCUITLIMIT_INFO_REQUEST_TYPE = 24
  • NSE_EQUITY_PREOPEN_INCREMENTAL_TOUCHLINE_INFO_REQUEST_TYPE = 25
  • NSE_EQUITY_PREOPEN_INDICES_INFO_REQUEST_TYPE = 26
  • NSE_EQUITY_BLOCK_DEAL_INFO_REQUEST_TYPE = 27
  • NSE_EQ_DELIVERY_QTY_DAILY_INFO_REQUEST_TYPE = 28
  • NSE_EQ_DELIVERY_QTY_WEEKLY_INFO_REQUEST_TYPE = 29
  • NSE_EQ_DELIVERY_QTY_MONTHLY_INFO_REQUEST_TYPE = 30
  • NSE_EQ_DELIVERY_QTY_QUATERLY_INFO_REQUEST_TYPE = 31

Request Data

https://www.tickermarket.com/TPILWebAPI/API/V1/Data/DataServices/NSEEquity Segment ID( sid ), Instrument Type(instId), Request Type(rType), Other Info(oInfo)

  • Http Method: must be a POST Request
  • Http Scheme: http
  • Hostname: Server IP ( e.g www.tickermarket.com)
  • Port: 8080
  • Path: TPILWebAPI/Api/V1/DATA/NSEEquity (Data Services Endpoint path)
  • POST parameters:

Headers Parameters

Authorization Bearer GciOiJIUzUxMiJ9.eyJzdWIiOiJERkRFTU8wMDAxICAgICAiLCJleHAiOjE2MjkyMTEyNDMsImlhdCI6MTYyOTE5MzI0M30.7GQJ_UxBecVe-
Content-Type application/json
Accept application/json

Body

{ "sid":"4", "instId":"1", "rType":"1" }

Response JSON Format

Code: 200

Content: { "Segment": "NSE", "Instrument": "Equity", "TPILCode": 3556, "IndexName": "NIFTY 50", "DateTime": "25-August-2021 9:18:35", "CurrentIndexValue": 16663.00, "OpenIndexValue": 16654.00, "HighIndexValue": 16673.85, "LowIndexValue": 16646.65, "CloseIndexValue": 16624.60, "NetChange": 38.40, "PercentChange": 0.23, "52WeekHighIndexValue": 17886.85, "52WeekLowIndexValue": 7511.10 }

Error Response

Code: 401 UNAUTHORIZED
Content: {error: "You are unauthorized to make this request." }

OR

Code: 404 NOT FOUND
Content: {error: "User doesn't exist" }

                                                      
                                                        //Create a URL Object
                                                        URL url = new URL("https://www.tickermarket.com/API/V1/Users/Login");
                                                        //Open a Connection
                                                        HttpURLConnection http = (HttpURLConnection)url.openConnection();
                                                        //Set a request Method
                                                        http.setRequestMethod("POST");
                                                        http.setDoOutput(true);
                                                        //Set the Request Content-Type Header Parameter
                                                        //Set the Response Format type
                                                        http.setRequestProperty("Accept", "application/json");
                                                        http.setRequestProperty("Content-Type", "application/json");
                                                        //Create the Request Body

                                                        String data = "{\n  \"username\": 11111,\n  \"password\": \"abc\"\n}\n";
                                                        byte[] out = data.getBytes(StandardCharsets.UTF_8);
                                                        //Read the Response Data
                                                        OutputStream stream = http.getOutputStream();
                                                        stream.write(out);
                                                        System.out.println(http.getResponseCode() + " " + http.getResponseMessage());
                                                        BufferedReader br=new BufferedReader(new InputStreamReader((http.getInputStream())));
                                                        StringBuilder sb= new StringBuilder();
                                                        String output;
                                                        While((output=br.readLine())!=null)
                                                        {
                                                          sb.append(output);
                                                        }
                                                         catch(Exception e) { System.out.println(“Exception e”+ e);
                                                        http.disconnect();
                                                      

                          var url = “www.tickermarket.com/API/V1/Users/Login”;
 var httpRequest= (HttpWebRequest) WebRequest.Create(url);
httpRequest.Method = “POST”;

httpRequest.Accept = “application/json”;
httpRequest.ContentType = “application/json”;

var logindata = @” {
  “”username”” : 1111,
  “”password”” : abc}”;
Var httpResponse = (HttpWebResponse) httpRequest.GetResponse();
Using ( var streamReader = new
StreamReader(httpResponse.GetResponseStream()))
{
    Var result= streamReader.ReadToEnd();
}
Console.WriteLine(httpResponse.StatusCode);

                        
                                                      
                                                        var url = " www.tickermarket.com/API/V1/Users/Login ";

                                                        var xhr = new XMLHttpRequest();
                                                        xhr.open("POST", url);

                                                        xhr.setRequestHeader("Accept", "application/json");
                                                        xhr.setRequestHeader("Content-Type", "application/json");
                                                        xhr.onreadystatechange = function () {
                                                           if (xhr.readyState === 4) {
                                                              console.log(xhr.status);
                                                              console.log(xhr.responseText);
                                                           }};
                                                        var data = `{
                                                          "username": 1111,
                                                          "password": "Sweet"
                                                        }
                                                        `;

                                                        xhr.send(data);
                                                        
                                                      
                                                        www.tickermarket.com;
$curl = curl_init($url);
curl_seropt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

        $headers = array( “Authorization: Bearer xxx===”, “Content-Type:application/json”,
);
Curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);

$data=  <<< DATA{
{
          “sid” : 1,
       “instId” : 1,
       “rType: 1
}
DATA;
Curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$resp=curl_exec($curl);
curl_close($curl);
Var_dump($resp);
?>

                                                        
                                                      
                                                        curl -d “{ \ “username\” :  \ “ABB \” , \”password\” : \”password\”} -H content-type: application/json”  http://www.tickermarket.com
Curl -X POST http://www.tickermarket.com/Api/V1/Data   -H “Authorization: Bearer xxxxxx”  -H
“Content-Type: application/json” - - data-binary @- << DATA
{
“sid” : “1”,
“instId”: “1”,
“ rType”: “1”
}


                                                        

                          URL url = new
                          URL("https://www.tickermarket.com/API/V1/Data/DataServices/BSEEquity");
                          HttpURLConnection http = (HttpURLConnection)url.openConnection();
                          http.setRequestMethod("POST");
                          http.setDoOutput(true);
                          http.setRequestProperty("Accept", "application/json");
                          http.setRequestProperty("Content-Type", "application/json");
                          http.setRequestProperty("Authorization", "Bearer sdgfdgfdgfdgfdgfdgfgfdgfdgfdgfd");
                          String data = "{\n  \"sid\": 1,\n  \"instId\": 1,\n  \"rType\": 1,\n  }";

                          byte[] out = data.getBytes(StandardCharsets.UTF_8);

                          OutputStream stream = http.getOutputStream();
                          stream.write(out);

                          System.out.println(http.getResponseCode() + " " + http.getResponseMessage());
                          http.disconnect();
                        
                                                      
                                                        var url = “https://www.tickermarket.com/API/V1/Data/DataServices/BSEEquity”;
                                                        var httpRequest= (HttpWebRequest) WebRequest.Create(url);
                                                       httpRequest.Method = “POST”;

                                                       httpRequest.Accept = “application/json”;
                                                       httpRequest.Headers[“Authorization”] = “Bearer xxxxxxx”;
                                                       httpRequest.ContentType = “application/json”;


                                                       var data = @” {
                                                        “”sid”” : 1,
                                                        “”instId”” : 1,
                                                        “”rType”” : 2
                                                       }”;

                                                       Using (var streamWriter = new StreamWriter(httpRequest.GetRequestStream()))
                                                       {
                                                           streamWriter.Write(data);
                                                       }

                                                       var httpResponse = (HttpWebResponse) httpRequest.GetResponse();
                                                       using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
                                                       {
                                                           Var result= streamReader.ReadToEnd();
                                                       }
                                                       Console.WriteLine(httpResponse.StatusCode);

                                                      
                                                      
                                                        Import requests
From requests. Structures import CaseInsensitiveDict
url= “https://www.tickermarket.com/API/V1/Data/DataServices/BSEEquity”
headers = CaseInsensitiveDict()
headers[“Accept”] = ”application/json”
headers[“Authorization”] = ”Bearer xxxx”
headers[“Content-Type]= “application/json”
data= “ “ “
{
  “sid”: 2,
  “instId”: 1,
  “rType”: 1
}
“ “ “
Resp = requests.post(url, headers=headers, data=data)
Print(resp.status_code)


                                                      
                                                      
                                                        Var url=” https://www.tickermarket.com/API/V1/Data/DataServices/BSEEquity”
                                                        Var xhr = new XMLHttpRequest();
                                                      xhr.open(“POST”, url);
                                                      xhr.setRequestHeader(“Accept”, “application/json”);
                                                      xhr.setRequestHeader(“Authorization”, “Bearer ”);
                                                      xhr.setRequestHeader(“Content-Type”, “application/json”);

                                                      xhr.onreadystatechange= function() {
                                                        if(xhr.readyState = = = 4)
                                                      {
                                                      Console.log(xhr.status);
                                                      Console.log(xhr.responseText);
                                                      }};
                                                      Var data = ‘{
                                                        “sid” : 1,
                                                        “instId” : 1,
                                                        “rType : 1
                                                      }’;
                                                      Xhr.send(data);