History function - API rate limit not working properly. it errors out fast.

History function - api rate limit not working properly.

I have optimized the function such that if the data isn’t present it fetched the data via history and after That it switched to LIVE mode.

so history is called only when I change the scrip name . All of a sudden after 20 updates, this started giving 429 error - bad request.

This needs to be fixed. It is not even working as per the documentation of rate limit of 10000 calls In a day. no way I have reached that limit in 1 hr .

This API response needs to be updated to report how many calls a user has made for the day?

And there should be a separate API to check how many calls we have made today.

Hey @ranaharsh

Not only the day limit , even the limit is breached for the lesser time frames as mentioned in the Docs , this error is faced.

https://myapi.fyers.in/docsv3

@WWhYB2qrsx I have explained my post above that I changed 20 scrips at Max and within 2 hrs time. I could see the logs that it wasn’t updated that fast bec I manualy update the input file to work on a new scrip. So no way I can do it faster than computer.

There is really something wrong with rate limit code.

How to check the rate limit to validate whether it is within the limit or exceeded ?

Hi Fyers,

Looks like the issue is back again. Since today morning (probably after yesterday’s scheduled maintenance activity on). I have been getting the error if I place consecutive 2-3 calls (and not necessarily the history apis, other apis as well such as orders, tradebook, position, etc). As can be seen below, 5 requests initiated within 1 second and the 5th call failed for rate limit !

2024-03-31T15:48:17.965968017Z [UTC] [REQ] → METHOD=GET, API=https://api-t1.fyers.in/api/v3/profile

2024-03-31T15:48:18.468612380Z [UTC] [RES] ← METHOD=GET, STATUS=200, API=https://api-t1.fyers.in/api/v3/profile

RESPONSE-BODY=b’{“s”: “ok”, “code”: 200, “message”: “”, “data”: {“fy_id”: “XXXXXXX”, “name”: “YYYYY YYYYY”, “image”: null, “display_name”: null, “pin_change_date”: “DD-MM-YYYY hh:mm:ss”, “email_id”: “[email protected]”, “pwd_change_date”: null, “PAN”: “---------”, “mobile_number”: “---------”, “totp”: true, “pwd_to_expire”: --}}’

2024-03-31T15:48:18.469460803Z [UTC] [REQ] → METHOD=HttpMethod.GET, API=https://api-t1.fyers.in/data/marketStatus

2024-03-31T15:48:18.645788502Z [UTC] [RES] ← METHOD=GET, STATUS=200, API=https://api-t1.fyers.in/data/marketStatus

RESPONSE-BODY=b’{“code”:200,“marketStatus”:[{“exchange”:10,“market_type”:“ODD_LOT”,“segment”:10,“status”:“CLOSED”},{“exchange”:10,“market_type”:“NORMAL”,“segment”:11,“status”:“CLOSED”},{“exchange”:10,“market_type”:“NORMAL”,“segment”:20,“status”:“CLOSED”},{“exchange”:10,“market_type”:“NORMAL”,“segment”:12,“status”:“CLOSED”},{“exchange”:10,“market_type”:“CALL_AUCTION2”,“segment”:10,“status”:“CLOSED”},{“exchange”:10,“market_type”:“AUCTION”,“segment”:10,“status”:“CLOSED”},{“exchange”:10,“market_type”:“NORMAL”,“segment”:10,“status”:“POSTCLOSE_CLOSED”},{“exchange”:11,“market_type”:“NORMAL”,“segment”:20,“status”:“CLOSED”},{“exchange”:12,“market_type”:“NORMAL”,“segment”:12,“status”:“POSTCLOSE_CLOSED”},{“exchange”:12,“market_type”:“AUCTION”,“segment”:10,“status”:“CLOSED”},{“exchange”:12,“market_type”:“NORMAL”,“segment”:11,“status”:“POSTCLOSE_CLOSED”},{“exchange”:12,“market_type”:“NORMAL”,“segment”:10,“status”:“POSTCLOSE_CLOSED”}],“message”:“”,“s”:“ok”}’

2024-03-31T15:48:18.646591062Z [UTC] [REQ] → METHOD=GET, API=https://api-t1.fyers.in/api/v3/orders

2024-03-31T15:48:18.742786165Z [UTC] [RES] ← METHOD=GET, STATUS=200, API=https://api-t1.fyers.in/api/v3/orders

RESPONSE-BODY=b’{“code”:200,“message”:“”,“s”:“ok”,“orderBook”:}’

2024-03-31T15:48:18.743535319Z [UTC] [REQ] → METHOD=GET, API=https://api-t1.fyers.in/api/v3/tradebook

2024-03-31T15:48:18.834400729Z [UTC] [RES] ← METHOD=GET, STATUS=429, API=https://api-t1.fyers.in/api/v3/tradebook

RESPONSE-BODY=b’{“code”:-429,“message”:“Request limit reached, refresh after few mins”,“s”:“error”}’