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

# The distinct values one metafield key takes

> Lists the distinct values one product metafield key takes across the merchant's synced catalog, most common first, with the number of products per value (capped, see `limitHit`). Call it after /product-metafield-keys to offer concrete values for a metafield rule or badge. Read-only; same full-catalog scan, 503-on-timeout and 60 s cache as the key listing.



## OpenAPI

````yaml /api-reference/openapi/lite.json get /product-metafield-values
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:
  /product-metafield-values:
    get:
      summary: The distinct values one metafield key takes
      description: >-
        Lists the distinct values one product metafield key takes across the
        merchant's synced catalog, most common first, with the number of
        products per value (capped, see `limitHit`). Call it after
        /product-metafield-keys to offer concrete values for a metafield rule or
        badge. Read-only; same full-catalog scan, 503-on-timeout and 60 s cache
        as the key listing.
      operationId: productMetafieldValues
      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: ^[A-Za-z0-9_-]{1,255}\.[A-Za-z0-9_-]{1,64}$
            description: >-
              The metafield as `namespace.key` (e.g. `custom.weight`), as listed
              by /product-metafield-keys.
          required: true
          description: >-
            The metafield as `namespace.key` (e.g. `custom.weight`), as listed
            by /product-metafield-keys.
          name: key
          in: query
      responses:
        '200':
          description: The value listing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductMetafieldValues'
        '400':
          description: The query failed the schema; `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'
        '502':
          description: Lite ingestion could not answer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
        '503':
          description: The catalog aggregate hit lite-ingestion's statement timeout.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Detail'
components:
  schemas:
    ProductMetafieldValues:
      type: object
      properties:
        values:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
                description: >-
                  The raw stored string (numbers arrive as strings, e.g.
                  `"12"`).
              product_count:
                type: integer
            required:
              - value
              - product_count
        limitHit:
          type: boolean
          description: >-
            True when the key has more distinct values than the 50-row cap; the
            listing keeps the most common.
      required:
        - values
        - limitHit
    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.

````