> ## 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 metafield keys a merchant's catalog carries

> Lists every Shopify product metafield key (with its type) found in the merchant's synced catalog, most common first, with how many products carry it and how many distinct values it takes. Call it to discover which metafields a collection can be sorted by or which a boost/bury rule or badge can match on; then call /product-metafield-values for one key's values. Read-only. It scans the whole catalog (up to ~20 s) and answers 503 when that scan times out; retrying at once rarely helps. Responses are cacheable for 60 s.



## OpenAPI

````yaml /api-reference/openapi/lite.json get /product-metafield-keys
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-keys:
    get:
      summary: The metafield keys a merchant's catalog carries
      description: >-
        Lists every Shopify product metafield key (with its type) found in the
        merchant's synced catalog, most common first, with how many products
        carry it and how many distinct values it takes. Call it to discover
        which metafields a collection can be sorted by or which a boost/bury
        rule or badge can match on; then call /product-metafield-values for one
        key's values. Read-only. It scans the whole catalog (up to ~20 s) and
        answers 503 when that scan times out; retrying at once rarely helps.
        Responses are cacheable for 60 s.
      operationId: productMetafieldKeys
      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
      responses:
        '200':
          description: The key listing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductMetafieldKeys'
        '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:
    ProductMetafieldKeys:
      type: object
      properties:
        keys:
          type: array
          items:
            type: object
            properties:
              key:
                type: string
                description: >-
                  `namespace.key`; pass it as `key` to
                  /product-metafield-values.
              type:
                type: string
                description: >-
                  Shopify metafield type, e.g. `number_integer`,
                  `single_line_text_field`. One key can appear once per type.
              product_count:
                type: integer
                description: Products carrying this key and type.
              truncated_count:
                type: integer
                description: >-
                  Of those, products whose value was too long to store; they are
                  left out of value listings.
              value_count:
                type: integer
                description: >-
                  Distinct stored values: the number of rows
                  /product-metafield-values would list (before its cap).
            required:
              - key
              - type
              - product_count
              - truncated_count
              - value_count
        limitHit:
          type: boolean
          description: >-
            True when the catalog has more (key, type) pairs than the 2000-row
            cap; the listing keeps the most common.
      required:
        - keys
        - 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.

````