ig-python / trading-ig

A lightweight Python wrapper for the IG Markets API
https://trading-ig.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
313 stars 197 forks source link

Exception: HTTP status code 403 {"errorCode":"error.public-api.failure.stockbroking-not-supported"} #178

Closed iEddie-cmd closed 3 years ago

iEddie-cmd commented 3 years ago

What does Exception: HTTP status code 403 {"errorCode":"error.public-api.failure.stockbroking-not-supported"} mean?

RRMXkun commented 3 years ago

Which EPIC are you trading? Which account: spreadbetting, CFD, shares dealing?

bug-or-feature commented 3 years ago

I have seen this error. The resolution is to set your spread betting account to be the default. You can do this through the web platform or through the API

iEddie-cmd commented 3 years ago

Thank you. I would like to use my CFD Account for Trading and historical data. But i still get this error.

bug-or-feature commented 3 years ago

The solution I mentioned earlier worked for me, sorry if it does not for you. Maybe ask for help from the IG support team

RRMXkun commented 3 years ago

Thank you. I would like to use my CFD Account for Trading and historical data. But i still get this error.

You may be using a stock dealing EPIC on a CFD account, or vice versa, hence my original question

ffent commented 3 years ago

I'm facing the same issue while trying to stream price data from my CFD Demo account. Exception: HTTP status code 403 {"errorCode":"error.public-api.failure.stockbroking-not-supported"}

I have changed the EPIC to a CFD specific one (CS.D.CFEGOLD.CFE.IP) but still getting the same error message. Does anyone know a solution for this?

RRMXkun commented 3 years ago

As above, make sure you switch_account to your CFD account in case the default is the shares dealing account

ffent commented 3 years ago

Unfortunately this problem was solved after contacting the IG Labs Support. However, I'm not aware of the specific problem which caused this error.

kamiyechung commented 3 years ago

I just resolved the problem for me and maybe it could help someone.

It works when you set your default view on your IG account, but only if you connect on LIVE, not on DEMO mode (or if someone were able to do it, I would appreciate your help).

j-faure commented 3 weeks ago

Can confirm the solution works on Live accounts. For countries where Turbo24 are enabled, if Turbo24 is set as the default, the stockbroking-not-supported error appears. Setting the CFD account as default, via Account settings solves the issue. Only the total value of the Turbo24 account is retrievable via the API, historical trades are not.