> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# CountBrands

# Package: catalogV3

# Namespace: BrandService

# Method link: https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/brands-v3/count-brands.md

## Permission Scopes:
Read brands in catalog v3: SCOPE.STORES.BRAND_READ

## Introduction

Counts the brands that match the provided filter.

If no filter is passed, Count Brands returns the total number of brands on the store.

Count Brands inherits its filtering from [Query Brands](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/brands-v3/query-brands.md) and supports the same filters.
Sorting and paging don't apply. To learn about filtering, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md).

---

## REST API

### Schema

```
 Method: countBrands
 Description: Counts the brands that match the provided filter.  If no filter is passed, Count Brands returns the total number of brands on the store.  Count Brands inherits its filtering from [Query Brands](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/brands-v3/query-brands.md) and supports the same filters. Sorting and paging don't apply. To learn about filtering, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md).
 URL: https://www.wixapis.com/stores/v3/brands/count
 Method: POST
 Method parameters:
   param name: filter | type: filter | description: Filter object. Learn more about [API query language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md).  Count Brands supports the same filters as [Query Brands](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/brands-v3/query-brands.md).  
 Return type: CountBrandsResponse
  - name: count | type: integer | description: Number of brands that match the filter. If no filter is passed, this is the total number of brands on the store.  


```

### Examples

### Count brands
```curl
curl -X POST \
  'https://www.wixapis.com/stores/v3/brands/count' \
  -H 'Content-type: application/json' \
  -H 'Authorization:  <AUTH>' \
  -d '{
    "filter": {
      "name": {
        "$startsWith": "Nik"
      }
    }
  }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.stores.brandsV3.countBrands(options)
 Description: Counts the brands that match the provided filter.  If no filter is passed, Count Brands returns the total number of brands on the store.  Count Brands inherits its filtering from [Query Brands](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/brands-v3/query-brands.md) and supports the same filters. Sorting and paging don't apply. To learn about filtering, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md).
 Method parameters:
   param name: options | type: CountBrandsOptions  none  
        - name: filter | type: object | description: Filter object. Learn more about [API query language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language.md).  Count Brands supports the same filters as [Query Brands](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/brands-v3/query-brands.md).  
 Return type: PROMISE<CountBrandsResponse>
  - name: count | type: integer | description: Number of brands that match the filter. If no filter is passed, this is the total number of brands on the store.  


```

### Examples

### Count brands by name prefix
Count the brands whose name starts with "Nik", without paging through Query Brands.

```javascript
import { brandsV3 } from "@wix/stores";

async function countBrands() {
  const response = await brandsV3.countBrands({
    filter: {
      name: {
        $startsWith: "Nik",
      },
    },
  });
  return response;
}

/* Promise resolves to:
 * {
 *   "count": 2
 * }
 */

```

### countBrands (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { brandsV3 } from '@wix/stores';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { brandsV3 },
  // Include the auth strategy and host as relevant
});


async function countBrands(options) {
  const response = await myWixClient.brandsV3.countBrands(options);
};
```

---