The data is been loaded successfully & the status is also success but object I ma getting empty data.
I am using bank nifty and in expiration I have done a or loop like expiry data || todays’data.
why there is not displaying option chain data please guide me
its been solved it was may be due to internet error
1 Like
I’m facing the same issue @shanmu Please help me out… here’s the code…
url = "https://api.upstox.com/v2/option/chain"
params = {
'instrument_key' : 'NSE_INDEX|Nifty 50',
'expiry_date': '2024-11-02'
}
headers = {
'Accept': 'application/json',
'Authorization': f'Bearer {access_token}'
}
response = requests.get(url, params=params, headers=headers)
print(response.json())
And here’s the output…
{'status': 'success', 'data': []}
Why’s this happening?
@HMaity Please check your expiry date. The code works correctly with 'expiry_date': '2024-11-07'
.