Navigation

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

    Fetching LTP Gives 500 Internal Server Error

    Python SDK
    4
    12
    114
    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.
    • Ramesh 0
      Ramesh 0 @Surya 1 last edited by

      @rajanprabu
      Okay, so is this how it's designed? I mean to pull only during the trading hours?

      1 Reply Last reply Reply Quote 0
      • A
        admin @Ramesh 0 last edited by

        Hi @A224819 , Exchange input is incorrect in your code.

        {"token":"275","symbol":"AUROPHARMA-EQ","name":"AUROPHARMA","expiry":"","strike":"-1.000000","lotsize":"1","instrumenttype":"","exch_seg":"NSE","tick_size":"5.000000"}

        Please verify trading symbol, symbol token and exchange inputs from below link

        https://margincalculator.angelbroking.com/OpenAPI_File/files/OpenAPIScripMaster.json

        Ramesh 0 1 Reply Last reply Reply Quote 0
        • Ramesh 0
          Ramesh 0 @admin last edited by

          @admin ,

          I have been following the same link you have shared. Here is what i tried today during the trading hours:
          d80aa131-3a74-4e47-9b62-8164c22d8f26-image.png

          22cd6e39-c1d0-4e74-b462-42ab1253ca79-image.png

          Kindly tell me where I am going wrong?

          Please tell me how a working code would look like with the correct parameters. As I follow the documentation, I see we only pass the exchange, trading symbol and the symbol token.

          A 1 Reply Last reply Reply Quote 0
          • A
            admin @Ramesh 0 last edited by admin

            Hi @A224819 , exchange and trading symbol input is wrong. Correct details as per below
            {
            "exchange":"NSE",
            "tradingsymbol":"3MINDIA-BL",
            "symboltoken":"12179"
            }

            3ebb3d14-a102-4d0d-9a70-f8dd387cf5f8-image.png

            Ramesh 0 1 Reply Last reply Reply Quote 0
            • Ramesh 0
              Ramesh 0 @admin last edited by

              Hi @admin

              I have tried doing that. I have copy-pasted your code exactly and still no luck:
              ddc3b130-7280-4f9b-8202-65d576f8e923-image.png

              Kindly assist me with this. It's been days now I am trying to pull LTP.

              You had said earlier that I have to try during market hours, but you did not clarify if the code won't work off-hours. I have tried now and will try the same code tomorrow morning and update a screenshot (which I am sure will still pull 404).

              Thank you.

              S A 2 Replies Last reply Reply Quote 0
              • S
                Surya 1 @Ramesh 0 last edited by

                @A224819 is there a reason why you are not using the python SDK available here https://github.com/angelbroking-github/smartapi-python.

                Since you are coding in python, wouldn't that be easier ?

                1 Reply Last reply Reply Quote 0
                • A
                  admin @Ramesh 0 last edited by

                  Hi @A224819 , thank you sharing the remote access with us. The query is now resolved.

                  Ramesh 0 1 Reply Last reply Reply Quote 0
                  • Ramesh 0
                    Ramesh 0 @admin last edited by

                    @admin
                    Thanks a ton!

                    M 1 Reply Last reply Reply Quote 0
                    • M
                      Manoj P A @Ramesh 0 last edited by

                      @A224819 @admin What was the solution ?

                      Ramesh 0 1 Reply Last reply Reply Quote 0
                      • Ramesh 0
                        Ramesh 0 @Manoj P A last edited by Ramesh 0

                        @kaleps
                        There were three errors:

                        • The Symbol token was incorrect -> refer the link
                        • The url used was incorrect -> check the documentation
                        • I missed the authorization in the header. -> add to header as shown in the documentaion
                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post