The Site Data Usage API reports current resource usage and quota limits for the data collections of a single Wix site. Use it to monitor consumption, drive plan-upgrade prompts, or feed cleanup logic before quota limits are reached.
With the Site Data Usage API, you can:
Use this API with the Wix Data APIs to read, write, and manage the items and collections whose usage is reported here.
The API only reports usage for native, Wix-managed data collections. External Database collections aren't counted in collectionCount, don't consume storageLimitInBytes or itemCountLimit, and don't appear in dataCollectionUsages.
LIVE and SANDBOX environmentsEvery Wix site has 2 Wix Data environments:
The API reports usage for both environments. The quota limits, however, apply asymmetrically:
| Limit | How it applies across LIVE and SANDBOX |
|---|---|
storageLimitInBytes | Pooled. Bytes used in LIVE and SANDBOX are summed and counted together against a single shared limit. With a 1 GB limit, LIVE could hold 700 MB and SANDBOX 300 MB before the limit is reached. |
itemCountLimit | Per environment. Each environment may independently hold up to the limit. With a limit of 1,000 items, LIVE can hold 1,000 items, and SANDBOX can hold another 1,000 items. |
collectionCountLimit | Per site. Counts native collections defined for the site. |
The site-wide totals, totalUsedLive and totalUsedSandbox, are what most monitoring and upgrade scenarios need. The per-collection breakdown in dataCollectionUsages is available for scenarios that need to attribute usage to individual collections.
By default, Get Site Data Usage returns values backed by an internal cache and is eventually consistent with recent writes. This is the right tradeoff for almost all scenarios, including monitoring dashboards and upgrade prompts.
If a cached value looks unexpected and you want to cross-check the exact current numbers, set consistentRead to true to bypass the cache. Doing so is more expensive and slower, so use it sparingly.
Quota limits (storageLimitInBytes, itemCountLimit, collectionCountLimit) change only when the site's plan is upgraded or downgraded. They're otherwise stable, so callers can safely cache them and only refetch on plan change.
This API only reports usage and limits, the Wix Data API write methods enforce the limits:
storageLimitInBytes or itemCountLimit is reached, attempts to insert or update items in any native collection on the site fail with a quota error.collectionCountLimit is reached, attempts to create a new native collection fail with a quota error.For the exact error codes returned in each case, see Wix Data Error Codes.
LIVE environment: The Wix Data environment served to visitors of the published site.SANDBOX environment: The Wix Data environment used by the site editor and preview, separate from LIVE.