Error while requesting quote

arjunender
Hi,

Unable to get quote

instruments = ["NFO:ULTRACEMCO24MAYFUT"]
quote = kite.quote(instruments)

getting below error

File "AppData\Local\Programs\Python\Python310\lib\site-packages\kiteconnect\connect.py", line 582, in quote
data = self._get("market.quote", params={"i": ins})
AttributeError: 'list' object has no attribute '_get'


  • arjunender
    Version
    __title__ = "kiteconnect"
    __description__ = "The official Python client for the Kite Connect trading API"
    __url__ = "https://kite.trade"
    __download_url__ = "https://github.com/zerodhatech/pykiteconnect"
    __version__ = "5.0.1"
    __author__ = "Zerodha Technology Pvt. Ltd. (India)"
    __author_email__ = "[email protected]"
    __license__ = "MIT"
  • ANL
    I can't see any issue with the quote code. It seems fine.

    check the steps:
    Check that the api_key and access_token are correctly set.

    1. from kiteconnect import KiteConnect

    kite = KiteConnect(api_key="your_api_key")
    # set the access token for the session.
    kite.set_access_token("your_access_token")


    2. You may have misplaced the kite connect object. check that also.
    3. Finally, try the following code if steps 1, 2 were unable to resolve your problem:

    from kiteconnect import KiteConnect

    # Initialize KiteConnect
    kite = KiteConnect(api_key="your_api_key")
    kite.set_access_token("your_access_token")

    # Request quotes
    instruments = ["NFO:ULTRACEMCO24MAYFUT"]
    try:
    quote = kite.quote(instruments)
    print(quote)
    except Exception as e:
    print(f"Error: {e}")
  • arjunender
    thanks
    got it
This discussion has been closed.