API Call to get count of assets taking up a license?

Does anyone have a query specifically around the API where we are able to determine the exact asset count where vulnerabilities have been assessed (excluding discovered assets).

I know we can use SQL Exporter etc but wanting to avoid this.