Return cPanel account's bandwidth usage report

This function queries an account's bandwidth data and returns a report.

Note:

This function also returns the bandwidth use of a distributed cPanel account.

SecurityBasicAuth
Request
query Parameters
required
string or string

How to group the data in the report, in pipe-separated format. This list must contain one or both of the following parameters:

A pipe-separated list that contains one or both of the following parameters:

  • domain
  • protocol

This parameter can also include only one of the following start time interval types:

  • year
  • year_month
  • year_month_day
  • year_month_day_hour
  • year_month_day_mour_minute

Note:

  • This parameter accepts a maximum of three values.
  • The function nests the return objects in the order that you declare the values in this parameter.
Examples:
domains
string <domain>

A pipe-separated list of domains for which to provided data.

Note:

  • If you do not include this parameter, the function will return data for all domains on the cPanel account.
  • The UNKNOWN "pseudo-domain" refers to data recorded without a specific domain. All traffic except HTTP traffic is recorded without a specific domain.
Examples:
end
integer <unix_timestamp>

The end date of the report window.

Example: end=1446664809
interval
string
Default: "daily"

Length of time between bandwidth data samples.

  • daily
  • hourly
  • 5min

Note:

The interval's retention period determines availability of the interval's data. Use the Bandwidth::get_retention_periods API to determine an interval's retention period.

Enum: "daily" "hourly" "5min"
Example: interval=daily
protocols
string

A pipe-separated list of the protocols for which to provide data.

  • http
  • imap
  • smtp
  • pop3
  • ftp
Examples:
start
integer <unix_timestamp>

The start date of the report window.

Example: start=1445664609
timezone
string <olson_timezone_name>

The timezone in which to report the data.

Example: timezone=America/Chicago
Responses
200

HTTP Request was successful.

Response Schema: application/json
apiversion
integer

The version of the API.

func
string

The name of the method called.

module
string

The name of the module called.

object
get/Bandwidth/query
Request samples
uapi --output=jsonpretty \
  --user=username \
  Bandwidth \
  query \
  grouping='domain|protocol|year'
Response samples
application/json

grouping=domain

{
  • "data": {
    • "UNKNOWN": 70447164,
    • "example.com": 815258916235,
    • "parkedexample.com": 18861122614,
    • "subdomain.example.com": 11407,
    • "subdomain2.example.com": 683533
    },
  • "errors": null,
  • "messages": null,
  • "metadata": { },
  • "status": 1
}