You can query a user's cPanel account via the xml-api PHP class.
This is done by setting the port to 2083 and making API1/API2 calls:
PHP Code:
<?php
include("../xmlapi.php");
$account = "someuser";
$email_account = "randomemail";
$email_domain = "somedomain.com";
$xmlapi = new xmlapi($ip, $account, $password);
$xmlapi->set_port(2083);
print $xmlapi->api2_query($account, "Email", "getdiskusage", array(domain=>$email_domain, login=>$email_account) );
For references of all the available api calls, please see the Api introduction on sdk.cpanel.net