Skip to main content
POST
/
apis
/
ecommerce-service
/
public
/
discovery
/
v2
/
search
/
count
Get Total Product Hit Count
curl --request POST \
  --url https://{base-address}/apis/ecommerce-service/public/discovery/v2/search/count \
  --header 'Content-Type: application/json' \
  --data '{
  "search_term": "<string>",
  "category_id": "<string>",
  "category_name": "<string>",
  "collection_id": "<string>",
  "facets": [
    {
      "field_internal_name": "<string>",
      "value": "<string>"
    }
  ],
  "filter": [
    {
      "group": {
        "operator": "<string>",
        "rules": [
          {
            "action": "<string>",
            "field_name": "<string>",
            "value": "<string>"
          }
        ]
      }
    }
  ]
}'
{
  "Status": "success",
  "Data": {
    "result": {
      "total_count": 123
    },
    "_meta_": {
      "tenant_id": "<string>",
      "workspace_id": "<string>",
      "env_type": "<string>",
      "store_hash": "<string>",
      "content_model_id": "<string>",
      "_fields_": {}
    }
  }
}
Before calling this endpoint, make sure you’ve generated an API token and picked the correct domain. See Authentication & Base URLs.

Headers

x-customer-group-id
string

Optional customer group identifier for segment-specific responses.

x-ecomm-provider
string

E-commerce provider for contextualizing the API call (e.g., shopify, magento, etc.).

Query Parameters

fields
string
required

Comma-separated list of fields to include in the response

locale
string
required

Specifies the language or region for the response data

store_id
string

Identifier of the store within the e-commerce platform.

channel_id
string

Sales or distribution channel identifier.

location_id
string

Identifier for the regional location from the BigCommerce admin panel.

currency
string

Currency code for price displays.

include_fields_meta
boolean

Whether to include metadata about the fields in the response. If true, returns metadata for each filterable field.

skip
integer

Number of items to skip for pagination offset.

limit
integer

Maximum number of items to return.

sort_order
string

Sort direction for counting logic (rarely used for pure counts). asc for ascending, desc for descending.

sort_by
string

Field name by which the results should be sorted.

by_pass_merchandising
boolean

Whether to bypass merchandising rules for count calculations

Body

application/json
search_term
string

The keyword or phrase used to search products

category_id
string

Identifier for the product category to filter results

category_name
string

Name of the product category to filter results

collection_id
string

Identifier for a specific collection or campaign to filter results.

facets
object[]

Facet fields with values to filter product by color, size or other facets

filter
object[]

Query filter expression to narrow results

Response

Total count of matching products.

Status
string
Example:

"success"

Data
object