It is possible to read the storage Volume of a site collection with JavaScript?

  • For which version of SharePoint do you require this? Commented Apr 12, 2019 at 10:00
  • Sharepoint 2013 onPrem
    – cvb
    Commented Apr 12, 2019 at 10:23

1 Answer 1


Please try below code after attaching jQuery library on page.

        url: _spPageContextInfo.siteAbsoluteUrl + "/_api/site/usage",
        type: "GET",               
        headers: {
            "Accept": "application/json;odata=verbose",
        success: function (data) {
             var percent = data.d.Usage.StoragePercentageUsed;
             percent = 100*percent;
             percent = percent;
             var storage = data.d.Usage.Storage;
             storage = storage/1073741824;
             storage = storage;
             alert("Total storage: "+((storage*100)/percent).toFixed(2)+"GB"); 
             alert("Storage used: "+storage.toFixed(2)+"GB");   
        error: function (data) {



P.S.: It will only show proper value if you have set "Quota Template" during site collection creation.

Hope this will help you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.