Navigation

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

    Market Data API-Quote

    Python SDK
    0
    7
    76
    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
      SKExplorer last edited by

      Does the quote API give only best 5 buy/sell quantities ???

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

        Hi @SKExplorer

        Please find the below document for market data API.
        https://smartapi.angelbroking.com/docs/MarketData
        On FULL Mode, you can fetch Best 5 quantities, Price and orders for Buy/Sell.

        Sample response for TCS28MAR24FUT
        {
        "status": true,
        "message": "SUCCESS",
        "errorcode": "",
        "data": {
        "fetched": [
        {
        "exchange": "NFO",
        "tradingSymbol": "TCS28MAR24FUT",
        "symbolToken": "66522",
        "ltp": 4229.6,
        "open": 4214.55,
        "high": 4250.9,
        "low": 4213.05,
        "close": 4210.75,
        "lastTradeQty": 175,
        "exchFeedTime": "13-Mar-2024 11:07:56",
        "exchTradeTime": "13-Mar-2024 11:07:44",
        "netChange": 18.85,
        "percentChange": 0.45,
        "avgPrice": 4231.26,
        "tradeVolume": 1149400,
        "opnInterest": 13371750,
        "lowerCircuit": 3789.7,
        "upperCircuit": 4631.85,
        "totBuyQuan": 83300,
        "totSellQuan": 141400,
        "52WeekLow": 0.0,
        "52WeekHigh": 4250.9,
        "depth": {
        "buy": [
        {
        "price": 4229.8,
        "quantity": 350,
        "orders": 1
        },
        {
        "price": 4229.75,
        "quantity": 175,
        "orders": 1
        },
        {
        "price": 4229.5,
        "quantity": 175,
        "orders": 1
        },
        {
        "price": 4229.15,
        "quantity": 175,
        "orders": 1
        },
        {
        "price": 4229.0,
        "quantity": 175,
        "orders": 1
        }
        ],
        "sell": [
        {
        "price": 4230.7,
        "quantity": 175,
        "orders": 1
        },
        {
        "price": 4230.75,
        "quantity": 175,
        "orders": 1
        },
        {
        "price": 4230.8,
        "quantity": 175,
        "orders": 1
        },
        {
        "price": 4230.85,
        "quantity": 700,
        "orders": 4
        },
        {
        "price": 4230.95,
        "quantity": 175,
        "orders": 1
        }
        ]
        }
        }
        ],
        "unfetched": []
        }
        }

        S 1 Reply Last reply Reply Quote 0
        • S
          SKExplorer @Moderator_2 last edited by

          @Moderator_2 my question was , does it give only best five ? not 20 ?

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

            Hi @SKExplorer

            Market Data API can be hit multiple time with rate limiting to fetch more best 5 buy/sell data if required.

            Regards,
            SmartAPI team

            S 1 Reply Last reply Reply Quote 0
            • S
              SKExplorer @Moderator_2 last edited by

              @Moderator_2 so basically, rephrasing my question again, you dont provide level 3 data ??? thank you.

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

                Hi @SKExplorer

                Kindly find our Websocket streaming documentation below to fetch Best Twenty Buy/Sell Data under depth mode.
                "Section-3) Response Contract for 20-Depth Mode"
                Ref: https://smartapi.angelbroking.com/docs/WebSocket2

                Regards,
                SmartAPI team

                S 1 Reply Last reply Reply Quote 0
                • S
                  SKExplorer @Moderator_2 last edited by

                  @Moderator_2 Hi, I was trying out WebSocket2 as suggested.
                  I was successful in the first few attempts to and received ticks...
                  but now I get "Attempting to resubscribe/reconnect (Attempt 1)..." and then I get "Connection closed due to max retry attempts reached." consistently.

                  I logged out, rebooted the machine but still gets the same error.

                  Code sample I am using is the websocket2 example from github.

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