This used to work flawlessly using the Fundamental Data method and "ReportSnapshot" report type (https://interactivebrokers.github.io/tws-api/fundamentals.html). Granted you did have to parse some XML.
However, IB recently changed their data provider and this is now failing for > 50% of my...