/image/analyticsGet image usage analytics
Retrieves image usage analytics, including bandwidth consumption, request counts, and cache or origin metrics. Provide metrics and a date_range with start_at and end_at; the requested range can span no more than 30 days. Use group_by to choose the data interval and filters.source_id to scope results to an image source.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
Image analytics query. Provide metrics and date_range; you can optionally group results or filter them by source.
The timeframe to get the data for. Currently we only support a maximum of 30 days between start_at and end_at.
Optional filters for the analytics query.
Data interval: daily, weekly, monthly, or hourly. Defaults to daily when omitted.
Define the metric you need the data for. Supported values: bandwidth_consumption, requests_count, transformations_count, bandwidth_savings, origin_hit_rate, avg_transformation_response_time, status_4xx, status_5xx, cdn_hit_rate, content_type, status_2xx, avg_response_time, top_assets, bandwidth_consumption_by_source, and ai_credit_usage.
One documented failure
image_source_not_foundCould not find any image source with the specified source_id.
One documented failure
invalid_api_keyAPI key supplied with request is invalid
One documented failure
unauthorizedYou don't have access to this feature. Please contact your organization owner.
A 400 is returned for a bad request, a 401 when the API key or bearer token is missing or invalid, and a 403 when the account is unpaid or lacks the required role permissions. metrics and date_range are required, and date_range must include start_at and end_at in yyyy-MM-dd format with no more than 30 days between them. group_by, when provided, must be daily, weekly, monthly, or hourly.