> 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 # CountPrograms # Package: programs # Namespace: ProgramsService # Method link: https://dev.wix.com/docs/api-reference/business-management/online-programs/programs/program/count-programs.md ## Permission Scopes: Wix Multilingual - Nile Wrapper Domain Events Read: SCOPE.MULTILINGUAL.NILE_WRAPPER_DOMAIN_EVENTS_READ ## Introduction Counts programs matching the filter --- ## REST API ### Schema ``` Method: countPrograms Description: Counts programs matching the filter URL: https://www.wixapis.com/v3/programs/count Method: POST Method parameters: param name: filter | type: filter | description: filter for which count is requested Return type: CountProgramsResponse - name: count | type: integer | description: count of programs matching filter ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.programs.ProgramsService.countPrograms(options) Description: Counts programs matching the filter Method parameters: param name: options | type: CountProgramsOptions none - name: filter | type: object | description: filter for which count is requested Return type: PROMISE - name: count | type: integer | description: count of programs matching filter ``` ### Examples ### countPrograms ```javascript import { programs } from '@wix/online-programs'; async function countPrograms(options) { const response = await programs.countPrograms(options); }; ``` ### countPrograms (with elevated permissions) ```javascript import { programs } from '@wix/online-programs'; import { auth } from '@wix/essentials'; async function myCountProgramsMethod(options) { const elevatedCountPrograms = auth.elevate(programs.countPrograms); const response = await elevatedCountPrograms(options); } ``` ### countPrograms (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 { programs } from '@wix/online-programs'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { programs }, // Include the auth strategy and host as relevant }); async function countPrograms(options) { const response = await myWixClient.programs.countPrograms(options); }; ``` ---