> ## 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.

# Clicks per content block in a collection over a date range

> Storefront clicks (and, where recorded, click and impression sessions) per content block in the collection between from_date and to_date inclusive, from Tinybird. Use it to rank content blocks by engagement. Read-only; ranges up to 365 days.



## OpenAPI

````yaml /api-reference/openapi/lite.json get /brand-features/content-block-clicks/{collection_id}
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:
  /brand-features/content-block-clicks/{collection_id}:
    get:
      summary: Clicks per content block in a collection over a date range
      description: >-
        Storefront clicks (and, where recorded, click and impression sessions)
        per content block in the collection between from_date and to_date
        inclusive, from Tinybird. Use it to rank content blocks by engagement.
        Read-only; ranges up to 365 days.
      operationId: contentBlockClicks
      parameters:
        - schema:
            type: string
            description: The Shopify collection id (numeric, no gid prefix).
          required: true
          description: The Shopify collection id (numeric, no gid prefix).
          name: collection_id
          in: path
        - 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
            description: First day, YYYY-MM-DD.
          required: true
          description: First day, YYYY-MM-DD.
          name: from_date
          in: query
        - schema:
            type: string
            description: Last day, YYYY-MM-DD; at most 365 days after from_date.
          required: true
          description: Last day, YYYY-MM-DD; at most 365 days after from_date.
          name: to_date
          in: query
      responses:
        '200':
          description: One row per content block with clicks.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/LiteCollectionContentBlockClicksRow'
        '400':
          description: >-
            A query param is missing or not a date, from_date is after to_date,
            or the range exceeds 365 days.
          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:
    LiteCollectionContentBlockClicksRow:
      type: object
      properties:
        content_block_id:
          type: integer
        handle:
          type: string
          description: The content block's handle.
        nbr_clicks:
          type: integer
        unique_click_sessions:
          type: integer
        unique_impression_sessions:
          type: integer
          description: >-
            Sessions that saw the block; with unique_click_sessions, the
            click-through rate.
      required:
        - content_block_id
        - handle
        - nbr_clicks
    Detail:
      type: object
      properties:
        detail:
          type: string
      required:
        - detail
      description: 'Every 4xx/5xx body: `{detail}`.'
  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.

````