Docs·Workspace
GET
/api/v1/spreelytics/meta/property-countCount a property
Returns how much data sits behind one property: the number the report builder shows under a property it describes. Event and visit properties are counted over the last 90 days; a segment is counted over all time.
Every role can call it, Viewer included.
Keys: an account key or an audience key. Getting started explains both kinds.
Parameters
| Prop | In | Type | Notes |
|---|---|---|---|
contactListId | query | string | The audience id, a UUID. With an audience key it must be that key's own audience. |
name | query | string | Required. The property, named the way filters name it: a standard property such as country or utm_source, profile. plus an attribute for a person attribute, a custom event property key, or cohort: plus a segment id. An unknown segment id answers 400, as does a custom name with characters other than letters, digits, _, . and -. |
event? | query | string | Optional, for a custom property only: count only this event's rows that carry the key. page_view works too. |
Response
| Prop | Type | Notes |
|---|---|---|
count | number | Events that carry a non-empty value, for an event property or a custom one. Visits, for a property of the visit such as country, browser or entry_page. Distinct people seen, for a person attribute (for profile.identified, everyone seen). Members, for a segment. |
Request
curl 'https://app.spreelytics.com/api/v1/spreelytics/meta/property-count?contactListId=…&name=…' \
-H 'Authorization: Bearer YOUR_API_KEY'
const url = new URL('https://app.spreelytics.com/api/v1/spreelytics/meta/property-count');
url.searchParams.set('contactListId', '…');
url.searchParams.set('name', '…');
const res = await fetch(url, {
headers: { Authorization: 'Bearer YOUR_API_KEY' },
});
const data = await res.json();
import requests
res = requests.get(
"https://app.spreelytics.com/api/v1/spreelytics/meta/property-count",
headers={"Authorization": "Bearer YOUR_API_KEY"},
params={"contactListId": "…", "name": "…"},
)
data = res.json()
Response
{
"count": 0
}