---
title: "Controller Get Existing Basket Analysis"
method: POST
path: "/ad_analytics/cpg_suite/basket-analysis/get-existing"
---

# Controller Get Existing Basket Analysis

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

Get existing basket analysis results

## Request body

- BasketAnalysisRequest — Request for basket analysis - finding products frequently purchased together.
  - `target` TargetSelection, required — Selection for the target field.
    - `field` 'BRAND' | 'CATEGORY' | 'SUBCATEGORY' | 'PRODUCT_NAME' | 'BASKET_TOTAL' | 'BASKET_ID', required
    - `value` string, required — The value to select
  - `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

## Response `200`

Successful Response

- BasketAnalysisResponse — Response for basket analysis request.
  - `co_purchased_products_lift` CoPurchasedProduct[], required — Products frequently purchased with the focal product, sorted by lift
    - `product_name` string, required — Name of the co-purchased product
    - `brand` string, nullable, required — Brand of the co-purchased product
    - `category` string, nullable, required — Category of the co-purchased product
    - `subcategory` string, nullable, required — Subcategory of the co-purchased product
    - `support` number, required — Percentage of all baskets containing both products
    - `confidence` number, required — Percentage of focal product baskets that also contain this product
    - `lift` number, required — Ratio of observed co-occurrence to expected co-occurrence
  - `co_purchased_products_confidence` CoPurchasedProduct[], required — Products frequently purchased with the focal product, sorted by confidence
    - `product_name` string, required — Name of the co-purchased product
    - `brand` string, nullable, required — Brand of the co-purchased product
    - `category` string, nullable, required — Category of the co-purchased product
    - `subcategory` string, nullable, required — Subcategory of the co-purchased product
    - `support` number, required — Percentage of all baskets containing both products
    - `confidence` number, required — Percentage of focal product baskets that also contain this product
    - `lift` number, required — Ratio of observed co-occurrence to expected co-occurrence
  - `co_purchased_products_support` CoPurchasedProduct[], required — Products frequently purchased with the focal product, sorted by support
    - `product_name` string, required — Name of the co-purchased product
    - `brand` string, nullable, required — Brand of the co-purchased product
    - `category` string, nullable, required — Category of the co-purchased product
    - `subcategory` string, nullable, required — Subcategory of the co-purchased product
    - `support` number, required — Percentage of all baskets containing both products
    - `confidence` number, required — Percentage of focal product baskets that also contain this product
    - `lift` number, required — Ratio of observed co-occurrence to expected co-occurrence

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/akk/apis/fastapi.md) · [All operations](https://skmtc.net/akk/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/akk/fastapi/revisions/6662a407c637/schema)
