Navigation

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

    JSONDecode error in retrieving top loser

    Python SDK
    0
    8
    27
    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.
    • S
      sunil_modi last edited by

      @Moderator_1 i am getting error when i try to use PercPriceLosers datatype to retrieve top loser for other datatype it is working

      5a55ff20-5ab5-44e3-994f-70621aee6cdb-image.png

      A M O 3 Replies Last reply Reply Quote 0
      • A
        ashis @sunil_modi last edited by

        @sunil_modi said in JSONDecode error in retrieving top loser:

        @Moderator_1 i am getting error when i try to use PercPriceLosers datatype to retrieve top loser for other datatype it is working

        5a55ff20-5ab5-44e3-994f-70621aee6cdb-image.png

        Ghhajj
        Hjjj
        J

        S O 2 Replies Last reply Reply Quote 0
        • S
          sunil_modi @ashis last edited by

          @ashis what do you want to say, i didn't get this?

          1 Reply Last reply Reply Quote 0
          • M
            Moderator_3 @sunil_modi last edited by

            Hello @sunil_modi

            Please modify your code in a way of error handling like you need to catch the exception(if any) instead of checking the values.

            Regards,
            SmartAPI Team

            S 1 Reply Last reply Reply Quote 0
            • S
              sunil_modi @Moderator_3 last edited by

              @Moderator_3 That's right but i want to know why i am getting this error insteads of following documentation.
              would you please tell me how to get chart of nifty50 for first 10 minutes?

              1 Reply Last reply Reply Quote 0
              • O
                owisa Shaikh @ashis last edited by

                @ashis try:
                return response.json()
                except JSONDecodeError as e:
                print("Error parsing JSON:", e)
                return None

                1 Reply Last reply Reply Quote 0
                • O
                  owisa Shaikh @sunil_modi last edited by

                  @sunil_modi try:
                  return response.json()
                  except JSONDecodeError as e:
                  print("Error parsing JSON:", e)
                  return None

                  S 1 Reply Last reply Reply Quote 0
                  • S
                    sunil_modi @owisa Shaikh last edited by

                    @owisa-Shaikh @Moderator_3 I use try and except block and print exception as well as response.text and i got this
                    397a2e29-927f-4c83-98ea-453b7baa973c-image.png
                    but only while fetching top_losers, top_gainers works fine.

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