> ## Documentation Index
> Fetch the complete documentation index at: https://docs.depict.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Merchant-wide collection traffic totals for a window

> Returns merchant-wide collection-page traffic (views, clicks, shoppers, click-through) summed over all collections for [from_date, to_date], and for the same-length window immediately before it so a caller can show a delta. Read-only; answers from Tinybird analytics, cached privately for 5 minutes. A null row means no collection traffic in that window.



## OpenAPI

````yaml /api-reference/openapi/lite.json get /collection-totals
openapi: 3.1.0
info:
  title: Search & Merchandising API
  version: 1.0.0
  description: >-
    REST API behind Depict: Search & Merchandising, the native Shopify app:
    onboarding, collections, boost & bury, dashboards, A/B testing and
    multi-store management. Endpoints are served under the /api/lite prefix and
    are authenticated with the Shopify session token that App Bridge issues to
    the embedded app.
servers:
  - url: /api/lite
security:
  - ShopifySessionToken: []
paths:
  /collection-totals:
    get:
      summary: Merchant-wide collection traffic totals for a window
      description: >-
        Returns merchant-wide collection-page traffic (views, clicks, shoppers,
        click-through) summed over all collections for [from_date, to_date], and
        for the same-length window immediately before it so a caller can show a
        delta. Read-only; answers from Tinybird analytics, cached privately for
        5 minutes. A null row means no collection traffic in that window.
      operationId: collectionTotals
      parameters:
        - schema:
            type: string
            description: Lite merchant id, e.g. `shopify-<shop id>`.
          required: true
          description: Lite merchant id, e.g. `shopify-<shop id>`.
          name: merchant_id
          in: query
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
            example: '2026-09-01'
            description: First day, inclusive.
          required: true
          description: First day, inclusive.
          name: from_date
          in: query
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
            example: '2026-09-01'
            description: Last day, inclusive.
          required: true
          description: Last day, inclusive.
          name: to_date
          in: query
        - schema:
            type: string
            description: >-
              Restricts traffic to one Shopify market (the id the portal's
              market picker sends); the response then omits `total_collections`.
          required: false
          description: >-
            Restricts traffic to one Shopify market (the id the portal's market
            picker sends); the response then omits `total_collections`.
          name: market_id
          in: query
      responses:
        '200':
          description: Both windows.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CollectionTotalsResponse'
        '400':
          description: >-
            A query parameter is missing or not a date; `detail` carries zod's
            messages.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '401':
          description: Not authenticated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '403':
          description: Authenticated, but this identity may not call the API.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '404':
          description: Merchant not found for this caller.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '500':
          description: Internal error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
components:
  schemas:
    CollectionTotalsResponse:
      type: object
      properties:
        current:
          anyOf:
            - $ref: '#/components/schemas/CollectionTotalsRow'
            - type: 'null'
        previous:
          anyOf:
            - $ref: '#/components/schemas/CollectionTotalsRow'
            - type: 'null'
        total_collections:
          type: integer
          description: >-
            Every non-deleted collection; absent on a market-scoped window or
            when the count failed.
      required:
        - current
        - previous
      description: >-
        `previous` is the same-length window just before `current`; a null row
        is a window with no collection traffic.
    Detail:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
      description: 'Every 4xx/5xx body: `{detail}`.'
    CollectionTotalsRow:
      type: object
      properties:
        views:
          type: number
          description: 'Per-collection distinct viewers, summed: reach.'
        clicks:
          type: number
          description: Per-collection distinct clickers, summed.
        product_clicks:
          type: number
        viewing_shoppers:
          type:
            - number
            - 'null'
          description: >-
            Distinct shoppers on any collection page; null (with the next two)
            when the shoppers pipe could not answer.
        clicking_shoppers:
          type:
            - number
            - 'null'
        click_events:
          type:
            - number
            - 'null'
          description: Product clicks on collection pages, one per click event.
        clickthrough_rate:
          type:
            - number
            - 'null'
          description: clicking_shoppers / viewing_shoppers, as a percentage.
        collections:
          type: integer
          description: Collections with traffic in the window.
      required:
        - views
        - clicks
        - product_clicks
        - viewing_shoppers
        - clicking_shoppers
        - click_events
        - clickthrough_rate
        - collections
  securitySchemes:
    ShopifySessionToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Shopify App Bridge session token of the embedded Depict: Search &
        Merchandising app. The shop in the token determines the merchant;
        merchant_id parameters must belong to that shop.

````