Image Usage Analytics

This endpoint helps you get image analytics data like bandwidth consumption, request count, CDN hit ratio, etc.

Body
application/json
  • date_range
    Type: object
    required

    The timeframe to get the data for. Currently we only support a maximum of 30 days between start_at and end_at.

  • metrics
    Type: array string[] enum
    required

    Define the metric you need the data for, currently we support "bandwidth_consumption", "requests_count","status_4xx","status_5xx","avg_response_time""

    values
    • bandwidth_consumption
    • requests_count
    • transformations_count
    • bandwidth_savings
    • origin_hit_rate
  • filters
    Type: object
  • group_by
    Type: string enum
    values
    • daily
    • weekly
    • monthly
    • hourly
Responses
  • application/json
  • application/json
Request Example for post/image/analytics
curl https://api.gumlet.com/v1/image/analytics \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "metrics": [
    "bandwidth_consumption"
  ],
  "date_range": {
    "start_at": "",
    "end_at": ""
  },
  "group_by": "daily",
  "filters": {
    "source_id": ""
  }
}'
{
  "bandwidth_consumption": [
    {
      "units": 1,
      "timestamp": 1
    }
  ],
  "requests_count": [
    {
      "units": 1,
      "timestamp": 1
    }
  ],
  "status_2xx": [
    {
      "units": 0,
      "timestamp": 1
    }
  ],
  "status_4xx": [
    {
      "units": 0,
      "timestamp": 1
    }
  ],
  "status_5xx": [
    {
      "units": 0,
      "timestamp": 1
    }
  ],
  "avg_response_time": [
    {
      "units": 0,
      "timestamp": 1
    }
  ],
  "cdn_hit_rate": [
    {
      "units": 0,
      "timestamp": 1
    }
  ],
  "transformations_count": [
    {
      "units": 1,
      "timestamp": 1
    }
  ],
  "origin_hit_rate": [
    {
      "units": 0,
      "timestamp": 1
    }
  ],
  "avg_transformation_response_time": [
    {
      "timestamp": 1,
      "fetch_time": 0,
      "response_time": 1
    }
  ],
  "content_type": [
    {
      "avif": 1,
      "png": 1,
      "jpeg": 1,
      "gif": 1,
      "webp": 1,
      "jxl": 1,
      "mp4": 1,
      "timestamp": 1
    }
  ],
  "bandwidth_savings": [
    {
      "units": 0,
      "timestamp": 1
    }
  ],
  "bandwidth_consumption_by_source": [
    {
      "bytes": 1,
      "domain": "string"
    }
  ]
}