500 :: Internal Server Error
I keep getting "500 :: Internal Server Error"
I am testing with a simple SPX 0DTE option. I have been away from this code for a while so last time it worked was around a month ago. So now I dont know if its my code or something server side.
Found strike 5175C, delta 0.495, maturity 20250404
ERROR:root:Error processing order: IbkrClient: response error Result(data=None, request={'url': 'https://api.ibkr.com/v1/api/iserver/secdef/info', 'params': {'conid': '773846944', 'sectype': 'OPT', 'month': '20250404', 'exchange': 'SMART', 'strike': '5170.0', 'right': 'C'}}) :: 500 :: Internal Server Error :: {"error":"No Contracts retrieved "}
Hi @oleg-d - the 5xx errors are server errors, which usually means they lay on IBKR side. I'd encourage you to talk to their support about this
ERROR:root:Error processing order: IbkrClient: response error Result(data=None, request={'url': 'https://api.ibkr.com/v1/api/iserver/secdef/info', 'params': {'conid': '773846944', 'sectype': 'OPT', 'month': '20250404', 'exchange': 'SMART', 'strike': '5170.0', 'right': 'C'}}) :: 500 :: Internal Server Error :: {"error":"No Contracts retrieved "}
Hi, not sure about this but worth a try: Shouldn't month have this form, e.g. "APR25"? That's what I use. It does not state this explicitly in this endpoint's docs, but it is mentioned elsewhere: https://www.interactivebrokers.com/campus/ibkr-api-page/webapi-ref/#tag/Trading-Contracts/paths/~1iserver~1secdef~1strikes/get
Also the conid should be that of an underlying, possibly 416904 for SPX in your case?
@oleg-d were you able to resolve this?
@oleg-d were you able to resolve this?
No I havent been back to the options code. The futures trading work in my app so its something wrong in my options code.
i have been back to my options code and indeed the issue was with the code.