Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    how to get LTP for USDINR and BANKNIFTY

    General Discussion
    0
    6
    105
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      Ved last edited by

      how to get market price for USDINR and BANKNIFTY

      Mnagesh 2 Replies Last reply Reply Quote 0
      • Mnagesh
        Mnagesh @Ved last edited by

        @aksharmty
        f21f5dd0-4fe2-49a5-88a8-ef5e6103c5d7-image.png

        Now I am full time Algo Trader and successfully developed my own Apps for my personal use.

        Mnagesh V 2 Replies Last reply Reply Quote 0
        • Mnagesh
          Mnagesh @Mnagesh last edited by

          @Mnagesh use symbol , token and Excange (CDS) to get corresponding LTP

          read :
          https://smartapi.angelbroking.com/docs/Instruments

          Now I am full time Algo Trader and successfully developed my own Apps for my personal use.

          1 Reply Last reply Reply Quote 0
          • Mnagesh
            Mnagesh @Ved last edited by

            @aksharmty
            79e1df6a-fd5c-455f-8e2d-fbf1e498cbab-image.png 26009 BANKNIFTY BANKNIFTY -1 -1 NSE -1.000000

            for banknifty use corresponding symbols token and excange

            Now I am full time Algo Trader and successfully developed my own Apps for my personal use.

            1 Reply Last reply Reply Quote 0
            • V
              Ved @Mnagesh last edited by

              @Mnagesh
              I can't find USDINR token code. Can you share me USDINR token code?
              eg.
              BANKNIFTY : 26009
              NIFTY : 26000
              USDINR : ?
              <-- my code -->
              $data["clientcode"] = "client id";
              $data["exchange"] ="CDS";
              $data["tradingsymbol"] ="USDINR";
              $data["symboltoken"]= ? ;
              $url = 'https://apiconnect.angelbroking.com/rest/secure/angelbroking/order/v1/getLtpData';
              $jsonData = json_encode($data);
              $curl = curl_init();
              curl_setopt($curl, CURLOPT_URL, $url);
              curl_setopt($curl, CURLOPT_POSTFIELDS, $jsonData);
              curl_setopt($curl, CURLOPT_HEADEROPT, CURLHEADER_UNIFIED);
              curl_setopt($curl, CURLOPT_HTTPHEADER, $tradeheaders);

              curl_setopt($curl, CURLOPT_POST, 1);
              curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

              $result = curl_exec($curl);
              $http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE);

              echo '<br/>Response Status : ' . $http_status;
              echo '<br/>Response String : ' . $result;

              //To Convert json response to array
              $resJsonArray = json_decode($result, true);
              $mms = $resJsonArray['message'];
              echo " mms ".$mms;
              echo "<br><br>";
              $ltp = $resJsonArray['data']['ltp']; echo "<br>ltp".$ltp;

              M 1 Reply Last reply Reply Quote 0
              • M
                Moderator_2 @Ved last edited by

                Hi @aksharmty

                Apologies for delayed response.
                Any token of specific stocks can be retrieved from OpenAPIScripMaster.json file / scripsearch API.
                Ref Doc:
                https://smartapi.angelbroking.com/docs/Instruments

                Thanks & Regards,
                SmartAPI team

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post