Docs·Insights
/api/v1/spreelytics/insightsList insights
Returns the insights the Insights page shows: channels, sources, countries, devices and entry pages whose traffic moved sharply against their own recent past. Nobody sets them up. Detection runs once a day for every audience with traffic in the last two days, and again when someone presses Check now in the app.
Each insight compares a window with a baseline, in whole UTC days that end yesterday, so today is never included:
yesterdayagainst the median of the four same weekdays before it, so a quiet Sunday is compared with other Sundays.rolling_7dandrolling_30dagainst the 7 or 30 days immediately before them.
A change becomes an insight only with enough volume: at least 100 sessions across the window and the baseline, a difference of at least 20 sessions, and at least 15%. Entry pages need 200 entries and a difference of 40. At most 20 are kept per module and window, ranked by impact, and an insight that is no longer true disappears at the next run. severity is low below a 50% change, moderate below 100% and severe from there up.
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. |
module? | query | string | Optional. One module: channels, referrers (by source), geo (by country), devices (by device type) or pages (by entry page), the page's Channels, Referrers, Geographic, Devices and Pages sections. Leave it out to get every module in one list. |
window? | query | string | Optional. yesterday, rolling_7d or rolling_30d, the app's Yesterday, 7 Days and 30 Days. Leave it out for all three. |
severity? | query | ``low` \ | moderate \ |
search? | query | string | Optional. Keeps insights whose title, summary or value contains this text, ignoring case. |
sort? | query | InsightSort | impact (the default): highest impact first. recent: newest first, by when each was first detected. |
page? | query | number | Page number, starting at 0. Defaults to 0. |
pageSize? | query | number | Insights per page, up to 100. Defaults to 20. |
Response
| Prop | Type | Notes |
|---|---|---|
content | InsightDto[] | The insights. Each has id, moduleKey, dimensionKey (module and value, such as channel:Organic Search), displayName (the value that moved), windowKind, windowStart and windowEnd (YYYY-MM-DD, both included), a plain-language title and summary, direction (up, down or flat), severity, impactScore, metricLabel (sessions, or entries for pages), current and baseline (the two values compared), changePct (a fraction: 0.24 is up 24%, and a baseline of 0 reads as 1), sharePct and prevSharePct (the value's share of the module's total now and in the baseline, in percent), sparkline (14 daily values ending on the window's last day) and firstDetectedAt and lastSeenAt (ISO timestamps). |
size | number | The page size used. |
page | number | The page returned, counted from 0. |
totalItems | number | How many insights there are across all pages. |
totalPages | number | How many pages there are at this page size. |
Each item in content
| Prop | Type | Notes |
|---|---|---|
id | string | |
moduleKey | string | 'channels' | 'referrers' | 'geo' | 'devices' | 'pages'. |
dimensionKey | string | |
displayName | string | The bare value that moved, e.g. 'Organic Search'. |
windowKind | string | 'yesterday' | 'rolling_7d' | 'rolling_30d'. |
title | string | Statistical headline, always present, with or without AI. |
summary | string | |
direction | string | 'up' | 'down' | 'flat'. |
severity | string | 'low' | 'moderate' | 'severe'. |
impactScore | number | |
current | number | |
baseline | number | |
changePct | number | Fraction: 0.24 = up 24%. |
sharePct | number | This dimension's percentage of the module total, now and before. |
prevSharePct | number | |
metricLabel | string | |
sparkline | number[] | |
windowStart | string | |
windowEnd | string | |
firstDetectedAt | string | |
lastSeenAt | string |
Request
curl 'https://app.spreelytics.com/api/v1/spreelytics/insights?contactListId=…' \
-H 'Authorization: Bearer YOUR_API_KEY'
const url = new URL('https://app.spreelytics.com/api/v1/spreelytics/insights');
url.searchParams.set('contactListId', '…');
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/insights",
headers={"Authorization": "Bearer YOUR_API_KEY"},
params={"contactListId": "…"},
)
data = res.json()
Response
{
"content": [
{
"id": "string",
"moduleKey": "string",
"dimensionKey": "string",
"displayName": "string",
"windowKind": "string",
"title": "string",
"summary": "string",
"direction": "string",
"severity": "string",
"impactScore": 0,
"current": 0,
"baseline": 0,
"changePct": 0,
"sharePct": 0,
"prevSharePct": 0,
"metricLabel": "string",
"sparkline": [
0
],
"windowStart": "string",
"windowEnd": "string",
"firstDetectedAt": "string",
"lastSeenAt": "string"
}
],
"size": 0,
"page": 0,
"totalItems": 0,
"totalPages": 0
}