How to get KPIs and metrics from the Mailchimp API
In this article we will explain how we get your metrics data from Mailchimp to display in MinimalDashboard, but if you want to use this data in your own application you can either use our API or follow the instructions below to write your own implementation.
Mailchimp is a popular email marketing platform offering automation, audience segmentation, and campaign analytics for businesses of all sizes with an API giving you access to your lists and list statistics. You can find their documentation here: Mailchimp's API.
Contents
Authentication
To access MailChimp’s API you need to create a private API Token in the Extra’s section of your account.
Using Http Basic authentication with an empty username but the API token as the password you can then access the API.
Endpoint
The primary endpoint to get all lists is:
https://<DATACENTER>.api.mailchimp.com/3.0/lists
Note that the datacenter (first part of the endpoint) differs between accounts. To find the right datacenter, e.g us1 or us13, check the last part of your API token.
To get the list members you append the list-id
https://<DATACENTER>.api.mailchimp.com/3.0/lists/<list-id>
You currently can’t get historic data for contacts.
How to get your active subscribers count from Mailchimp
To get all contacts send a GET request to and specify the status:
https://<DATACENTER>.api.mailchimp.com/3.0/lists/<list-id>
// Request only the statistics necessary to compute your member count
?fields=stats
This will return a stats
property containing all your metrics:
{
"stats": {
"member_count": 1,
"unsubscribe_count": 1,
"cleaned_count": 0,
"member_count_since_send": 2,
"unsubscribe_count_since_send": 1,
"cleaned_count_since_send": 0,
"campaign_count": 0,
"campaign_last_sent": "",
"merge_field_count": 6,
"avg_sub_rate": 0,
"avg_unsub_rate": 30,
"target_sub_rate": 30,
"open_rate": 0,
"click_rate": 0,
"last_sub_date": "2024-09-17T11:53:19+00:00",
"last_unsub_date": "2024-09-17T11:57:04+00:00"
}
}
You can directly use the member_count
value to get your active subscriber count. Alternatively you can use the other parameters as described in their docs to get other metric data.
Looking for more?
Have a look at our API knowledge base with many more services...
Mailchimp
Email Marketing
If you'd like to have a ready-made dashboard with all the metrics from Mailchimp instead, you can create one with MinimalDashboard in a few clicks.
Create dashboards to show
- Member Count
- Unsubscriber Count
- New Unsubscribes (since last send)
- Open Rate
- Click Rate