Hi,
I need list size and growth data via API
please refer below screenshot and help me to get the same data
Best answer by Brian Turcotte
View originalHi,
I need list size and growth data via API
please refer below screenshot and help me to get the same data
Best answer by Brian Turcotte
View originalHi
This functionality isn’t available yet via the APIs, but our Product Team is considering the possibility of adding it to future releases, so I will keep you updated if anything changes.
Best,
Brian
Hello
Is your reply still accurate or has this now changed? I was looking at the following guide: https://developers.klaviyo.com/en/docs/using_the_query_metric_aggregates_endpoint#flow-revenue-performance-reporting
In the list of example uses of this API endpoint it says: “Get list growth data broken down by month, per list.”
Sounds like it would be possible then? It would be good if an example could be given in the same guide as I think this is going to be a popular use of the API (the need to track list growth over time in external reports etc.)
Hi
While there’s not a direct list growth metric that you can grab with this endpoint, there are two ways you could track list growth with the APIs, depending on how you define it:
I hope this helps to clarify!
- Brian
Hey
When I tried to run the same query with “Suppressed from List for Email Marketing” the endpoint worked, but there were no dimensions.
I ran this
start_date = "2023-01-15T00:00:00"
end_date = "2024-01-14T23:59:59"
page_size = 1000
interval = "month"
measurement = "sum_value"
url = "https://a.klaviyo.com/api/metric-aggregates/"
payload = {
"data": {
"type": "metric-aggregate",
"attributes": {
"metric_id": metric_id,
"interval": interval,
"page_size": page_size,
"timezone": "US/Eastern",
"measurements": [measurement],
"filter": [
f"greater-or-equal(datetime,{start_date})",
f"less-than(datetime,{end_date})",
],
"by": ["List"],
},
}
}
headers = {
"accept": "application/json",
"revision": "2023-02-22",
"content-type": "application/json",
"Authorization": f"Klaviyo-API-Key {api_key}",
}
response = requests.post(url, json=payload, headers=headers)
response_json = response.json()
response_json
And the response was
{'type': 'metric-aggregate',
'id': '6066036689615639135',
'attributes': {'dates': ['2023-01-01T05:00:00+00:00',
'2023-02-01T05:00:00+00:00',
'2023-03-01T05:00:00+00:00',
'2023-04-01T04:00:00+00:00',
'2023-05-01T04:00:00+00:00',
'2023-06-01T04:00:00+00:00',
'2023-07-01T04:00:00+00:00',
'2023-08-01T04:00:00+00:00',
'2023-09-01T04:00:00+00:00',
'2023-10-01T04:00:00+00:00',
'2023-11-01T04:00:00+00:00',
'2023-12-01T05:00:00+00:00',
'2024-01-01T05:00:00+00:00'],
'data': [{'dimensions': [''],
'measurements': {'sum_value': [0.0,
0.0,
0.0,
0.0,
...
As you can see, the dimensions are empty, even though I added "by": ["List"] to the parameters of the request.
Anything I can do here? I’ve tried each of the measurements count, unique, sum_value, and I tried different intervals of day and month. It seems like a bug?
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.