Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs
    1. Home
    2. S63128103
    3. Topics
    S
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Topics created by S63128103

    • S

      SmartConnect getOIData throws blank results
      Python SDK • • S63128103  

      2
      0
      Votes
      2
      Posts
      5
      Views

      A

      @S63128103 it is returning blank because no trades have happened in the contract at the time of writing this response. You can check the same on the Angel One's chart.
    • S

      SmartConnect getOIData returning blank
      Python SDK • • S63128103  

      3
      0
      Votes
      3
      Posts
      13
      Views

      B

      The issue likely lies with the parameters or the availability of the data you're requesting. Here's how you can debug and troubleshoot this problem: Possible Causes and Fixes Invalid or Insufficient Data for the Time Range: The time range "fromdate": "2024-12-30 09:20" to "todate": "2024-12-30 09:21" is only one minute. Check if the data exists for this exact time frame. Extend the time range to ensure data is available, for example: json Copy code "fromdate": "2024-12-30 09:20", "todate": "2024-12-30 09:30" Incorrect Interval: Ensure the "interval": "THREE_MINUTE" parameter is supported by the API for the specified data type (Open Interest). Try a commonly supported interval like "ONE_MINUTE" or "FIVE_MINUTE" to see if it resolves the issue. Invalid Symbol Token: Confirm that "symboltoken": "101931" corresponds to a valid and active symbol in the "exchange": "NFO". An invalid or inactive symbol will return no data. Verify this by querying metadata or using another API method to confirm the symbol’s validity. API Permissions or Limitations: Ensure your API credentials have permissions to access Open Interest (OI) data. Some API keys might have limited access. Check for API-specific documentation or limitations on fetching historical OI data. Improper Data Formatting: Double-check that fromdate and todate are formatted exactly as required by the API (e.g., "YYYY-MM-DD HH:MM:SS"). Small formatting errors may lead to no results. API-Side Issue: If all parameters seem correct, the issue might be on the API provider's side. Contact their support team or check their system status to ensure the endpoint is functioning correctly. Debugging Steps Log the Full API Request: Print the exact parameters being sent to getOIData to confirm everything is as expected. Expand the Data Range: Use a broader date range to verify if any data exists. Use a Known Valid Token: Test with a symbol token and interval combination you know works to ensure the API is functional. Test Different Data Types: If the API supports other types of data (e.g., historical price), test those to isolate the issue. Example Code with Extended Debugging python Copy code def historicaldata(): try: historicParam = { "exchange": "NFO", "symboltoken": "101931", "interval": "FIVE_MINUTE", "fromdate": "2024-12-30 09:20", "todate": "2024-12-30 09:30", } print("Request Parameters:", historicParam) # Debugging return smartApi.getOIData(historicParam) except Exception as e: print("Error:", str(e)) # Catch full error details historical_data = historicaldata() print("Historical Data:", historical_data) If the issue persists despite these checks, you should reach out to the API provider with the exact request and response for further assistance.