---
title: "Get Existing Trends Analysis"
method: POST
path: "/ad_analytics/cpg_suite/trends-analysis/get-existing"
---

# Get Existing Trends Analysis

`POST /ad_analytics/cpg_suite/trends-analysis/get-existing`

## Request

- Base URL: `https://api.akkio.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.akkio.com/ad_analytics/cpg_suite/trends-analysis/get-existing`
- Auth: none declared

Get existing trends analysis results if they exist.

## Request body

- TrendsAnalysisRequest: Request for trends analysis comparing two selections over time.
  - `selection_1` SelectionPayload, required
    - `selections` array[], required
      - Selection[]
        - `field` string, required
        - `values` string[], nullable, required
  - `selection_2` SelectionPayload, required
    - `selections` array[], required
      - Selection[]
        - `field` string, required
        - `values` string[], nullable, required
  - `metric` 'total_sales' | 'transaction_count' | 'customer_count' | 'percent_of_total_sales', required: Primary metrics for trends analysis.
  - `filters` CPGSuiteFilter, required: Filter for CPG Suite.
    - `selections` SelectionPayload, required
      - `selections` array[], required
        - Selection[]
          - `field` string, required
          - `values` string[], nullable, required
    - `search_string` string, nullable: Search string for fuzzy match
    - `timeframe` SrcApiAdAnalyticsModelTimeframe
      - `start_date` string, date-time, required
      - `end_date` string, date-time, nullable, required
    - `audience_filter` CPGAudienceFilter: Audience filter for CPG Suite with category selection support.
      - `audience_id` string, nullable: Base audience ID to filter by
      - `category_selections` SelectionPayload
        - `selections` array[], required
          - Selection[]
            - `field` string, required
            - `values` string[], nullable, required
  - `aggregate_by_day_of_week` boolean: Aggregate by day of week instead of time periods

## Response `200`

Successful Response

- TrendsAnalysisResponse: Response for trends analysis request.
  - `selection_1_name` string, required: Display name for first selection
  - `selection_2_name` string, required: Display name for second selection
  - `metric` 'total_sales' | 'transaction_count' | 'customer_count' | 'percent_of_total_sales', required: Primary metrics for trends analysis.
  - `time_period` 'monthly' | 'weekly' | 'daily' | 'day_of_week', required: Time period aggregation for trends analysis.
  - `data_points` TrendsDataPoint[], required: Time series data points
    - `time_period` string, required: Time period (e.g., '2024-01', 'Week 1', etc.)
    - `selection_name` string, required: Name of the selection this data point represents
    - `value` number, required: Value of the selected metric for this period
    - `weighted_value` number, required: Weighted value of the selected metric for this period

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/akkio/apis/akkio-api.md) - [All operations](https://skmtc.dev/akkio/apis/akkio-api/llms.txt) - [OpenAPI document](https://skmtc.dev/akkio/apis/akkio-api/revisions/c477deff6271?raw)
