Docs·Insights

GET/api/v1/spreelytics/insights

List 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:

  • yesterday against the median of the four same weekdays before it, so a quiet Sunday is compared with other Sundays.
  • rolling_7d and rolling_30d against 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

PropInTypeNotes
contactListIdquerystringThe audience id, a UUID. With an audience key it must be that key's own audience.
module?querystringOptional. 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?querystringOptional. 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?querystringOptional. Keeps insights whose title, summary or value contains this text, ignoring case.
sort?queryInsightSortimpact (the default): highest impact first. recent: newest first, by when each was first detected.
page?querynumberPage number, starting at 0. Defaults to 0.
pageSize?querynumberInsights per page, up to 100. Defaults to 20.

Response

PropTypeNotes
contentInsightDto[]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).
sizenumberThe page size used.
pagenumberThe page returned, counted from 0.
totalItemsnumberHow many insights there are across all pages.
totalPagesnumberHow many pages there are at this page size.

Each item in content

PropTypeNotes
idstring
moduleKeystring'channels' | 'referrers' | 'geo' | 'devices' | 'pages'.
dimensionKeystring
displayNamestringThe bare value that moved, e.g. 'Organic Search'.
windowKindstring'yesterday' | 'rolling_7d' | 'rolling_30d'.
titlestringStatistical headline, always present, with or without AI.
summarystring
directionstring'up' | 'down' | 'flat'.
severitystring'low' | 'moderate' | 'severe'.
impactScorenumber
currentnumber
baselinenumber
changePctnumberFraction: 0.24 = up 24%.
sharePctnumberThis dimension's percentage of the module total, now and before.
prevSharePctnumber
metricLabelstring
sparklinenumber[]
windowStartstring
windowEndstring
firstDetectedAtstring
lastSeenAtstring

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
}

See your own numbers today.

Free up to 100k events a month · no credit card

Contact

Tell us what you need.

A real person reads these. We usually reply within one working day.

Or email us directly at contact@spreelytics.com.