# How to retrieve total risk count for each application using REST API

**URL:** <https://community.sonatype.com/t/how-to-retrieve-total-risk-count-for-each-application-using-rest-api/3607>\
**Category:** Sonatype Lifecycle & Firewall\
**Created:** [March 3, 2020, 10:49am UTC](https://community.sonatype.com/t/how-to-retrieve-total-risk-count-for-each-application-using-rest-api/3607 "2020-03-03T10:49:04Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ftischhauser](https://yyz1.discourse-cdn.com/flex047/user_avatar/community.sonatype.com/ftischhauser/32/984_2.png) [@ftischhauser](https://community.sonatype.com/u/ftischhauser)\
**Post date:** [March 5, 2020, 3:52pm UTC](https://community.sonatype.com/t/how-to-retrieve-total-risk-count-for-each-application-using-rest-api/3607/2 "2020-03-05T15:52:15Z")

</div>

I haven’t seen the total counts being exposed in an API, but the individual policy violations including the threat level are available through the [Policy Violations by Report REST API](https://help.sonatype.com/iqserver/automating/rest-apis/report-related-rest-apis---v2#Report-relatedRESTAPIs-v2-PolicyViolationsbyReportRESTAPI(v2)). If you count all the `threatLevel` results per group and application, you should end up with the same number the GUI calculates.

If you only have one policy per threat group, you could also use the [Success Metrics Data REST API](https://help.sonatype.com/iqserver/automating/rest-apis/success-metrics-data-rest-api---v2) and just multiply the number of `openCountAtTimePeriodEndxxx` with the threat level of your corresponding policy.

---

_[View the full topic](https://community.sonatype.com/t/how-to-retrieve-total-risk-count-for-each-application-using-rest-api/3607)._
