# cPanel API 2 Functions - Fileman::getdiskinfo

Warning:
The cPanel API 2 system is deprecated. We **strongly** recommend that you use [UAPI](/cpanel/introduction) instead of cPanel API 2.

## Description

This function returns an account's disk usage statistics.

Warning:
We **strongly** recommend that you use [UAPI](/cpanel/introduction/) instead of cPanel API 2. However, no equivalent UAPI function exists.

Important:
When you disable the [*File Storage* role](https://docs.cpanel.net/knowledge-base/general-systems-administration/how-to-use-server-profiles/#roles), the system **disables** this function.

## Examples

WHM API (JSON)


```undefined syntaxhighlighter-pre
https://hostname.example.com:2087/cpsess##########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Fileman&cpanel_jsonapi_func=getdiskinfo
```

Note:
For more information, read our [Calls from the WHM API](/whm/use-whm-api-to-call-cpanel-api-and-uapi) documentation.

LiveAPI PHP Class


```undefined syntaxhighlighter-pre
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.

// Return disk usage data.
$getdiskinfo = $cpanel->api2(
    'Fileman', 'getdiskinfo'
);
```

Note:
For more information, read our [Guide to the LiveAPI System](/guides/guide-to-the-liveapi-system/#guide-to-the-liveapi-system).

LiveAPI Perl Module


```undefined syntaxhighlighter-pre
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.

# Return disk usage data.
my $getdiskinfo = $cpliveapi->api2(
    'Fileman', 'getdiskinfo',   
);
```

Note:
For more information, read our [Guide to the LiveAPI System](/guides/guide-to-the-liveapi-system/#guide-to-the-liveapi-system).

cPanel Tag System (deprecated)

Warnings:
- cPanel tags are **deprecated**. We **strongly** recommend that you **only** use the [LiveAPI](/guides/guide-to-the-liveapi-system) system to call the cPanel APIs. Examples are **only** present in order to help developers move from the old cPanel tag system to our [LiveAPI](/guides/guide-to-the-liveapi-system).
- cPanel API 2 calls that use cPanel tags vary in code syntax and in their output.
- For more information, read our [Deprecated cPanel Tag Usage](/cpanel-api-2/cpanel-api-2-deprecate-cpanel-tag-usage/) documentation.


Command Line


```undefined syntaxhighlighter-pre
cpapi2 --user=username Fileman getdiskinfo
```

div
Notes:

- You **must** URI-encode values.
- `username` represents your account-level username.
- You **must** include the `--user=username` option.
- For more information and additional output options, read our [Guide to cPanel API 2](/cpanel-api-2/) documentation or run the `cpapi2 --help` command.
- If you run CloudLinux™, you **must** use the full path of the `cpapi2` command:

```undefined syntaxhighlighter-pre
/usr/local/cpanel/bin/cpapi2
```


br
Output (JSON)


```undefined syntaxhighlighter-pre
 {
  "cpanelresult": {
    "apiversion": 2,
    "func": "getdiskinfo",
    "data": [
      {
        "spacelimit": "500",
        "file_upload_remain": "500",
        "filesused_humansize": "1.11 KB",
        "filesremain": "500",
        "spaceremain_humansize": "500",
        "filesused": 1138,
        "fileslimit_humansize": "500",
        "spaceremain": "500",
        "spaceused_humansize": "42.9 MB",
        "file_upload_remain_humansize": "500",
        "spaceused": 44985851,
        "file_upload_max_bytes_humansize": "90.95 TB",
        "file_upload_max_bytes": 99999999999999,
        "file_upload_must_leave_bytes": 5242880,
        "spacelimit_humansize": "500",
        "filesremain_humansize": "500",
        "file_upload_must_leave_bytes_humansize": "5 MB",
        "fileslimit": 0
      }
    ],
    "event": {
      "result": 1
    },
    "module": "Fileman"
  }
}
```

Note:
Use cPanel's *[API Shell](https://docs.cpanel.net/cpanel/advanced/api-shell-for-cpanel)* interface (*cPanel >> Home >> Advanced >> API Shell*) to directly test cPanel API calls.

## Parameters

This function does not accept parameters.

## Returns

table
thead
tr
th
strong
Return
th
strong
Type
th
strong
Description
th
strong
Possible values
th
strong
Example
tbody
tr
td
code
spacelimit
td
em
string
td
The account's disk space quota.
td
ul
li
A positive integer, in kilobytes (
code
KB
), megabytes (
code
MB
), or gigabytes (
code
GB
).
li
code
∞
 — The account has unlimited disk space.
td
code
10 MB
tr
td
code
file_upload_remain
td
em
string
td
The account's available file upload space.
td
ul
li
A positive integer, in kilobytes (
code
KB
), megabytes (
code
MB
), or gigabytes (
code
GB
).
li
code
∞
 — The account has unlimited disk space.
td
code
5 MB
tr
td
code
filesused_humansize
td
em
string
td
p
The disk space that the files on the account use.
td
ul
li
A positive integer, in kilobytes (
code
KB
), megabytes (
code
MB
), or gigabytes (
code
GB
).
li
code
∞
  — The account has unlimited disk space.
td
code
1.11 KB
tr
td
code
filesremain
td
em
string
td
The disk space that remains on the account.
td
ul
li
A positive integer, in kilobytes (
code
KB
), megabytes (
code
MB
), or gigabytes (
code
GB
).
li
code
∞
 — The account has unlimited disk space.
td
code
∞
tr
td
code
spaceremain_humansize
td
em
string
td
The disk space that still remains on the account.
td
ul
li
A positive integer, in kilobytes (
code
KB
), megabytes (
code
MB
), or gigabytes (
code
GB
).
li
code
∞
— The account has unlimited disk space.
td
code
∞
tr
td
code
filesused
td
em
integer
td
The number of files on the account.
td
ul
li
A positive integer, in kilobytes (
code
KB
), megabytes (
code
MB
), or gigabytes (
code
GB
).
li
code
∞
 — The account has unlimited disk space.
td
code
1138
tr
td
code
fileslimit_humansize
td
em
string
td
The account's disk space quota that is reserved for files.
td
ul
li
A positive integer, in kilobytes (
code
KB
), megabytes (
code
MB
), or gigabytes (
code
GB
).
li
code
∞
  — The account has unlimited disk space.
p
br
td
code
0 bytes
tr
td
code
spaceremain
td
em
string
td
The disk space that still remains on the account.
td
ul
li
A positive integer, in kilobytes (
code
KB
), megabytes (
code
MB
), or gigabytes (
code
GB
).
li
code
∞
 — The account has unlimited disk space.
td
code
∞
tr
td
code
spaceused_humansize
td
em
string
td
The disk space that still remains on the account.
td
ul
li
A positive integer, in kilobytes (
code
KB
), megabytes (
code
MB
), or gigabytes (
code
GB
).
li
code
∞
  — The account has unlimited disk space.
td
code
42.9 MB
tr
td
code
file_upload_remain_humansize
td
em
string
td
p
The file upload space that still remains on the account.
td
ul
li
A positive integer, in kilobytes (
code
KB
), megabytes (
code
MB
), or gigabytes (
code
GB
).
li
code
∞
  — The account has unlimited disk space.
td
code
∞
tr
td
code
spaceused
td
em
string
td
The amount of disk space used.
td
ul
li
A positive integer, in kilobytes (
code
KB
), megabytes (
code
MB
), or gigabytes (
code
GB
).
li
code
∞
  — The account has unlimited disk space.
td
code
44985851
tr
td
code
file_upload_max_bytes_humansize
td
em
string
td
The amount of disk space that must be available to avoid quota issues due to file uploads.
td
ul
li
A positive integer, in kilobytes (
code
KB
), megabytes (
code
MB
), or gigabytes (
code
GB
).
li
code
∞
  — The account has unlimited disk space.
td
code
90.95 TB
tr
td
code
file_upload_max_bytes
td
em
string
td
The maximum file size that you can upload through the 
em
File Manager
.
td
ul
li
A positive integer, in kilobytes (
code
KB
), megabytes (
code
MB
), or gigabytes (
code
GB
).
li
code
∞
 — The account has unlimited disk space.
td
code
99999999999999
tr
td
code
file_upload_must_leave_bytes
td
em
string
td
The amount of disk space that must be available to avoid quota issues due to file uploads.
td
ul
li
A positive integer, in kilobytes (
code
KB
), megabytes (
code
MB
), or gigabytes (
code
GB
).
li
code
∞
 — The account has unlimited disk space.
td
code
5242880
tr
td
code
spacelimit_humansize
td
em
string
td
The account's disk space quota.
td
ul
li
A positive integer, in kilobytes (
code
KB
), megabytes (
code
MB
), or gigabytes (
code
GB
).
li
code
∞
 — The account has unlimited disk space.
td
code
∞
tr
td
code
filesremain_humansize
td
em
string
td
The upload file space that still remains on the account.
td
ul
li
A positive integer, in kilobytes (
code
KB
), megabytes (
code
MB
), or gigabytes (
code
GB
).
li
code
∞
  — The account has unlimited disk space.
td
code
∞
tr
td
code
file_upload_must_leave_bytes_humansize
td
em
string
td
p
The amount of disk space that must be available to avoid issues due to file uploads.
td
ul
li
A positive integer that represents an amount of disk space in bytes.
td
code
5 MB
tr
td
code
fileslimit
td
em
string
td
The account's disk space quota that is reserved for files.
td
ul
li
A positive integer that represents an amount of disk space in bytes.
td
code
0
tr
td
code
reason
td
em
string
td
p
A reason for failure
p
This function only returns a 
code
reason
 value if there was an error.
td
A string that describes the error.
td
code
This is an error message.
tr
td
code
result
td
em
Boolean
td
p
Whether the function succeeded.
td
ul
li
code
1
 — The function succeeded.
li
code
0
 — The function failed.
td
code
1