number of open cases
Using the JAVA API you could use the processAPI.getNumberOfOpenedActivityInstances(getNumberOfOpenedActivityInstances) method, while using the REST API you can easily do it in this way:
1) call http://[your_host]:[your_port]/bonita/API/bpm/case?p=0&c=10&f=processDefinitionId%3d[the_process_definition_id] 2) read the response header "Content-Range" - Let's suppose that your process has 2 open cases and you called the API as reported above, the Response header will contain: - "Content-Range:0-10/2" => which means that you asked for the page 0 (p=0 in the url), with max 10 results per page ( c = 10 in the url ) of a total of 2 cases. So the part you should be interested is the /2.
For more information on how to use the rest apis and their examples, I suggest you the see the doc: http://documentation.bonitasoft.com/product-bos-sp/web-rest-api-0