Query Sites

Download skillThe skill is a reference md and part of wix-manage skill. You can use the following command to add the full wix-manage skill to your project:
Copy

List, count, and find the sites in a Wix account.

  • Auth: account-level (a Wix user token, or an account-level API key). wix token prints one.
  • Permission: SITE_LIST.READ (scope SCOPE.ACC-DC-OS.READ-SITE).
  • Endpoints: list POST https://www.wixapis.com/site-list/v2/sites/query · count POST https://www.wixapis.com/site-list/v2/sites/count.

Include headless sites — filter by namespace

Both endpoints see only WIX-namespace sites by default; headless sites (anything built on a connected OAuth app) are silently excluded. Filter on both namespaces to see everything:

Copy

query takes optional filter, sort (e.g. [{ "fieldName": "createdDate", "order": "DESC" }]), and cursorPaging (max limit 100).

Count before you enumerate

An account can hold thousands of sites. To find one by name, search (see "Find a site by name") rather than enumerate. To walk the whole list, count first and decide whether that's worth it:

Copy

Enumerating costs ~0.7s per 100 sites (100 → ~0.7s, 500 → ~3.4s, ~1,300 → ~9s). For a large count, render the first N sites with a "…and N more" note instead of fetching all of them.

Paginate

The next cursor is at metadata.cursors.next (there is no pagingMetadata field); it already encodes the filter/sort, so follow-up pages send only the cursor:

Copy

Find a site by name

Substring-search by display name with GET manage.wix.com/account/sites/api/sites/search. It returns full site records (headless included) and, with getCount=true, the total:

Copy

Response — the Site object

sites is an array of:

Copy

Next Steps

Use a site's id for site-level API calls — derive a site token from the account token (wix token --site <id>, or the oauth2/token refresh-grant in wix-auth device-flow), then read its context via Read Site Context or create sites with Create Site from Template.

Last updated: 21 August 2026

Did this help?