Its not possible to count this through any API as salesforce don't expose this information.Its only available in sfdc admin set up.
However there is small workaround that you may try.Although be cautious that its just workaround
WebService static string GetAPIUsage() {
PageReference pr = new PageReference('/00D20000000HsCQ');//use id of setup page
pr.setRedirect(false);
String result = pr.getContent().toString();
Integer start_index = result.indexOf('API Requests, Last 24 Hours', 1) + 52;
Integer end_index = result.indexOf('<', start_index);
result = result.substring(start_index, end_index);
result = result.replaceAll(' ', ' ');
return result;
}