Get account usage metrics
GET /accounts/{account_id}/usage
Get usage metrics for all environments in an account.
If the optional first_date and last_date arguments are omitted, the response will include metrics for the last 30 days.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”ID of account
Query Parameters
Section titled “Query Parameters ”The start date for the requested metrics range (inclusive).
Format: YYYY-mm-dd. Cannot be older than 13 months.
If first_date is provided, last_date must also be provided.
The end date for the requested metrics range (inclusive).
Format: YYYY-mm-dd.
If last_date is provided, first_date must also be provided.
The maximum number of environments to return. A maximum of 1000 environments can be requested per page
String-encoded offset for pagination. The next_page_token from the response can be used to paginate accordingly.
Responses
Section titled “ Responses ”A successful response.
object
Usage metrics for each environment in the account
object
The name of the environment
Daily usage metrics for this environment
Usage metrics collected over the period of one day.
In JSON format, the DailyUsageMetrics int64 values are encoded as a string rather than a number, following the proto3 specification.
object
The date (ISO 8601).
Total visits.
Data served over HTTP by the origin server.
This does not include cached data served from a CDN.
Storage used by this environment’s files.
This includes all files in the web root directory.
Storage used by this environment’s database.
Billable visits.
The total number of HTTP requests received by the origin server.
This does not include cached requests that were served from a CDN.
The data served by the CDN.
The most recent storage usage measurement time (in UTC).
The sum of CDN and origin network bytes.
The source of the traffic metrics.
The number of tables in the install’s database.
The sum of bytes of the database content in MySQL for an install.
The sum of bytes that is automatically loaded on each request to the install.
The largest files in the install in bytes, received as a tab-separated list of file paths and sizes.
Rollup of the usage metrics for this environment
object
A rollup of total visits.
The average field represents the average total visits per day on all installs. The sum field represents the sum of all the total visits on all installs. The latest field is not applicable to the total visits and will be empty.
object
The average value of the metric.
The total sum value of the metric.
The latest value of the metric.
object
The date (ISO 8601).
The value.
A Rollup of data transfer metrics.
The average field represents the average data transfer metrics per day on all installs. The sum field represents the sum of all the data transfer metrics on all installs. The latest field is not applicable to the data transfer metrics and will be empty.
object
The average value of the metric.
The total sum value of the metric.
The latest value of the metric.
object
The date (ISO 8601).
The value.
A rollup of file storage metrics.
The latest field represents the sum of all the latest metrics for file storage on all installs. The average and sum fields will be empty.
object
The average value of the metric.
The total sum value of the metric.
The latest value of the metric.
object
The date (ISO 8601).
The value.
A rollup of database storage metrics.
The latest field represents the sum of all the latest metrics for database storage on all installs. The average and sum fields will be empty.
object
The average value of the metric.
The total sum value of the metric.
The latest value of the metric.
object
The date (ISO 8601).
The value.
A rollup of billable visits.
The average field represents the average billable visits per day on all installs. The sum field represents the sum of all the billable visits on all installs. The latest field is not applicable to the billable visits and will be empty.
object
The average value of the metric.
The total sum value of the metric.
The latest value of the metric.
object
The date (ISO 8601).
The value.
A rollup of total number of requests.
The average field represents the average requests per day on all installs. The sum field represents the sum of all requests on all installs. The latest field is not applicable to the requests and will be empty.
object
The average value of the metric.
The total sum value of the metric.
The latest value of the metric.
object
The date (ISO 8601).
The value.
A rollup of total number of bytes served by CDN.
The average field represents the average bytes per day on all installs. The sum field represents the sum of all bytes on all installs. The latest field is not applicable to the bytes and will be empty.
object
The average value of the metric.
The total sum value of the metric.
The latest value of the metric.
object
The date (ISO 8601).
The value.
A rollup of total number of bytes served by CDN and origin.
The average field represents the average bytes per day on all installs. The sum field represents the sum of all network bytes on all installs. The latest field is not applicable to the bytes and will be empty.
object
The average value of the metric.
The total sum value of the metric.
The latest value of the metric.
object
The date (ISO 8601).
The value.
The expected time when the storage refresh will complete for this environment
Total number of environments
Token for the next page of results
Whether all environments can be returned based on account permissions
The time when the account storage was last refreshed
The expected time when the account storage refresh will complete
Bad Request. The request was improperly formatted or contained invalid parameters.
object
A message explaining the error.
Example
Must provide or omit both first_date and last_date.Authentication Error
object
A message regarding the error that occurred on the server
Example
Bad Credentials(Optional) A URL where documentation regarding this specific error can be found
Not Authorized
object
A message regarding the error that occurred on the server
Example
You don't have permission to perform that action(Optional) A URL where documentation regarding this specific error can be found
Not Found. The requested account id does not exist.
object
A message regarding the error that occurred on the server
Example
Not Found(Optional) A URL where documentation regarding this specific error can be found
Too many requests
default
Section titled “default ”An unexpected error response.
object
A message regarding the error that occurred on the server
Example
An unexpected error occurred, please try again in a few minutes