
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeYes, you can check how many unique attributes are being used in your Sanity project! Here's what you need to know:
You can monitor your project's unique attribute count by accessing the stats API endpoint:
<projectId>.api.sanity.io/v1/data/stats/<datasetName>
Replace <projectId> with your actual project ID and <datasetName> with your dataset name (typically "production"). For example: abc123.api.sanity.io/v1/data/stats/production
In the JSON response, look for fields.count.value - this shows your current unique attribute count. You'll also see fields.count.limit which shows your plan's maximum.
The attribute limits vary based on your Sanity plan:
There are also per-document limits:
An attribute is defined as a unique combination of attribute path and datatype. Think of them as the different paths through your content structure:
{
"foo": [
{
"bar": "text",
"baz": "more text"
}
]
}This counts as 5 unique attributes:
foo → arrayfoo[] → objectfoo[].bar → stringfoo[].baz → stringImportant: Attributes are only counted when they hold actual content. Just changing your schema definitions won't affect the count - you need to actually add or remove content using Studio or the API.
While GROQ doesn't have a built-in "count unique attributes" function, you can use the Vision plugin to query and explore your content structure. The stats endpoint mentioned above is the official way to get the exact count.
If you're approaching your limit, consider:
The stats API is your best friend for monitoring this - check it periodically during development, especially if you're building complex, nested content models!
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store