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

# Search Count

> Fetches the count of products matching URL-encoded search and filter criteria. Ideal for simple pagination UIs that only need the total number of hits.

Before calling this endpoint, make sure you’ve generated an API token and picked the correct domain. See [Authentication & Base URLs](/api-reference/authbaseurl).


## OpenAPI

````yaml GET /apis/ecommerce-service/public/discovery/v2/search/count
openapi: 3.1.0
info:
  title: OpenAPI Plant Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://apis.experro.app
    description: Admin Server
  - url: https://{base-address}
    description: Custom Server
    variables:
      base-address:
        default: ''
        description: Enter your custom domain or server address.
security:
  - bearerAuth: []
paths:
  /apis/ecommerce-service/public/discovery/v2/search/count:
    get:
      summary: Retrieve Product Hit Count via Query Parameters
      description: >-
        Fetches the count of products matching URL-encoded search and filter
        criteria. Ideal for simple pagination UIs that only need the total
        number of hits.
      parameters:
        - $ref: '#/components/parameters/CustomerGroupIdHeader'
        - $ref: '#/components/parameters/EcommProviderHeader'
        - $ref: '#/components/parameters/FieldsQryPrm'
        - $ref: '#/components/parameters/LocaleQryPrm'
        - $ref: '#/components/parameters/StoreIdQryPrm'
        - $ref: '#/components/parameters/ChannelIdQryPrm'
        - name: location_id
          in: query
          description: >-
            Identifier for the regional location from the BigCommerce admin
            panel.
          schema:
            type: string
        - $ref: '#/components/parameters/CurrencyQryPrm'
        - name: include_fields_meta
          in: query
          description: Whether to include metadata about the fields in the response
          schema:
            type: boolean
        - $ref: '#/components/parameters/SearchTermQryPrm'
        - name: category_id
          in: query
          description: Identifier for the product category to filter results.
          schema:
            type: string
        - name: category_name
          in: query
          schema:
            type: string
          description: Name of the product category to filter results.
        - name: collection_id
          in: query
          schema:
            type: string
          description: Identifier for a specific collection or campaign to filter results.
        - $ref: '#/components/parameters/SkipQryPrm'
        - $ref: '#/components/parameters/LimitQryPrm'
        - name: sort_order
          in: query
          schema:
            type: string
          description: >-
            Sort direction for counting logic (rarely used for pure
            counts).`asc` for ascending, `desc` for descending.
        - name: sort_by
          in: query
          schema:
            type: string
          description: Field name by which the results should be sorted.
        - name: facets
          in: query
          schema:
            type: string
          description: >-
            Facet fields with value to filter product by color, size or provided
            facets
        - $ref: '#/components/parameters/FilterQryPrm'
        - name: by_pass_merchandising
          in: query
          schema:
            type: boolean
          description: Whether to bypass merchandising rules for count calculations
      responses:
        '200':
          description: Total count of matching products.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchCount200Response'
        '400':
          description: Bad Request – invalid query syntax.
          content:
            application/json:
              schema:
                type: object
                properties:
                  Status:
                    type: string
                    example: failure
                  Data:
                    $ref: '#/components/schemas/Error404'
        '401':
          description: Unauthorized – Missing or invalid API key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  Status:
                    type: string
                    example: failure
                  Data:
                    $ref: '#/components/schemas/Error401'
        '500':
          description: Internal Server Error – an unexpected error on the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  Status:
                    type: string
                    example: failure
                  Data:
                    $ref: '#/components/schemas/Error500'
      security: []
      servers:
        - url: https://{base-address}
          description: Custom Server
          variables:
            base-address:
              default: ''
              description: Enter your custom domain or server address.
components:
  parameters:
    CustomerGroupIdHeader:
      name: x-customer-group-id
      in: header
      required: false
      schema:
        type: string
      description: Optional customer group identifier for segment-specific responses.
    EcommProviderHeader:
      name: x-ecomm-provider
      in: header
      required: false
      schema:
        type: string
      description: >-
        eCommerce provider for contextualizing the API call (e.g., shopify,
        magento, etc.).
    FieldsQryPrm:
      name: fields
      in: query
      description: Comma-separated list of fields to include in the response
      schema:
        type: string
      required: true
    LocaleQryPrm:
      name: locale
      in: query
      description: Specifies the language or region for the response data
      required: true
      schema:
        type: string
    StoreIdQryPrm:
      name: store_id
      in: query
      description: Identifier of the store within the eCommerce platform.
      required: false
      schema:
        type: string
    ChannelIdQryPrm:
      name: channel_id
      in: query
      description: Sales or distribution channel identifier.
      required: false
      schema:
        type: string
    CurrencyQryPrm:
      name: currency
      in: query
      description: Currency code for price displays.
      required: false
      schema:
        type: string
    SearchTermQryPrm:
      name: search_term
      in: query
      description: The search term for generating suggestions or results
      schema:
        type: string
    SkipQryPrm:
      name: skip
      in: query
      schema:
        type: integer
      description: Number of items to skip for pagination offset.
    LimitQryPrm:
      name: limit
      in: query
      schema:
        type: integer
      description: Maximum number of items to return.
    FilterQryPrm:
      name: filter
      in: query
      description: Logical filter expression to narrow results
      schema:
        type: string
  schemas:
    SearchCount200Response:
      type: object
      properties:
        Status:
          type: string
          example: success
        Data:
          type: object
          properties:
            result:
              properties:
                total_count:
                  type: number
            _meta_:
              $ref: '#/components/schemas/MetaResponse'
    Error404:
      type: object
      properties:
        Status:
          type: string
          example: failure
        Error:
          type: object
          properties:
            message:
              type: string
            name:
              type: string
            code:
              type: string
          required:
            - message
            - name
      required:
        - Status
        - Error
    Error401:
      type: object
      properties:
        Status:
          type: string
          example: failure
        Error:
          type: object
          properties:
            message:
              type: string
            name:
              type: string
            code:
              type: string
          required:
            - message
            - name
      required:
        - Status
        - Error
    Error500:
      type: object
      properties:
        Status:
          type: string
          example: failure
        Error:
          type: object
          properties:
            message:
              type: string
            name:
              type: string
            code:
              type: string
          required:
            - message
            - name
      required:
        - Status
        - Error
    MetaResponse:
      type: object
      properties:
        tenant_id:
          type: string
        workspace_id:
          type: string
        env_type:
          type: string
        store_hash:
          type: string
        content_model_id:
          type: string
        _fields_:
          type: object
          additionalProperties:
            type: object
            properties:
              type:
                type: string
              sub_type:
                type: string
              is_array:
                type: boolean
              is_searchable:
                type: boolean
            required:
              - type
              - sub_type
              - is_array
              - is_searchable
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````