Unexpected error with Fyers Api

This is a long running error that is encountered by almost every time I use Fyers Api for getting data. Attaching a photo for reference

Observation:

Far OTM options often error out with error code 10

Steps to reproduce:

Download data for OTM options of Banknifty/Nifty

Timeframe of download - Last 2 months worth of data. (in this eg, from 27 Feb to 27 Apr)

Please contact if any additional information is needed

Thanks

Hey Penguin,
Thank you for bringing this issue to our attention, I will be forwarding this issue to the relevant team.

@vikram_sri Any update on this ? Not just on the solution, I’d like to know if the root cause was detected and what went wrong with the api.

@vikram_sri any updates ?

Apologies, I’m debugging this issue.
Also if you would provide the logic in code you use to fetch the data, it would be useful, That is, The parameters being passed in the API.
Also are you passing cont_flag as 1?

My placeholder query:

    query = {"symbol":symbol, "resolution":resolution, "date_format":"1", "range_from":range_from,            "range_to":range_to, "cont_flag":"1"}

I have previously posted a link to script . This is slightly older script but the core is the same and it should still work. Hope this helps

Hi @algo_go ,

You are trying to fetch history data for symbol which are not traded that’s why you are getting this error.

I’m sorry but that is wrong.

Missing data is what error code -300 is for. When I first wrote my script, I got a csv file which enumerated all errors possible from fyers documentation website. (Can’t find it now on new documentation website)

Let’s take a live example

Here we see error code -300 for options for which there is no data. I verified this from trade.fyers.in. But some options fail with error code -10. One thing that I have noticed that it is always the “Big round numbers” for which this happens. i.e For banknifty: the strikes which are multiples of 500 and for nifty: strikes which are multiple of 100. I don’t know if it is a coincidence or not.

As live example I took 2 tickers NSE:BANKNIFTY2351835000CE and NSE:BANKNIFTY2351835100CE . I tried both of them on trade.fyers.in and both have no data. So something else is also going wrong for a few strike prices which causes error message to fall back to “unexpected error”

Let me know if you need more information

I am attaching my new updated code that I now use. (This is actually a .txt file. I had to rename it to .png because for some reason .txt is not allowed. Please rename it to code.txt to see my code

Hi @algo_go ,

Thank you for bringing this issue to our attention. We are currently looking into it, and we assure you that it will be addressed in our upcoming release.