Skip to content

Get web hosting usage

GET /api/v2/shared-hosting/{accountId}/account-stats

Get how much of its plan a web hosting account uses: disk, bandwidth, addon domains, subdomains, mailboxes, forwarders, FTP accounts and databases. The account must be active. liveResources holds CPU, memory, process and disk I/O readings at the moment of the request, against the account’s own limits. Use it to check whether a slow site is held back by those limits. A null reading means unknown, not zero. A null limit means no limit or none reported. liveResources is null when the server reports no such readings. On an account that is not on cPanel no usage is reported. Counts are 0. Disk and bandwidth readings, every limit and liveResources are null.

Authentication: An API key with the scopes read:hosting and console:services. About keys and scopes

Request

Path parameters

accountIdstringrequired
The web hosting account ID (acct_…).

Example

GET /api/v2/shared-hosting/{accountId}/account-stats
curl "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/account-stats" \
-H "Authorization: Bearer $HOSTUP_API_KEY"

Responses

200 Usage and limits for the account.

Response 200
{
"disk": {
"usedBytes": 4294967296,
"limitBytes": 21474836480,
"usedGb": 4,
"limitGb": 20,
"usagePercent": 20,
"exceeded": false
},
"bandwidth": {
"usedBytes": 10737418240,
"limitBytes": 1099511627776,
"usedGb": 10,
"limitGb": 1024,
"usagePercent": 0.98,
"exceeded": false
},
"addonDomains": {
"used": 1,
"limit": 5,
"remaining": 4,
"usagePercent": 20,
"exceeded": false
},
"subDomains": {
"used": 3,
"limit": 50,
"remaining": 47,
"usagePercent": 6,
"exceeded": false
},
"emailAccounts": {
"used": 2,
"limit": 25,
"remaining": 23,
"usagePercent": 8,
"exceeded": false
},
"emailForwarders": {
"used": 1,
"limit": null,
"remaining": null,
"usagePercent": null,
"exceeded": false
},
"ftpAccounts": {
"used": 2,
"limit": 10,
"remaining": 8,
"usagePercent": 20,
"exceeded": false
},
"mysqlDatabases": {
"used": 3,
"limit": 10,
"remaining": 7,
"usagePercent": 30,
"exceeded": false
},
"liveResources": {
"cpu": {
"percentOfLimit": 99
},
"entryProcesses": {
"used": 1,
"limit": 20
},
"physicalMemory": {
"usedBytes": 3296559104,
"limitBytes": 8589934592
},
"processes": {
"used": 32,
"limit": 250
},
"io": {
"bytesPerSecond": 30720,
"limitBytesPerSecond": 314572800
},
"iops": {
"used": 0,
"limit": 10240
}
}
}
Response fields
diskobject
Disk usage.
usedBytesnumber or null
Bytes used. Null when the server gave no reading.
limitBytesnumber or null
The limit in bytes. Null when there is no limit.
usedGbnumber or null
GB used. Null when the server gave no reading.
limitGbnumber or null
The limit in GB. Null when there is no limit.
usagePercentnumber or null
Share of the limit in use, 0–100. Null without a limit or a reading.
exceededboolean
True when usage is above the limit.
bandwidthobject
Data transfer.
usedBytesnumber or null
Bytes used. Null when the server gave no reading.
limitBytesnumber or null
The limit in bytes. Null when there is no limit.
usedGbnumber or null
GB used. Null when the server gave no reading.
limitGbnumber or null
The limit in GB. Null when there is no limit.
usagePercentnumber or null
Share of the limit in use, 0–100. Null without a limit or a reading.
exceededboolean
True when usage is above the limit.
addonDomainsobject
Addon domains.
usedinteger
How many exist now.
limitinteger or null
The most the plan allows. Null when there is no limit.
remaininginteger or null
How many more can be created. Null when there is no limit.
usagePercentnumber or null
Share of the limit in use, 0–100. Null without a limit.
exceededboolean
True when usage is above the limit.
subDomainsobject
Subdomains.
usedinteger
How many exist now.
limitinteger or null
The most the plan allows. Null when there is no limit.
remaininginteger or null
How many more can be created. Null when there is no limit.
usagePercentnumber or null
Share of the limit in use, 0–100. Null without a limit.
exceededboolean
True when usage is above the limit.
emailAccountsobject
Mailboxes.
usedinteger
How many exist now.
limitinteger or null
The most the plan allows. Null when there is no limit.
remaininginteger or null
How many more can be created. Null when there is no limit.
usagePercentnumber or null
Share of the limit in use, 0–100. Null without a limit.
exceededboolean
True when usage is above the limit.
emailForwardersobject
E-mail forwarders.
usedinteger
How many exist now.
limitinteger or null
The most the plan allows. Null when there is no limit.
remaininginteger or null
How many more can be created. Null when there is no limit.
usagePercentnumber or null
Share of the limit in use, 0–100. Null without a limit.
exceededboolean
True when usage is above the limit.
ftpAccountsobject
FTP accounts.
usedinteger
How many exist now.
limitinteger or null
The most the plan allows. Null when there is no limit.
remaininginteger or null
How many more can be created. Null when there is no limit.
usagePercentnumber or null
Share of the limit in use, 0–100. Null without a limit.
exceededboolean
True when usage is above the limit.
mysqlDatabasesobject
MySQL databases.
usedinteger
How many exist now.
limitinteger or null
The most the plan allows. Null when there is no limit.
remaininginteger or null
How many more can be created. Null when there is no limit.
usagePercentnumber or null
Share of the limit in use, 0–100. Null without a limit.
exceededboolean
True when usage is above the limit.
liveResourcesobject or null
Readings at the moment of the request, against the account’s own limits. Not monthly totals. Null when the server reports no such readings. Inside the object, a null reading means not reported and a null limit means no limit.

Errors

Errors are Problem Details with a stable code. Branch on the code, not on the text.

400Invalid request. The response body is an RFC 7807 Problem Details document.
401Unauthorized. Authentication is required.
403Forbidden. The caller lacks a required scope or does not own the resource.
404Not found. The resource does not exist or is not owned by the caller.
409Conflict. code is account_suspended.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.