GET /accounts/{account_id}/media/usage
Retrieve Media usage analytics for an account. This endpoint shares the same backend handler as the Stream usage endpoint and returns identical Stream metrics (streamMinutesViewed). The gateway rewrites this path to the shared usage handler.
Servers
- https://api.cloudflare.com/client/v4
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
account_id |
String | Yes |
Standard Cloudflare hex account identifier. The API gateway translates this to an internal numeric ID before forwarding to the backend service. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
metrics |
String | No |
Comma-separated list of metrics to include in the response. Available metrics depend on the endpoint. Billing usage supports: streamMinutesViewed, rateLimitingRequestsAllowed, loadBalancingQueries, argoAcceleratedBytes, workersRequests, workersKVReads, imageResizingRequests, spectrumBytesTransferred, mediaUniqueTransformations. Stream/media usage supports: streamMinutesViewed. |
time_delta |
String | No |
Time unit to aggregate usage observations into. Data retention is approximately 18 months. The effective number of data points returned depends on the time range and granularity selected. For example, requesting hourly granularity over 18 months could produce up to ~13,000 data points; use the limit parameter to cap results and be aware that responses may be truncated. Valid values:
Default value: "hour" |
filters |
String | No |
Filter expressions to apply to the query. Format: field==value. Multiple filters can be combined. |
limit |
Integer | No |
Maximum number of data points to return. The actual number of results depends on the interaction between the time range (since/until) and time_delta granularity. Results are truncated to this limit without error if the time range produces more data points than the limit allows. Default value: 100 |
until |
String | No |
End of the time range for the query (inclusive). ISO 8601 timestamp. Defaults to the current time. |
since |
String | No |
Start of the time range for the query (inclusive). ISO 8601 timestamp. Defaults to 6 hours before the current time. |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.