Rb does have an extensive api but it is lacking functions for threat list because the data is not stored in the client. The game does not store threat information for any units except the one currently being targeted.
Change targets, and the threat meter takes a second to adust.