How to get disk usage and monthly bandwidth transfer from cPanel to my website in PHP

I am wondering how I can show (get) disk space usage and monthly throughput on my site in the same way as shown when logging into my cPanel account. Is there an api from cPanel for this or is it a general method for this? I am using PHP.

+4
source share
2 answers

cPanel / WHM has an API that offers access to both of the elements you are looking for. See the API docs for more details. The bandwidth and disk usage modules in API 1 output HTML, however, API 2 has an account-counting method that returns the diskused parameter in the appropriate format (XML / JSON on request).

+7
source

I think that these quotas should either be stored in some files somewhere on your hosting account. So, all you have to do is find out where these files are and read them using PHP.

I also study this.

0
source

All Articles