Docs·Goals

GET/api/v1/event/analytics/goals/metrics/timeseries

Get goal conversions over time

One series per goal, oldest goal first, each with a point for every bucket of the range: the goal lines on the Overview page's Goals tab. A point counts the people who completed the goal in that bucket, so someone converting on two days counts on both.

Keys: an account key. Getting started explains both kinds.

Parameters

PropInTypeNotes
contactListIdquerystringThe id of the audience (the tracked site) to read, a UUID: anything else returns a 400. You must be a member of the workspace the audience belongs to, or the call returns a 401. An id that matches no audience is not an error: the call returns no data.
startDatequerystringStart of the date range, read as UTC: a date such as 2026-09-01 (from midnight), or an exact time such as 2026-09-01T09:30:00Z. Use one of these two forms.
endDatequerystringEnd of the date range, read as UTC. A date such as 2026-09-30 includes that whole day; an exact time such as 2026-09-30T18:00:00Z ends the range right before that moment. If the workspace has gone past its plan's event allowance this billing period, the range is cut short at the moment the allowance ran out.
granularity?queryGranularityBucket size: minute, hour, day (the default), week or month, in UTC. A bucket is one such interval; weeks start on Monday and months on the 1st. minute needs a range of 25 hours or less and hour one of 8 days or less, or the call returns a 400.
segmentId?querystringLeave this out. It does not take the id of a segment from the Segments page: such an id matches no one, so the results come back empty. To narrow the results to a segment, add ["cohort_id",["<segment id>"]] to filter.
filter?querystringNarrows the results: a URL-encoded JSON array of conditions, each [key, values, operator], where a missing operator means is. Example: [["country",["US","GB"]],["page",["/pricing"],"startsWith"]] keeps visits from the US or the UK that viewed a page starting with /pricing. Every condition must match, and each key can appear once (a second condition on the same key replaces the first). A condition matches any of its values, except that isNot, notContains and notRegex rule out all of them. Operators: is and isNot (exact), contains, notContains, startsWith and endsWith (ignoring case), regex and notRegex (RE2 syntax, so no lookarounds; a pattern that does not compile returns a 400), and isNull and isNotNull (the value is not set, or is set; send [] as the values). Keys: channel, referrer_source, referrer, utm_source, utm_medium, utm_campaign, utm_term, utm_content, country (a two-letter code), region, city, browser, browser_version, os, os_version, screen_size (Desktop, Mobile or Tablet), hostname, entry_page, exit_page, page and event_name (visits that viewed such a page or sent such an event), identified (["true"] or ["false"]), goal_id (people who completed the goal in the range) and cohort_id (members of a segment). The last two take ids and only is or isNot. Unknown keys, and a filter that is not valid JSON, are ignored rather than refused.

Response

An array of GoalTimeseries.

PropTypeNotes
pointsGoalTimeseriesPoint[]{ date, conversions } for every bucket of the range, oldest first, with 0 in empty buckets.
namestringThe goal's name.
goalIdstringThe goal id.

Each item in points

PropTypeNotes
conversionsnumberPeople (or anonymous visitors) who completed the goal in the bucket.
datestringStart of the bucket: YYYY-MM-DD for day, week and month buckets, or YYYY-MM-DD HH:MM:SS in UTC for minute and hour buckets.

Request

curl 'https://app.spreelytics.com/api/v1/event/analytics/goals/metrics/timeseries?contactListId=…&startDate=…&endDate=…' \
  -H 'Authorization: Bearer YOUR_API_KEY'
const url = new URL('https://app.spreelytics.com/api/v1/event/analytics/goals/metrics/timeseries');
url.searchParams.set('contactListId', '…');
url.searchParams.set('startDate', '…');
url.searchParams.set('endDate', '…');

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/event/analytics/goals/metrics/timeseries",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
    params={"contactListId": "…", "startDate": "…", "endDate": "…"},
)
data = res.json()

Response

[
  {
    "points": [
      {
        "conversions": 0,
        "date": "string"
      }
    ],
    "name": "string",
    "goalId": "string"
  }
]

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.