Skip to content
WP EngineDocumentation

Get a list of daily usage metrics

GET
/installs/{install_id}/usage
curl --request GET \
--url https://api.wpengineapi.com/v1/installs/294deacc-d8b8-4005-82c4-0727ba8ddde0/usage \
--header 'Authorization: Basic <credentials>'

Get a list of daily usage metrics related to this install. If the optional first_date and last_date arguments are omitted, the response will include metrics for the last 30 days. For days where there are no storage metrics, they will be artificially filled with the last known storage metrics.

install_id
required
string format: uuid

The UUID of the install.

Example
294deacc-d8b8-4005-82c4-0727ba8ddde0
first_date
string format: date
/^\d{4}-\d{2}-\d{2}$/

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.

last_date
string format: date
/^\d{4}-\d{2}-\d{2}$/

The end date for the requested metrics range (inclusive). Format: YYYY-mm-dd. If last_date is provided, first_date must also be provided.

A successful response.

Media typeapplication/json

A daily usage metrics series.

object
install_name

The name of the install for the included metrics.

string
metrics

The requested metrics for an install. Metrics will include daily usage metrics for the last 30 days. Metrics will be sorted in descending order (most recent date first).

Array<object>

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
date

The date (ISO 8601).

string
visit_count

Total visits.

string format: int64
nullable
network_origin_bytes

Data served over HTTP by the origin server.

This does not include cached data served from a CDN.

string format: int64
nullable
storage_file_bytes

Storage used by this environment’s files.

This includes all files in the web root directory.

string format: int64
nullable
storage_database_bytes

Storage used by this environment’s database.

string format: int64
nullable
billable_visits

Billable visits.

string format: int64
nullable
request_origin_count

The total number of HTTP requests received by the origin server.

This does not include cached requests that were served from a CDN.

string format: int64
nullable
network_cdn_bytes

The data served by the CDN.

string format: int64
nullable
storage_update_time

The most recent storage usage measurement time (in UTC).

string format: date-time
nullable
network_total_bytes

The sum of CDN and origin network bytes.

string format: int64
nullable
traffic_metrics_source

The source of the traffic metrics.

  • TRAFFIC_METRICS_SOURCE_UNSPECIFIED: The source of the traffic metrics is unknown.
  • ONHOST: The traffic metrics is sourced from onhost logcrunch (legacy).
  • BIGQUERY: The traffic metrics is sourced from BigQuery logcrunch.
string
default: TRAFFIC_METRICS_SOURCE_UNSPECIFIED
Allowed values: TRAFFIC_METRICS_SOURCE_UNSPECIFIED ONHOST BIGQUERY
database_tables_count

The number of tables in the install’s database.

string format: int64
nullable
database_sql_bytes

The sum of bytes of the database content in MySQL for an install.

string format: int64
nullable
autoloaded_bytes

The sum of bytes that is automatically loaded on each request to the install.

string format: int64
nullable
metrics_rollup

A rollup of usage metrics.

object
visit_count

A metric rollup.

object
average

The average value of the metric.

string format: int64
nullable
sum

The total sum value of the metric.

string format: int64
nullable
latest

The latest information.

object
date

The date (ISO 8601).

string
value

The value.

string format: int64
network_origin_bytes

A metric rollup.

object
average

The average value of the metric.

string format: int64
nullable
sum

The total sum value of the metric.

string format: int64
nullable
latest

The latest information.

object
date

The date (ISO 8601).

string
value

The value.

string format: int64
storage_file_bytes

A metric rollup.

object
average

The average value of the metric.

string format: int64
nullable
sum

The total sum value of the metric.

string format: int64
nullable
latest

The latest information.

object
date

The date (ISO 8601).

string
value

The value.

string format: int64
storage_database_bytes

A metric rollup.

object
average

The average value of the metric.

string format: int64
nullable
sum

The total sum value of the metric.

string format: int64
nullable
latest

The latest information.

object
date

The date (ISO 8601).

string
value

The value.

string format: int64
billable_visits

A metric rollup.

object
average

The average value of the metric.

string format: int64
nullable
sum

The total sum value of the metric.

string format: int64
nullable
latest

The latest information.

object
date

The date (ISO 8601).

string
value

The value.

string format: int64
request_origin_count

A metric rollup.

object
average

The average value of the metric.

string format: int64
nullable
sum

The total sum value of the metric.

string format: int64
nullable
latest

The latest information.

object
date

The date (ISO 8601).

string
value

The value.

string format: int64
network_cdn_bytes

A metric rollup.

object
average

The average value of the metric.

string format: int64
nullable
sum

The total sum value of the metric.

string format: int64
nullable
latest

The latest information.

object
date

The date (ISO 8601).

string
value

The value.

string format: int64
network_total_bytes

A metric rollup.

object
average

The average value of the metric.

string format: int64
nullable
sum

The total sum value of the metric.

string format: int64
nullable
latest

The latest information.

object
date

The date (ISO 8601).

string
value

The value.

string format: int64
storage_refresh_expected_time

Represents the estimated completion time (in UTC) for a refresh disk usage operation. If a refresh is not in progress, then this field will be null.

string format: date-time
nullable
Example
{
"metrics": [
{
"traffic_metrics_source": "TRAFFIC_METRICS_SOURCE_UNSPECIFIED"
}
]
}

Bad Request. The request was improperly formatted or contained invalid parameters.

Media typeapplication/json
object
message
required

A message explaining the error.

string
Example
{
"message": "Must provide or omit both first_date and last_date."
}

Not Found. The requested install id does not exist.

Media typeapplication/json
object
message
required

A message regarding the error that occurred on the server

string
documentation_url

(Optional) A URL where documentation regarding this specific error can be found

string
Examples
Exampleresponse
{
"message": "Not found"
}

An unexpected error response.

Media typeapplication/json
object
message
required

A message regarding the error that occurred on the server

string
Example
{
"message": "An unexpected error occurred, please try again in a few minutes"
}