> 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 # CountServices # Package: services # Namespace: ServicesService # Method link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/count-services.md ## Permission Scopes: Read Bookings - Public Data: SCOPE.DC-BOOKINGS.READ-BOOKINGS-PUBLIC ## Introduction Counts how many services match the given filter. See [Query Services](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/query-services.md) for a list of supported filters. To learn about working with filters in general, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#filters) --- ## REST API ### Schema ``` Method: countServices Description: Counts how many services match the given filter. See [Query Services](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/query-services.md) for a list of supported filters. To learn about working with filters in general, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#filters) URL: https://www.wixapis.com/_api/bookings/v2/services/count Method: POST Method parameters: param name: filter | type: filter | description: Query filter to base the count on. See [Query Services](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/query-services.md) for a list of supported filters. Return type: CountServicesResponse - name: count | type: integer | description: Number of services matching the specified filter. ``` ### Examples ### Count services ```curl curl -X POST 'https://www.wixapis.com/bookings/v2/services/count' \ -H 'Authorization: ' \ -d '{ "query": { "filter": { "hidden": { "$eq": "false" } } } }' ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.services.ServicesService.countServices(options) Description: Counts how many services match the given filter. See [Query Services](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/query-services.md) for a list of supported filters. To learn about working with filters in general, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#filters) Method parameters: param name: options | type: CountServicesOptions none - name: filter | type: object | description: Query filter to base the count on. See [Query Services](https://dev.wix.com/docs/api-reference/business-solutions/bookings/services/services-v2/query-services.md) for a list of supported filters. Return type: PROMISE - name: count | type: integer | description: Number of services matching the specified filter. ``` ### Examples ### countServices ```javascript import { services } from '@wix/bookings'; async function countServices(options) { const response = await services.countServices(options); }; ``` ### countServices (with elevated permissions) ```javascript import { services } from '@wix/bookings'; import { auth } from '@wix/essentials'; async function myCountServicesMethod(options) { const elevatedCountServices = auth.elevate(services.countServices); const response = await elevatedCountServices(options); } ``` ### countServices (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 { services } from '@wix/bookings'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { services }, // Include the auth strategy and host as relevant }); async function countServices(options) { const response = await myWixClient.services.countServices(options); }; ``` ---