Data Services - BSE

This path is about the data services of BSE Equity : /Api/V1/Data/BseEquity

Example API Request

//www.tickermarket.com/TPILWebAPI/Api/V1/Data/BseEquity

http://www.tickermarket.com/TPILWebAPI/Api/V1/Data/BseEquity


Segments

TPIL_BSE_SEGMENT_ID - 3


Instrument Type

TPIL_BSE_EQUITY_INSTRUMENT_TYPE = 1


Request Type

  • BSE_EQUITY_SENSEX_INFO_REQUEST_TYPE = 1
  • BSE_EQUITY_TOUCHLINE_INFO_REQUEST_TYPE = 2
  • BSE_EQUITY_QUOTES_REQUEST_TYPE = 3
  • BSE_EQUITY_TOPGAINERS_INFO_REQUEST_TYPE = 4
  • BSE_EQUITY_TOPLOSERS_INFO_REQUEST_TYPE = 5
  • BSE_EQUITY_INCREMENTAL_TOUCHLINE_INFO_REQUEST_TYPE = 6
  • BSE_EQUITY_INDICES_INFO_REQUEST_TYPE = 7
  • BSE_EQUITY_VOLUMETOPPERS_INFO_REQUEST_TYPE = 8
  • BSE_EQUITY_TURNOVERTOPPERS_INFO_REQUEST_TYPE = 9
  • BSE_EQUITY_LOWPRICEHIGHVOLUME_INFO_REQUEST_TYPE = 10
  • 11. BSE_EQUITY_NEWLISTINGS_INFO_REQUEST_TYPE = 11
  • BSE_EQUITY_MARKETTURNOVER_INFO_REQUEST_TYPE = 12
  • BSE_EQUITY_NEWHIGHLOW_INFO_REQUEST_TYPE = 13
  • BSE_EQUITY_ADVANCEDECLINES_INFO_REQUEST_TYPE = 14
  • BSE_EQUITY_INDEXBASEDTOUCHLINE_INFO_REQUEST_TYPE = 15
  • BSE_EQUITY_INDICES_NEWHIGHLOW_INFO_REQUEST_TYPE = 16
  • BSE_EOD_EQUITY_TOUCHLINE_INFO_REQUEST_TYPE = 17
  • BSE_EQUITY_ANNOUNCEMENTS_INFO_REQUEST_TYPE = 18
  • BSE_EQUITY_INDEXBASEDTOUCHLINE_WITH_PREVIOUSHIGHLOW_INFO_REQUEST_TYPE = 19
  • BSE_EQUITY_BULK_DEAL_INFO_REQUEST_TYPE = 20
  • BSE_EOD_EQUITY_INDICES_INFO_REQUEST_TYPE = 21
  • BSE_EQUITY_MARKET_MOVEMENT_INFO_REQUEST_TYPE = 22
  • BSE_EQUITY_MARKET_MOVEMENT_INDICES_INFO_REQUEST_TYPE = 23
  • BSE_EQUITY_CIRCUITLIMIT_INFO_REQUEST_TYPE = 24
  • BSE_EQUITY_TOUCHLINE_EXT_INFO_REQUEST_TYPE = 25
  • BSE_EQUITY_PREOPEN_INCREMENTAL_TOUCHLINE_INFO_REQUEST_TYPE = 26
  • BSE_EQUITY_PREOPEN_INDICES_INFO_REQUEST_TYPE = 27
  • BSE_EQUITY_FORTHCOMING_RESULTS_REQUEST_TYPE = 28
  • BSE_EQUITY_FORTHCOMING_CORPACTION_REQUEST_TYPE = 29
  • BSE_EQUITY_BLOCK_DEAL_INFO_REQUEST_TYPE = 30
  • BSE_EQ_DELIVERY_QTY_DAILY_INFO_REQUEST_TYPE = 31
  • BSE_EQ_DELIVERY_QTY_WEEKLY_INFO_REQUEST_TYPE = 32
  • BSE_EQ_DELIVERY_QTY_MONTHLY_INFO_REQUEST_TYPE = 33
  • BSE_EQ_DELIVERY_QTY_QUATERLY_INFO_REQUEST_TYPE = 34

Retrieving the BSE Data Services

http://www.tickermarket.com/TPILWebAPI/Api/V1/Data/BseEquity?sid=3&instId=1&rType=1

JSON Request and Response DATA

URL

V1/Api/Login/:id

V1/Api/Data/:id

Method Post
URL Params Required : id=[integer]
Data Params None
Headers Parameters

Authorization : Bearer GciOiJIUzUxMiJ9.eyJzdWIiOiJERkRFTU8wMDAxICAgICAiLCJleHAiOjE2MjkyMTEyNDMsImlhdCI6MTYyOTE5MzI0M30.7GQJ_UxBecVe-

Content-Type : application/json

Accept : application/json

BODY { "sid":"3", "instId":"1", "rType":"1" }

Request Data

The data based on 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/BseEquity (Data Services Endpoint path)
  • POST parameters:
URL

V1/Api/Login/:id

V1/Api/Data/:id

Method Post
URL Params Required : id=[integer]
Data Params None
BODY { "sid":"3", "instId":"1", "rType":"1" } >
Headers Parameters

Authorization: Bearer GciOiJIUzUxMiJ9.eyJzdWIiOiJERkRFTU8wMDAxICAgICAiLCJleHAiOjE2MjkyMTEyNDMsImlhdCI6MTYyOTE5MzI0M30.7GQJ_UxBecVe-

Content-Type : application/json

Accept : application/json

SID – Segment Id – 3 - BSE

INSTID - 1

RTYPE - 1

Success Response

Response JSON Format

Code: 200
Content: {“Segment”: BSE”, "Instrument": "Equity", "TPILCode": 658, "IndexName": "SENSEX", "DateTime": "28-July-2021 16:4:59", "CurrentIndexValue": 52443.71, "OpenIndexValue": 52673.69, "HighIndexValue": 52673.69, "LowIndexValue": 51802.73, "CloseIndexValue": 52578.76, "NetChange": -135.05, "PercentChange": -0.26, "52WeekHighIndexValue": 53129.37, "52WeekLowIndexValue": 31081.83 }

                                                      
                                                        //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);