Kite Connect API: kite.ltp() returning empty data for indices and equities during market hours

shravankumarpotnuru
Dear Kite Connect Support Team,

I am experiencing an issue with the kite.ltp() and potentially kite.quote() API calls, where they consistently return empty data for specific instruments, even during live Indian market hours, despite successful API authentication.

Authentication Status:

I can successfully authenticate with the Kite Connect API using my api_key and access_token.

The kite.profile() call works correctly and returns my user details, confirming the access_token is valid.

Proof: My script output shows ✅ Kite Connect authenticated for user: [Your User Name].

Market Status at Time of Testing:

My script's internal check confirms the market is open.

Proof: My script output shows DEBUG: Market Open Status: True.

Exact Date and Time (IST) of recent tests: [e.g., Tuesday, July 22, 2025, 1:51 PM IST] (Please provide the most recent date and time you observed the issue).

Specific Instruments Affected (LTP calls returning empty):

NIFTY 50 Index:

instrument_token: 256265

tradingsymbol (as found in kite.instruments() dump): NIFTY 50

instrument_type (as found in kite.instruments() dump): EQ

API Call: kite.ltp(["NSE:256265"])

Observed Response: {} (empty dictionary)

Proof: Script output shows ❌ LTP data for NIFTY 50 (Token: 256265) not found in response. DEBUG: Full LTP response: {}

RELIANCE Industries Ltd. (Equity Stock - Fallback Test):

instrument_token: 2885

tradingsymbol (as found in kite.instruments() dump): RELIANCE (or similar, if you confirmed it from your debug_nse_instruments.csv)

API Call: kite.ltp(["NSE:2885"])

Observed Response: {} (empty dictionary)

Proof: Script output shows ❌ RELIANCE LTP data not found in response. DEBUG: Full RELIANCE LTP response: {}

Context of API Calls:

The calls are made using the official kiteconnect Python library.

The kite.instruments("NSE") call successfully fetches the full instrument dump (approx. 8000+ rows), and I can locate the NIFTY 50 entry within it.

Troubleshooting Steps Already Taken (and confirmed):

Confirmed access_token validity via kite.profile().

Verified correct tradingsymbol and instrument_type for NIFTY 50 from the kite.instruments() dump.

Confirmed market hours are active during testing.

Confirmed that the kite.ltp() method call syntax (kite.ltp(["EXCHANGE:TOKEN"])) is correct as per Kite Connect documentation.

Tested with multiple instruments (NIFTY 50 index and RELIANCE equity) with consistent empty responses.

Crucially: While kite.ltp() is failing, I am successfully receiving real-time tick data via the KiteTicker WebSocket for the same instruments. This suggests the issue might be specific to the REST API's LTP/Quote endpoints for my key.

Please investigate why the kite.ltp() API calls are returning empty data for these instruments.

Thank you for your time and assistance.

Sincerely,
  • salim_chisty
    The LTP API call will return blank if the parameters passed are incorrect. Please ensure you are using the correct parameters and the proper trading symbol format. Go through the documentation here.
    If the issue persists, please enable debug mode and share the complete stack trace here.
  • shravankumarpotnuru
    Hi Salim,

    I am writing to follow up on an ongoing issue with my Kite Connect API key where kite.ltp() and kite.quote() calls consistently return empty data, even during live Indian market hours. This issue persists despite extensive troubleshooting on my end.

    Crucially, I am able to successfully receive real-time tick data for the same instruments via the KiteTicker WebSocket API. This suggests the problem is specific to the REST API's quote endpoints for my key, rather than a general data access issue.

    Here are the detailed observations and debugging information:

    Authentication Status (Confirmed Working):

    My API key and access_token are valid.

    kite.profile() calls are successful, confirming authentication.

    Script Output: ✅ Kite Connect authenticated for user: xxxx

    Market Status at Time of Testing (Confirmed Open):

    My script's internal check accurately confirms the market is open.

    Script Output: DEBUG: Market Open Status: True

    Exact Date and Time (IST) of recent test: [Today's Date], [Current Time in IST] (e.g., Wednesday, July 23, 2025, 10:45 AM IST)

    Problem Description: kite.ltp() (and kite.quote()) returns empty data:

    When making kite.ltp() calls for valid, highly liquid instruments during market hours, the API consistently returns an empty dictionary {} in the data field of the response. This indicates "no data available" for the requested instruments, as per your documentation.

    Example 1: NIFTY 50 Index

    instrument_token: 256265

    tradingsymbol (as found in kite.instruments() dump): NIFTY 50

    instrument_type (as found in kite.instruments() dump): EQ

    API Call (Python): kite.ltp(["NSE:256265"])

    Observed Response (from script debug):

    ❌ LTP data for NIFTY 50 (Token: 256265) not found in response.
    DEBUG: Full LTP response: {}
    Example 2: RELIANCE Industries Ltd. (Equity Stock - Fallback Test)

    instrument_token: 2885

    tradingsymbol (as found in kite.instruments() dump): RELIANCE

    API Call (Python): kite.ltp(["NSE:2885"])

    Observed Response (from script debug):

    ❌ RELIANCE LTP data not found in response.
    DEBUG: Full RELIANCE LTP response: {}
    Crucial Observation: KiteTicker WebSocket API Works Perfectly:

    Despite the REST API issue, I am successfully receiving live tick data for both NIFTY 50 (256265) and RELIANCE (738561) via the KiteTicker WebSocket client. This confirms that live data is available and my API key can access it through the WebSocket channel.

    WebSocket Output Example (shows actual LTP data):

    Instrument Token: 738561, LTP: 1415.5, Timestamp: None
    Instrument Token: 256265, LTP: 25069.15, Timestamp: None
    (and similar continuous tick data)

    Troubleshooting Steps Performed:

    Verified access_token validity with kite.profile().

    Confirmed correct tradingsymbol (NIFTY 50) and instrument_type (EQ) for NIFTY 50 from kite.instruments("NSE") dump.

    Confirmed market hours are active during testing.

    Verified kite.ltp() call syntax (["EXCHANGE:INSTRUMENT_TOKEN"]) is correct as per documentation.

    Tested with multiple instruments (index and equity).

    Tested with fresh access tokens obtained on the current trading day.

    Confirmed network connectivity and server setup (Nginx, Gunicorn) are fully functional.

    This behavior is preventing me from using the REST API for snapshot quote retrieval. Please investigate the data permissions or data feed status for my API key on your backend.

    Thank you for your urgent attention to this matter.

    Sincerely,
  • salim_chisty
    Can you please enable debug mode and share the complete stack trace along with the id and API key via private message?
Sign In or Register to comment.