Data Services - NSE

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

URL

Example POST API Request

http://uat.tickermarket.com/TPILWebAPI/Api/V1/Data/NseEquity

Request Data Information

https://uat.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: http://uat.tickermarket.com
  • Path: TPILWebAPI/ Api/V1/DATA/NseEquity (Data Services Endpoint path)
  • POST parameters:

Request

Key Required Value Discription
Segments TPIL_NSE 4 NSE Segment
Instrument TPIL_NSE Equity 1 NSE Equity Instruments
Request Type NSE Equity 1 - 32 NSE Data Feed Services
Otherinfo Optional 0 Timestamp-Seconds
                                                      
                            {
                              "sid":"4",
                              "instId":"1",
                              "rType":"2"
                            }
                                                                              
                                                      
                            Authorization: Bearer GciOiJIUzUxMiJ9.eyJzdWIiOiJERkRFTU8wMDAxICAgICAiLCJleHAiOjE2MjkyMTEyNDMsImlhdCI6MTYyOTE5MzI0M30.7GQJ_UxBecVe-
                            Content-Type: application/json
                            Accept: application/json
                          
                                                      
                        [
    {
      "Segment": "NSE",
        "Instrument": "Equity",
        "TPILCode": 1,
        "Symbol": "3IINFOLTD",
        "Series": "EQ",
        "CompanyName": "3i Infotech",
        "DateTime": "1-August-2022 15:48:52",
        "BestBuyQty": 25,
        "BestBuyPrice": 41.70,
        "BestSellQty": 0,
        "BestSellPrice": 0.00,
        "LastTradedPrice": 41.70,
        "Volume": 677355,
        "NetChange": -1.35,
        "PercentChange": -3.14,
        "OpenPrice": 42.00,
        "HighPrice": 42.70,
        "LowPrice": 41.10,
        "ClosePrice": 43.05,
        "Value": 2.82,
        "52WeekHighPrice": 119.30,
        "52WeekLowPrice": 6.65,
        "nMsgTimeStamp": 1343836132,
        "52WeekHighDateTime": "Dec 16 2021  3:59PM",
        "52WeekLowDateTime": "Aug 24 2021  3:59PM",
        "PrevDayHighPrice": 43.90,
        "PrevDayLowPrice": 41.70,
        "WeightedAverage": 41.69,
        "PrevBeta": 0.0247
                     }
    ]

                      
                                                      
                            {
                              "sid":"4",
                              "instId":"1",
                              "rType":"1"
                                                                               }
                                                                              
                                                      
                            Authorization: Bearer GciOiJIUzUxMiJ9.eyJzdWIiOiJERkRFTU8wMDAxICAgICAiLCJleHAiOjE2MjkyMTEyNDMsImlhdCI6MTYyOTE5MzI0M30.7GQJ_UxBecVe-
                            Content-Type: application/json
                            Accept: application/xml
                          
                        
                         <NSEList>
                        <item>
                        <Segment>NSE</Segment>
                        <Instrument>Equity</Instrument>
                        <TPILCode>3556</TPILCode>
                        <IndexName>NIFTY 50</IndexName>
                        <DateTime>9-September-2021 16:4:57</DateTime>
                        <CurrentIndexValue>17369.25</CurrentIndexValue>
                        <OpenIndexValue>17312.85</OpenIndexValue>
                        <HighIndexValue>17379.65</HighIndexValue>
                        <LowIndexValue>17302.70</LowIndexValue>
                        <CloseIndexValue>17353.50</CloseIndexValue>
                        <NetChange>15.75</NetChange>
                        <PercentChange>0.09</PercentChange>
                        <52WeekHighIndexValue>17644.60</52WeekHighIndexValue>
                        <52WeekLowIndexValue>10790.20</52WeekLowIndexValue>
                        </item>
                        </NSEList>
                        
                      
                        
                        // Java Data Services - NSE
                      URL url = new
                      URL("http://uat.tickermarket.com/TPILWebAPI/Api/V1/Data/NseEquity");

                        //Open URL connection
                      HttpURLConnection http = (HttpURLConnection)url.openConnection();

                        //POST Request
                      http.setRequestMethod("POST");
                      http.setDoOutput(true);
                      http.setRequestProperty("Accept", "application/json");
                      http.setRequestProperty("Content-Type", "application/json");
                      http.setRequestProperty("Authorization", "Bearer GciOiJIUzUxMiJ9.eyJzdWIiOiJERkRFTU8wMDAxICAgICAiLCJleHAiOjE2MjkyMTEyNDMsImlhdCI6MTYyOTE5MzI0M30.7GQJ_UxBecVe-");

                        //Create the Request Body
                      String data = "{\n  \"sid\": 4,\n  \"instId\": 1,\n  \"rType\": 1,\n  }";
                      byte[] out = data.getBytes(StandardCharsets.UTF_8);

                        // Response Data
                      OutputStream stream = http.getOutputStream();
                      stream.write(out);

                      System.out.println(http.getResponseCode() + " " + http.getResponseMessage());
                      http.disconnect();


                    
                  
                        
                        // C# Data Services - NSE
                                var  url = "http://uat.tickermarket.com/TPILWebAPI/Api/V1/Data/NseEquity");
                                var httpRequest= (HttpWebRequest) WebRequest.Create(url);

                        //POST Request
                                http.setRequestMethod("POST");
                                
                                httpRequest.Accept("application/json");
                                
                                http.Headers("Authorization", "Bearer GciOiJIUzUxMiJ9.eyJzdWIiOiJERkRFTU8wMDAxICAgICAiLCJleHAiOjE2MjkyMTEyNDMsImlhdCI6MTYyOTE5MzI0M30.7GQJ_UxBecVe-");
                                httpRequest.ContentType("application/json");

                        //Create the Request Body
                                var data = "{\n  \"sid\":4,\n  \"instId\": 1,\n  \"rType\": 1,\n  }";
                                Using (var streamWriter = new StreamWriter(httpRequest.GetRequestStream()))
                                {
                                streamWriter.Write(data);
                                }


                        // Response Data

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


                            
                  
                            
                                //PHP Data Services - NSE

                                ?php

                                $url = ("http://uat.tickermarket.com/TPILWebAPI/Api/V1/Data/NseEquity ");
                                $curl = (curl_init($url));
                                curl_seropt($curl, CURLOPT_URL, $url);
                                curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);



                                

                                //POST Request



                                $headers = array("Authorization :":"GciOiJIUzUxMiJ9.eyJzdWIiOiJERkRFTU8wMDAxICAgICAiLCJleHAiOjE2MjkyMTEyNDMsImlhdCI6MTYyOTE5MzI0M30.7GQJ_UxBecVe-" , Content-Type : application/json);
                                Curl_setopt($curl ,, CURLOPT_HTTPHEADER, , $headers);


                                //Create the Request Body
                                $data= DATA{ {
                                "sid" : 4,
                                "instId" : 1,
                                "rType": 1
                                };




                                // Response Data

                                Curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
                                $resp=curl_exec($curl);
                                curl_close($curl);
                                var_dump($resp);
                                ?>

                            
                        
                        //Python Data Services - NSE
                                Import requests
                                From requests.structure import CaseInsensitiveDict

                                url = ("http://uat.tickermarket.com/TPILWebAPI/Api/V1/Data/NseEquity ");
                                headers = CaseInsensitiveDict()



                                

                        //POST Request


                                headers [ "Accept"] = "application/json"
                                headers["Authorization"] = " Bearer GciOiJIUzUxMiJ9.eyJzdWIiOiJERkRFTU8wMDAxICAgICAiLCJleHAiOjE2MjkyMTEyNDMsImlhdCI6MTYyOTE5MzI0M30.7GQJ_UxBecVe-GciOiJIUzUxMiJ9.eyJzdWIiOiJERkRFTU8wMDAxICAgICAiLCJleHAiOjE2MjkyMTEyNDMsImlhdCI6MTYyOTE5MzI0M30.7GQJ_UxBecVe-  "
                                headers["Content-Type"] = "application/json"


                        //Create the Request Body
                                data= """
                                {
                                "sid" : "4",
                                "instId": "1",
                                "rType": "1"
                                }
                                """




                        // Response Data

                                resp = request.post(url, headers=headers, data=data)
                                print(resp.status_code)


                            
                        
                        //Javascript Data Services - NSE


                                Var url=("http://uat.tickermarket.com/TPILWebAPI/Api/V1/Data/NseEquity" )
                                Var xhr = new XMLHttpRequest();




                                

                        //POST Request


                                xhr.open("POST", url);
                                xhr.setRequestHeader("Accept","application/json" );
                                xhr.setRequestHeader("Authorization","Bearer GciOiJIUzUxMiJ9.eyJzdWIiOiJERkRFTU8wMDAxICAgICAiLCJleHAiOjE2MjkyMTEyNDMsImlhdCI6MTYyOTE5MzI0M30.7GQJ_UxBecVe- " );
                                xhr.setRequestHeader(Content-Type, "application/json" );

                                xhr.onreadystatechange= function() {
                                if(xhr.readyState = = = 4)
                                {
                                Console.log(xhr.status);
                                Console.log(xhr.responseText);
                                }};



                        //Create the Request Body
                                Var data = '{
                                "sid" : 3,
                                "instId" : 1,
                                "rType": 1
                                }';





                        // Response Data

                                Xhr.send(data);
                                Console.log(xhr.status);



                            
                        
                        //CURL Data Services - NSE


                                #! /bin/bash
                                #Login:


                        //POST Request


                                curl -d  "{ \ username\" :  \ "ABB \" , \"password\" : \"password\"}" "-H content-type: application/json" " http://uat.tickermarket.com TPILWebAPI/Api/V1/Users/Login"

                                Curl -X POST http://uat.tickermarket.com/TPILWebAPI/Api/V1/Data/NseEquity   -H "Authorization: Bearer GciOiJIUzUxMiJ9.eyJzdWIiOiJERkRFTU8wMDAxICAgICAiLCJleHAiOjE2MjkyMTEyNDMsImlhdCI6MTYyOTE5MzI0M30.7GQJ_UxBecVe-"  -H
                        "Content-Type: application/json"


                        //Create the Request Body
                                - - data-binary @- << DATA
                                {
                                "sid" : "3",
                                "instId": "1",
                                " rType": "1""
                                }
                                DATA