---
updatedAt: 2025-07-24T15:00:51.000Z
agentTools:
  projectIndex: https://docs.arena.im/llms.txt
---

# Retrieve Commerce AI Analytics

Fetches analytics data for a specific Commerce AI instance within a site, filtered by a date period.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "paths": {
    "/sites/{siteId}/commerce-ais/{commerceAiId}/analytics": {
      "get": {
        "summary": "Retrieve Commerce AI Analytics",
        "description": "Fetches analytics data for a specific Commerce AI instance within a site, filtered by a date period.",
        "operationId": "CommerceAiController_getAnalytics",
        "parameters": [
          {
            "name": "siteId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "The unique ID of the site containing the Commerce AI instance"
          },
          {
            "name": "commerceAiId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            },
            "description": "The unique ID of the Commerce AI instance to retrieve analytics for"
          },
          {
            "name": "filter[datePeriod]",
            "description": "Filter analytics by date period (e.g., 'current_year' or 'one_year')",
            "in": "query",
            "required": true,
            "schema": {
              "default": "current_year",
              "example": "current_year",
              "enum": [
                "current_year",
                "one_year"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successfully retrieved the Commerce AI analytics",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CommerceAiAnalyticsResponseDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized due to missing or expired authentication token"
          }
        },
        "tags": [
          "commerce-ais"
        ],
        "security": [
          {
            "bearer": []
          }
        ]
      }
    }
  },
  "info": {
    "title": "Customer's API",
    "description": "API to manage customer resources",
    "version": "3.0",
    "contact": {}
  },
  "servers": [
    {
      "url": "https://api.arena.im/v3"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "type": "http"
      }
    },
    "schemas": {
      "CommerceAiAnalyticsResponseDto": {
        "type": "object",
        "properties": {
          "startDate": {
            "format": "date-time",
            "type": "string",
            "description": "Start date of the analytics",
            "example": "2024-01-01T00:00:00.000Z"
          },
          "endDate": {
            "format": "date-time",
            "type": "string",
            "description": "End date of the analytics",
            "example": "2024-01-31T23:59:59.999Z"
          },
          "pageviews": {
            "type": "number",
            "description": "Number of page views",
            "example": 10
          }
        },
        "required": [
          "startDate",
          "endDate",
          "pageviews"
        ]
      }
    }
  }
}
```