> 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

# QueryActivityCounters

# Package: activity

# Namespace: ActivityCounters

# Method link: https://dev.wix.com/docs/api-reference/crm/members-contacts/members/activity/activity-counters/query-activity-counters?apiView=SDK.md

## Permission Scopes:
Read Activity Counters: SCOPE.DC-MEMBERS.READ-ACTIVITY-COUNTERS

## Introduction

Returns up to 100 public activity counters for the provided filter and paging.

Only counters that are marked as public are returned.

Supported fields for filtering:
- `memberId`

Supported operations:

Comparison:
- $eq
- $ne
- $in

Logical:
- $and
- $not
- $or

---

## REST API

### Schema

```
 Method: queryActivityCounters
 Description: Returns up to 100 public activity counters for the provided filter and paging.  Only counters that are marked as public are returned.  Supported fields for filtering: - `memberId`  Supported operations:  Comparison: - $eq - $ne - $in  Logical: - $and - $not - $or
 URL: https://www.wixapis.com/members/v1/activity-counters/query
 Method: POST
 Method parameters:
   param name: query | type: Query    
        - name: filter | type: Value | description: Filter object.  
           - ONE-OF: 
              - name: nullValue | type:  | description:   
              - name: numberValue | type: number | description:   
              - name: stringValue | type: string | description:   
              - name: boolValue | type: boolean | description:   
              - name: structValue | type: object | description:   
              - name: listValue | type: ListValue | description:   
                 - name: values | type: array<Value> | description:   
        - name: paging | type: Paging | description: Paging options.  
           - name: limit | type: integer | description: Number of items to load.  | validation: minimum 0, format int32
           - name: offset | type: integer | description: Number of items to skip in the current sort order.  | validation: minimum 0, format int32
 Return type: QueryActivityCountersResponse
  - name: activityCounters | type: array<ActivityCounter> | description: Retrieved activity counters.  
     - name: memberId | type: string | description: Member GUID.  | validation: format GUID
     - name: appId | type: string | description: App GUID. When developing websites, if you set activity counter data using elevation, the action is assigned to the generic Wix code backend app: `151e476a-715e-ec33-db9a-a7ff4d51f70a`.  | validation: format GUID
     - name: counters | type: array<Counter> | description: Counters for this member.  
        - name: key | type: string | description: Counter key, unique within the given app.  
        - name: public | type: boolean | description: Whether this counter data is available to all. If `false`, the counter is only available to the data owner and counter owner.  
        - name: count | type: integer | description: Activity count.  
     - name: revision | type: string | description: Revision number, which increments by 1 each time the counter is updated. To prevent conflicting changes, the existing revision must be used when updating a counter.  | read-only: true | validation: format int64
  - name: metadata | type: PagingMetadata | description: Paging metadata.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: offset | type: integer | description: Offset that was requested.  | validation: format int32
     - name: total | type: integer | description: Total number of items that match the query.  | validation: format int32
     - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field.  


```

### Examples

### Query activity counters
Retrieving counters with empty filter

```curl
curl -X POST \
  https://www.wixapis.com/members/v1/activity-counters/query \
  -H 'Authorization: <AUTH>' \
  -d '{
      "query": {
          "filter": {}
      }
  }'
```

### Query activity counters
Retrieving counters with two member ids and limit one

```curl
curl -X POST \
  https://www.wixapis.com/members/v1/activity-counters/query \
  -H 'Authorization: <AUTH>' \
  -d '{
    "query": {
        "filter": {
            "memberId": {
                "$in": [
                    "987110f7-5100-4beb-a948-de610fd18f00",
                    "bc93bbe5-228e-4468-a9ac-ebc15f90427e"
                ]
            }
        },
        "paging": {
            "limit": 1
        }
    }
  }'
```

### Query activity counters
Retrieving counters with member id

```curl
curl -X POST \
   https://www.wixapis.com/members/v1/activity-counters/query \
   -H 'Authorization: <AUTH>' \
   -d '{
      "query": {
         "filter": {
               "memberId": "987110f7-5100-4beb-a948-de610fd18f00"
         }
      }
   }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.activityCounters.activityCounters.queryActivityCounters(options)
 Description: Returns up to 100 public activity counters for the provided filter and paging.  Only counters that are marked as public are returned.  Supported fields for filtering: - `memberId`  Supported operations:  Comparison: - $eq - $ne - $in  Logical: - $and - $not - $or
 Method parameters:
   param name: options | type: QueryActivityCountersOptions  none  
        - name: query | type: Query | description: Query options.  
           - name: filter | type: Value | description: Filter object.  
              - ONE-OF: 
                 - name: nullValue | type:  | description:   
                 - name: numberValue | type: number | description:   
                 - name: stringValue | type: string | description:   
                 - name: boolValue | type: boolean | description:   
                 - name: structValue | type: object | description:   
                 - name: listValue | type: ListValue | description:   
                    - name: values | type: array<Value> | description:   
           - name: paging | type: Paging | description: Paging options.  
              - name: limit | type: integer | description: Number of items to load.  | validation: minimum 0, format int32
              - name: offset | type: integer | description: Number of items to skip in the current sort order.  | validation: minimum 0, format int32
 Return type: PROMISE<QueryActivityCountersResponse>
  - name: activityCounters | type: array<ActivityCounter> | description: Retrieved activity counters.  
     - name: memberId | type: string | description: Member GUID.  | validation: format GUID
     - name: appId | type: string | description: App GUID. When developing websites, if you set activity counter data using elevation, the action is assigned to the generic Wix code backend app: `151e476a-715e-ec33-db9a-a7ff4d51f70a`.  | validation: format GUID
     - name: counters | type: array<Counter> | description: Counters for this member.  
        - name: key | type: string | description: Counter key, unique within the given app.  
        - name: public | type: boolean | description: Whether this counter data is available to all. If `false`, the counter is only available to the data owner and counter owner.  
        - name: count | type: integer | description: Activity count.  
     - name: revision | type: string | description: Revision number, which increments by 1 each time the counter is updated. To prevent conflicting changes, the existing revision must be used when updating a counter.  | read-only: true | validation: format int64
  - name: metadata | type: PagingMetadata | description: Paging metadata.  
     - name: count | type: integer | description: Number of items returned in the response.  | validation: format int32
     - name: offset | type: integer | description: Offset that was requested.  | validation: format int32
     - name: total | type: integer | description: Total number of items that match the query.  | validation: format int32
     - name: tooManyToCount | type: boolean | description: Flag that indicates the server failed to calculate the `total` field.  


```

### Examples

### queryActivityCounters
```javascript
import { activityCounters } from '@wix/activity-counters';

async function queryActivityCounters(options) {
  const response = await activityCounters.queryActivityCounters(options);
};
```

### queryActivityCounters (with elevated permissions)
```javascript
import { activityCounters } from '@wix/activity-counters';
import { auth } from '@wix/essentials';

async function myQueryActivityCountersMethod(options) {
  const elevatedQueryActivityCounters = auth.elevate(activityCounters.queryActivityCounters);
  const response = await elevatedQueryActivityCounters(options);
}
```

### queryActivityCounters (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 { activityCounters } from '@wix/activity-counters';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function queryActivityCounters(options) {
  const response = await myWixClient.activityCounters.queryActivityCounters(options);
};
```

---