Search can be achieved using the search API and you can use the search with facets. The facets allow you to return just 1 object - but still get counts for the facets (just like search in the UI)
search (2/catalog/data/search) for any objects that use any domain - using these settings:-
q=com.infa.ldm.profiling.dataDomainsRejected:* and core.resourceName:<resource_name>
or use default facets instead of listing each facet attribute (i like this better for smaller result sets)
FacetResults in the result-set will have the counts you need - you can disregard the objects return "hits" since you only need to look at the facetResults.
If you want to get a specific per domain - iterate over each domain returned and then search for any objects using that domain, with the same properties (substitute * for the domain name)
Using facets is really fast - see an example here: https://github.com/Informatica-EIC/REST-API-Samples/blob/master/python/domainSummary.py
For Inferred and Accepted DataDomain, you can use the below ones: