Issue while fetching options data

symbol = "NIFTY"

start_date = "15-05-2023"

end_date ="1-06-2023"

instrumentType = "options"

expiry_date ="15-Jun-2023"

strikePrice = 18600



Above code is giving an error. The error:

raceback (most recent call last):
  File "/Users/nijanjyakhwo/Splash_Trade_Automation/Strategy/Rough/", line 25, in <module>
  File "/Users/nijanjyakhwo/anaconda3/lib/python3.10/site-packages/nsepython/", line 647, in derivative_history
    total = pd.concat([total, derivative_history_virgin(symbol, start_date, end_date, instrumentType, expiry_date, strikePrice, optionType)])
  File "/Users/nijanjyakhwo/anaconda3/lib/python3.10/site-packages/nsepython/", line 594, in derivative_history_virgin
    payload = nsefetch(nsefetch_url)
  File "/Users/nijanjyakhwo/anaconda3/lib/python3.10/site-packages/nsepython/", line 18, in nsefetch
    output = requests.get(payload,headers=headers).json()
  File "/Users/nijanjyakhwo/anaconda3/lib/python3.10/site-packages/requests/", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Try the example as shown here NSEPy Functions - Unofficed and see if it it showing same error. And share.

Another way is to shift to nsepython’s server version which you can find here - [Update] NSEPython not working in AWS, Google Cloud and WebServers - #24 by dexter

Let me know if you face problem

Please see the error with one of the functions of NSEpython

append has been depreciated in Python’s latest version, it can be replaced by concatenate.

Already fixed. Upgrade the version of NSEPython

After Upgrade almost every thing which is using NSEpython is throwing error
see one of the screenshot

Another screen shot

What OS you are using and What version and What Laptop. I will test.