> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# CountComments

# Package: comments

# Namespace: CommentsNg

# Method link: https://dev.wix.com/docs/api-reference/crm/community/feedback-moderation/comments/comments/count-comments.md

## Permission Scopes:
Manage Comments: SCOPE.DC_COMMENTS.MANAGE.COMMENTS

## Introduction

Counts comments, given the specified filtering. Comments with the `HIDDEN` status are not included in the response.

See [Query Comments](https://dev.wix.com/docs/api-reference/crm/community/feedback-moderation/comments/comments/query-comments.md) for a list of supported filters.

---

## REST API

### Schema

```
 Method: countComments
 Description: Counts comments, given the specified filtering. Comments with the `HIDDEN` status are not included in the response.  See [Query Comments](https://dev.wix.com/docs/api-reference/crm/community/feedback-moderation/comments/comments/query-comments.md) for a list of supported filters.
 URL: https://www.wixapis.com/comments/v1/comments/count
 Method: POST
 Method parameters:
   param name: appId | type: appId | description: App GUID to count the comments of.  | validation: format GUID
   param name: filter | type: filter | description: Filter to identify the comments that need to be counted.  
 Return type: CountCommentsResponse
  - name: count | type: integer | description: Number of comments.  

 Possible Errors:
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: TOO_MANY_TO_COUNT | Description: Number of comments exceeds the server's limit.


```

### Examples

### Count Comments
Count Wix Blog Comments written by specific member

```curl
curl -X POST https://www.wixapis.com/comments/v1/comments/count  \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -H 'Authorization: <AUTH>' \
    -d '{
          "appId": "14bcded7-0066-7c35-14d7-466cb3f09103",
          "filter": {
            "author.memberId": "81b3e2a2-60f4-4016-ab20-c2fda4c4c4f2"
          }
        }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.comments.comments.countComments(appId, options)
 Description: Counts comments, given the specified filtering. Comments with the `HIDDEN` status are not included in the response.  See [Query Comments](https://dev.wix.com/docs/api-reference/crm/community/feedback-moderation/comments/comments/query-comments.md) for a list of supported filters.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  appId
 Method parameters: 
   param name: appId | type: string | description: App GUID to count the comments of. | required: true | validation: format GUID
   param name: options | type: CountCommentsOptions  none  
        - name: filter | type: object | description: Filter to identify the comments that need to be counted.  
 Return type: PROMISE<CountCommentsResponse>
  - name: count | type: integer | description: Number of comments.  

 Possible Errors:
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: TOO_MANY_TO_COUNT | Description: Number of comments exceeds the server's limit.


```

### Examples

### countComments
```javascript
import { comments } from '@wix/comments';

async function countComments(appId,options) {
  const response = await comments.countComments(appId,options);
};
```

### countComments (with elevated permissions)
```javascript
import { comments } from '@wix/comments';
import { auth } from '@wix/essentials';

async function myCountCommentsMethod(appId,options) {
  const elevatedCountComments = auth.elevate(comments.countComments);
  const response = await elevatedCountComments(appId,options);
}
```

### countComments (self-managed)
Self-managed 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 { comments } from '@wix/comments';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function countComments(appId,options) {
  const response = await myWixClient.comments.countComments(appId,options);
};
```

---