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

# Get Product Toplist Endpoint



## OpenAPI

````yaml /api-reference/openapi/foundation-portal.json get /api/v1/merchants/{merchant_id}/products/{main_product_id}/metrics/toplist
openapi: 3.1.0
info:
  title: Depict Foundation Portal API
  version: 1.0.0
  description: >-
    REST API behind the Depict Foundation merchant portal: merchants, products,
    collections, curation, metrics, analytics and search insights. All endpoints
    require an Auth0-issued bearer token.
servers:
  - url: ''
security: []
paths:
  /api/v1/merchants/{merchant_id}/products/{main_product_id}/metrics/toplist:
    get:
      tags:
        - Product Metrics
      summary: Get Product Toplist Endpoint
      operationId: >-
        get_product_toplist_endpoint_api_v1_merchants__merchant_id__products__main_product_id__metrics_toplist_get
      parameters:
        - name: main_product_id
          in: path
          required: true
          schema:
            type: string
            title: Main Product Id
        - name: merchant_id
          in: path
          required: true
          schema:
            type: string
            title: Merchant Id
        - name: market_group
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Market Group
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductToplistResponse'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - Auth0: []
components:
  schemas:
    ProductToplistResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/CollectionPosition'
          type: array
          title: Data
          default: []
      type: object
      title: ProductToplistResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CollectionPosition:
      properties:
        collection_id:
          type: string
          title: Collection Id
        clicks:
          type: integer
          title: Clicks
          default: 0
        position:
          type: integer
          title: Position
          default: 0
        total_products:
          type: integer
          title: Total Products
          default: 0
      type: object
      required:
        - collection_id
      title: CollectionPosition
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    Auth0:
      type: oauth2
      flows:
        authorizationCode:
          scopes:
            openid: OpenID Connect
            profile: User profile
            email: User email
          authorizationUrl: https://depict.eu.auth0.com/oauth/authorize
          tokenUrl: https://depict.eu.auth0.com/oauth/token
      x-tokenName: id_token

````